[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Clock block slow in position satellite calculatio
From: |
caruiz.ext |
Subject: |
Re: [Discuss-gnuradio] Clock block slow in position satellite calculation |
Date: |
Tue, 10 Jun 2014 11:39:06 +0200 |
User-agent: |
Roundcube Webmail |
Hi!
--------------------> RetardoSat:
1.Come three samples (method work)
- X: X position of receiver.
- Y: Y position of receiver.
- Z: Z position of receiver.
- ClK: seconds.
2. With Kepler paremeters calculates the satellite position, the
distance between the satellite and the receiver and the signal delay.
3. Send to the output (t) the calculated delay.
float *out = (float*)output_items[0];
const float *inx = (const float *) input_items[0];
const float *iny = (const float *) input_items[1];
const float *inz = (const float *) input_items[2];
const float *inTOW = (const float *) input_items[3];
for(int i=0;i<noutput_items;++i){
...
...
}
--------------------> Reloj:
*Precision = tiempo inicial
**Tasa = sample rate
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
namespace gr {
namespace howto {
reloj_ff::sptr
reloj_ff::make(int tasa, int precision)
{
return gnuradio::get_initial_sptr
(new reloj_ff_impl(tasa, precision));
}
/*
* The private constructor
*/
reloj_ff_impl::reloj_ff_impl(int tasa, int precision)
: gr::block("reloj_ff",
gr::io_signature::make(1,1,sizeof(float)),
gr::io_signature::make(1, 1, sizeof(float)))
{
this->d_tasa=tasa;
this->d_precision=(float)precision;
this->posicion=0;
}
/*
* Our virtual destructor.
*/
reloj_ff_impl::~reloj_ff_impl()
{
}
void
reloj_ff_impl::forecast (int noutput_items, gr_vector_int
&ninput_items_required)
{
ninput_items_required[0] = noutput_items;
}
int
reloj_ff_impl::general_work (int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
float *out = (float*)output_items[0];
const float *in = (const float *) input_items[0];
for(int i=0;i<noutput_items;++i){
if(posicion!=d_tasa){
out[i]=d_precision;
++posicion;
}
else{
d_precision=d_precision+1;
posicion=0;
out[i]=d_precision;
}
}
return noutput_items;
}
} /* namespace howto */
} /* namespace gr */
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#ifndef INCLUDED_HOWTO_RELOJ_FF_IMPL_H
#define INCLUDED_HOWTO_RELOJ_FF_IMPL_H
#include <howto/reloj_ff.h>
namespace gr {
namespace howto {
class reloj_ff_impl : public reloj_ff
{
private:
// Nothing to declare in this block.
public:
reloj_ff_impl(int tasa, int precision);
~reloj_ff_impl();
int d_tasa;
float d_precision;
int posicion;
// Where all the action really happens
void forecast (int noutput_items, gr_vector_int
&ninput_items_required);
int general_work(int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
};
} // namespace howto
} // namespace gr
#endif /* INCLUDED_HOWTO_RELOJ_FF_IMPL_H */
;)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Discuss-gnuradio] Clock block slow in position satellite calculation,
caruiz.ext <=