GNU Radio 3.5.1 C++ API
|
Polyphase filterbank bandpass decimator with gr_complex input, gr_complex output and float taps. More...
#include <gr_pfb_decimator_ccf.h>
Public Member Functions | |
~gr_pfb_decimator_ccf () | |
void | set_taps (const std::vector< float > &taps) |
void | print_taps () |
int | work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) |
just like gr_block::general_work, only this arranges to call consume_each for you | |
Friends | |
GR_CORE_API gr_pfb_decimator_ccf_sptr | gr_make_pfb_decimator_ccf (unsigned int decim, const std::vector< float > &taps, unsigned int channel) |
Polyphase filterbank bandpass decimator with gr_complex input, gr_complex output and float taps.
This block takes in a signal stream and performs interger down- sampling (decimation) with a polyphase filterbank. The first input is the integer specifying how much to decimate by. The second input is a vector (Python list) of floating-point taps of the prototype filter. The third input specifies the channel to extract. By default, the zeroth channel is used, which is the baseband channel (first Nyquist zone).
The channel parameter specifies which channel to use since this class is capable of bandpass decimation. Given a complex input stream at a sampling rate of fs and a decimation rate of decim, the input frequency domain is split into decim channels that represent the Nyquist zones. Using the polyphase filterbank, we can select any one of these channels to decimate.
The output signal will be the basebanded and decimated signal from that channel. This concept is very similar to the PFB channelizer (see gr_pfb_channelizer_ccf) where only a single channel is extracted at a time.
The filter's taps should be based on the sampling rate before decimation.
For example, using the GNU Radio's firdes utility to building filters, we build a low-pass filter with a sampling rate of fs, a 3-dB bandwidth of BW and a transition bandwidth of TB. We can also specify the out-of-band attenuation to use, ATT, and the filter window function (a Blackman-harris window in this case). The first input is the gain of the filter, which we specify here as unity.
self._taps = gr.firdes.low_pass_2(1, fs, BW, TB, attenuation_dB=ATT, window=gr.firdes.WIN_BLACKMAN_hARRIS)
The PFB decimator code takes the taps generated above and builds a set of filters. The set contains decim number of filters and each filter contains ceil(taps.size()/decim) number of taps. Each tap from the filter prototype is sequentially inserted into the next filter. When all of the input taps are used, the remaining filters in the filterbank are filled out with 0's to make sure each filter has the same number of taps.
The theory behind this block can be found in Chapter 6 of the following book.
f. harris, "Multirate Signal Processing for Communication Systems," Upper Saddle River, NJ: Prentice Hall, Inc. 2004.
gr_pfb_decimator_ccf::~gr_pfb_decimator_ccf | ( | ) |
void gr_pfb_decimator_ccf::print_taps | ( | ) |
Print all of the filterbank taps to screen.
void gr_pfb_decimator_ccf::set_taps | ( | const std::vector< float > & | taps | ) |
Resets the filterbank's filter taps with the new prototype filter
taps | (vector/list of floats) The prototype filter to populate the filterbank. |
int gr_pfb_decimator_ccf::work | ( | int | noutput_items, |
gr_vector_const_void_star & | input_items, | ||
gr_vector_void_star & | output_items | ||
) | [virtual] |
just like gr_block::general_work, only this arranges to call consume_each for you
The user must override work to define the signal processing code
Implements gr_sync_block.
GR_CORE_API gr_pfb_decimator_ccf_sptr gr_make_pfb_decimator_ccf | ( | unsigned int | decim, |
const std::vector< float > & | taps, | ||
unsigned int | channel | ||
) | [friend] |
Build the polyphase filterbank decimator.
decim | (unsigned integer) Specifies the decimation rate to use |
taps | (vector/list of floats) The prototype filter to populate the filterbank. |
channel | (unsigned integer) Selects the channel to return [default=0]. |