Thursday, October 11, 2012

Adaptive Filtering with GNURADIO & USRP : Part-4

Lets see what is inside the gr_adaptive_fir_ccc class
There are two files c++ and header file.

Its declaration can be found in the header  gr_adaptive_fir_ccc.h


The line in header

class GR_CORE_API gr_adaptive_fir_ccc : public gr_sync_decimator

Tells that gr_adaptive_fir_ccc is a publickly derived class of the base class gr_sync_decimator

There are two private variables

std::vector  d_new_taps; // vector type gr_complex
bool                     d_updated; // bool

One is of type gr_complex and another is of type bool.
To see the data types in gnuradio please refer to gr_types.h in /usr/local/include/gnuradio

There are two protected variables also

gr_complex               d_error; // gr_complex type
std::vector  d_taps; // vector type gr_complex

There are two virtual functions
virtual gr_complex error(const gr_complex &out) = 0;
virtual void update_tap(gr_complex &tap, const gr_complex &in) = 0;

whose definition can be overridden to calculate the error signal per output and
to calculate new weight from old, corresponding input respectively.

These two virtual functions are also protected.

There are two public functions
void set_taps(const std::vector &taps);
 int work(int noutput_items,
          gr_vector_const_void_star &input_items,
          gr_vector_void_star &output_items);

for setting the tap weights and calling the work function.


No comments:

Post a Comment