gnuradio.filter: Channelizers

gnuradio.filter.pfb_channelizer_ccf(unsigned int numchans, pmt_vector_float taps, float oversample_rate) → pfb_channelizer_ccf_sptr

Polyphase filterbank channelizer with gr_complex input, gr_complex output and float taps.

This block takes in complex inputs and channelizes it to channels of equal bandwidth. Each of the resulting channels is decimated to the new rate that is the input sampling rate divided by the number of channels, .

The PFB channelizer code takes the taps generated above and builds a set of filters. The set contains 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.

Each filter operates using the gr::blocks::fir_filter_XXX classs of GNU Radio, which takes the input stream at and performs the inner product calculation to where is the number of filter taps. To efficiently handle this in the GNU Radio structure, each filter input must come from its own input stream. So the channelizer must be provided with streams where the input stream has been deinterleaved. This is most easily done using the gr::blocks::stream_to_streams block.

The output is then produced as a vector, where index in the vector is the next sample from the th channel. This is most easily handled by sending the output to a gr::blocks::vector_to_streams block to handle the conversion and passing streams out.

The input and output formatting is done using a hier_block2 called pfb_channelizer_ccf. This can take in a single stream and outputs streams based on the behavior described above.

The filter’s taps should be based on the input sampling rate.

For example, using the GNU Radio’s firdes utility to building filters, we build a low-pass filter with a sampling rate of , a 3-dB bandwidth of and a transition bandwidth of . We can also specify the out-of-band attenuation to use, , 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.

The filter output can also be overs ampled. The over sampling rate is the ratio of the the actual output sampling rate to the normal output sampling rate. It must be rationally related to the number of channels as N/i for i in [1,N], which gives an outputsample rate of [fs/N, fs] where fs is the input sample rate and N is the number of channels.

For example, for 6 channels with fs = 6000 Hz, the normal rate is 6000/6 = 1000 Hz. Allowable oversampling rates are 6/6, 6/5, 6/4, 6/3, 6/2, and 6/1 where the output sample rate of a 6/1 oversample ratio is 6000 Hz, or 6 times the normal 1000 Hz. A rate of 6/5 = 1.2, so the output rate would be 1200 Hz.

The theory behind this block can be found in Chapter 6 of the following book.

When dealing with oversampling, the above book is still a good reference along with this paper:

Constructor Specific Documentation:

Build the polyphase filterbank decimator. For example, for 6 channels with fs = 6000 Hz, the normal rateis 6000/6 = 1000 Hz. Allowable oversampling rates are 6/6, 6/5, 6/4, 6/3, 6/2, and 6/1 where the output sample rate of a 6/1 oversample ratio is 6000 Hz, or 6 times the normal 1000 Hz.

Parameters:
  • numchans – (unsigned integer) Specifies the number of channels
  • taps – (vector/list of floats) The prototype filter to populate the filterbank.
  • oversample_rate – (float) The over sampling rate is the ratio of the the actual output sampling rate to the normal output sampling rate. It must be rationally related to the number of channels as N/i for i in [1,N], which gives an outputsample rate of [fs/N, fs] where fs is the input sample rate and N is the number of channels.
pfb_channelizer_ccf_sptr.active_thread_priority(pfb_channelizer_ccf_sptr self) → int
pfb_channelizer_ccf_sptr.channel_map(pfb_channelizer_ccf_sptr self) → std::vector< int,std::allocator< int > >

Gets the current channel map.

pfb_channelizer_ccf_sptr.declare_sample_delay(pfb_channelizer_ccf_sptr self, int which, int delay)

declare_sample_delay(pfb_channelizer_ccf_sptr self, unsigned int delay)

pfb_channelizer_ccf_sptr.message_subscribers(pfb_channelizer_ccf_sptr self, swig_int_ptr which_port) → swig_int_ptr
pfb_channelizer_ccf_sptr.min_noutput_items(pfb_channelizer_ccf_sptr self) → int
pfb_channelizer_ccf_sptr.pc_input_buffers_full_avg(pfb_channelizer_ccf_sptr self, int which) → float

pc_input_buffers_full_avg(pfb_channelizer_ccf_sptr self) -> pmt_vector_float

pfb_channelizer_ccf_sptr.pc_noutput_items_avg(pfb_channelizer_ccf_sptr self) → float
pfb_channelizer_ccf_sptr.pc_nproduced_avg(pfb_channelizer_ccf_sptr self) → float
pfb_channelizer_ccf_sptr.pc_output_buffers_full_avg(pfb_channelizer_ccf_sptr self, int which) → float

pc_output_buffers_full_avg(pfb_channelizer_ccf_sptr self) -> pmt_vector_float

pfb_channelizer_ccf_sptr.pc_throughput_avg(pfb_channelizer_ccf_sptr self) → float
pfb_channelizer_ccf_sptr.pc_work_time_avg(pfb_channelizer_ccf_sptr self) → float
pfb_channelizer_ccf_sptr.pc_work_time_total(pfb_channelizer_ccf_sptr self) → float
pfb_channelizer_ccf_sptr.print_taps(pfb_channelizer_ccf_sptr self)

Print all of the filterbank taps to screen.

pfb_channelizer_ccf_sptr.sample_delay(pfb_channelizer_ccf_sptr self, int which) → unsigned int
pfb_channelizer_ccf_sptr.set_channel_map(pfb_channelizer_ccf_sptr self, std::vector< int, std::allocator< int > > const & map)

Set the channel map. Channels are numbers as: <—————- 0 —————–> freq

So output stream 0 comes from channel 0, etc. Setting a new channel map allows the user to specify which channel in frequency he/she wants to got to which output stream.

The map should have the same number of elements as the number of output connections from the block. The minimum value of the map is 0 (for the 0th channel) and the maximum number is N-1 where N is the number of channels.

We specify M as the number of output connections made where M <= N, so only M out of N channels are driven to an output stream. The number of items in the channel map should be at least M long. If there are more channels specified, any value in the map over M-1 will be ignored. If the size of the map is less than M the behavior is unknown (we don’t wish to check every entry into the work function).

This means that if the channelizer is splitting the signal up into N channels but only M channels are specified in the map (where M <= N), then M output streams must be connected and the map and the channel numbers used must be less than N-1. Output channel number can be reused, too. By default, the map is [0...M-1] with M = N.

pfb_channelizer_ccf_sptr.set_min_noutput_items(pfb_channelizer_ccf_sptr self, int m)
pfb_channelizer_ccf_sptr.set_taps(pfb_channelizer_ccf_sptr self, pmt_vector_float taps)

Resets the filterbank’s filter taps with the new prototype filter

pfb_channelizer_ccf_sptr.set_thread_priority(pfb_channelizer_ccf_sptr self, int priority) → int
pfb_channelizer_ccf_sptr.taps(pfb_channelizer_ccf_sptr self) → std::vector< std::vector< float,std::allocator< float > >,std::allocator< std::vector< float,std::allocator< float > > > >

Return a vector<vector<>> of the filterbank taps

pfb_channelizer_ccf_sptr.thread_priority(pfb_channelizer_ccf_sptr self) → int
gnuradio.filter.pfb_decimator_ccf(unsigned int decim, pmt_vector_float taps, unsigned int channel, bool use_fft_rotator=True, bool use_fft_filters=True) → pfb_decimator_ccf_sptr

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 parameter specifies which channel to use since this class is capable of bandpass decimation. Given a complex input stream at a sampling rate of and a decimation rate of , the input frequency domain is split into 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::filter::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 , a 3-dB bandwidth of and a transition bandwidth of . We can also specify the out-of-band attenuation to use, , 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.

The PFB decimator code takes the taps generated above and builds a set of filters. The set contains 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.

Constructor Specific Documentation:

Build the polyphase filterbank decimator.

Parameters:
  • 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].
  • use_fft_rotator – (bool) Rotate channels using FFT method instead of exp(phi). For larger values of , the FFT method will perform better. Generally, this value of is small (~5), but could be architecture-specific (Default: true).
  • use_fft_filters – (bool) Use FFT filters (fast convolution) instead of FIR filters. FFT filters perform better for larger numbers of taps but is architecture-specific (Default: true).
pfb_decimator_ccf_sptr.active_thread_priority(pfb_decimator_ccf_sptr self) → int
pfb_decimator_ccf_sptr.declare_sample_delay(pfb_decimator_ccf_sptr self, int which, int delay)

declare_sample_delay(pfb_decimator_ccf_sptr self, unsigned int delay)

pfb_decimator_ccf_sptr.message_subscribers(pfb_decimator_ccf_sptr self, swig_int_ptr which_port) → swig_int_ptr
pfb_decimator_ccf_sptr.min_noutput_items(pfb_decimator_ccf_sptr self) → int
pfb_decimator_ccf_sptr.pc_input_buffers_full_avg(pfb_decimator_ccf_sptr self, int which) → float

pc_input_buffers_full_avg(pfb_decimator_ccf_sptr self) -> pmt_vector_float

pfb_decimator_ccf_sptr.pc_noutput_items_avg(pfb_decimator_ccf_sptr self) → float
pfb_decimator_ccf_sptr.pc_nproduced_avg(pfb_decimator_ccf_sptr self) → float
pfb_decimator_ccf_sptr.pc_output_buffers_full_avg(pfb_decimator_ccf_sptr self, int which) → float

pc_output_buffers_full_avg(pfb_decimator_ccf_sptr self) -> pmt_vector_float

pfb_decimator_ccf_sptr.pc_throughput_avg(pfb_decimator_ccf_sptr self) → float
pfb_decimator_ccf_sptr.pc_work_time_avg(pfb_decimator_ccf_sptr self) → float
pfb_decimator_ccf_sptr.pc_work_time_total(pfb_decimator_ccf_sptr self) → float
pfb_decimator_ccf_sptr.print_taps(pfb_decimator_ccf_sptr self)

Print all of the filterbank taps to screen.

pfb_decimator_ccf_sptr.sample_delay(pfb_decimator_ccf_sptr self, int which) → unsigned int
pfb_decimator_ccf_sptr.set_channel(pfb_decimator_ccf_sptr self, unsigned int const channel)
pfb_decimator_ccf_sptr.set_min_noutput_items(pfb_decimator_ccf_sptr self, int m)
pfb_decimator_ccf_sptr.set_taps(pfb_decimator_ccf_sptr self, pmt_vector_float taps)

Resets the filterbank’s filter taps with the new prototype filter

pfb_decimator_ccf_sptr.set_thread_priority(pfb_decimator_ccf_sptr self, int priority) → int
pfb_decimator_ccf_sptr.taps(pfb_decimator_ccf_sptr self) → std::vector< std::vector< float,std::allocator< float > >,std::allocator< std::vector< float,std::allocator< float > > > >

Return a vector<vector<>> of the filterbank taps

pfb_decimator_ccf_sptr.thread_priority(pfb_decimator_ccf_sptr self) → int
gnuradio.filter.pfb_interpolator_ccf(unsigned int interp, pmt_vector_float taps) → pfb_interpolator_ccf_sptr

Polyphase filterbank interpolator with gr_complex input, gr_complex output and float taps.

This block takes in a signal stream and performs interger up- sampling (interpolation) with a polyphase filterbank. The first input is the integer specifying how much to interpolate by. The second input is a vector (Python list) of floating-point taps of the prototype filter.

The filter’s taps should be based on the interpolation rate specified. That is, the bandwidth specified is relative to the bandwidth after interpolation.

For example, using the GNU Radio’s firdes utility to building filters, we build a low-pass filter with a sampling rate of , a 3-dB bandwidth of and a transition bandwidth of . 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, which is also specified as the interpolation rate so that the output levels are the same as the input (this creates an overall increase in power).

The PFB interpolator code takes the taps generated above and builds a set of filters. The set contains number of filters and each filter contains ceil(taps.size()/interp) 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 7.1 of the following book.

Constructor Specific Documentation:

Build the polyphase filterbank interpolator.

Parameters:
  • interp – (unsigned integer) Specifies the interpolation rate to use
  • taps – (vector/list of floats) The prototype filter to populate the filterbank. The taps should be generated at the interpolated sampling rate.
pfb_interpolator_ccf_sptr.active_thread_priority(pfb_interpolator_ccf_sptr self) → int
pfb_interpolator_ccf_sptr.declare_sample_delay(pfb_interpolator_ccf_sptr self, int which, int delay)

declare_sample_delay(pfb_interpolator_ccf_sptr self, unsigned int delay)

pfb_interpolator_ccf_sptr.message_subscribers(pfb_interpolator_ccf_sptr self, swig_int_ptr which_port) → swig_int_ptr
pfb_interpolator_ccf_sptr.min_noutput_items(pfb_interpolator_ccf_sptr self) → int
pfb_interpolator_ccf_sptr.pc_input_buffers_full_avg(pfb_interpolator_ccf_sptr self, int which) → float

pc_input_buffers_full_avg(pfb_interpolator_ccf_sptr self) -> pmt_vector_float

pfb_interpolator_ccf_sptr.pc_noutput_items_avg(pfb_interpolator_ccf_sptr self) → float
pfb_interpolator_ccf_sptr.pc_nproduced_avg(pfb_interpolator_ccf_sptr self) → float
pfb_interpolator_ccf_sptr.pc_output_buffers_full_avg(pfb_interpolator_ccf_sptr self, int which) → float

pc_output_buffers_full_avg(pfb_interpolator_ccf_sptr self) -> pmt_vector_float

pfb_interpolator_ccf_sptr.pc_throughput_avg(pfb_interpolator_ccf_sptr self) → float
pfb_interpolator_ccf_sptr.pc_work_time_avg(pfb_interpolator_ccf_sptr self) → float
pfb_interpolator_ccf_sptr.pc_work_time_total(pfb_interpolator_ccf_sptr self) → float
pfb_interpolator_ccf_sptr.print_taps(pfb_interpolator_ccf_sptr self)

Print all of the filterbank taps to screen.

pfb_interpolator_ccf_sptr.sample_delay(pfb_interpolator_ccf_sptr self, int which) → unsigned int
pfb_interpolator_ccf_sptr.set_min_noutput_items(pfb_interpolator_ccf_sptr self, int m)
pfb_interpolator_ccf_sptr.set_taps(pfb_interpolator_ccf_sptr self, pmt_vector_float taps)

Resets the filterbank’s filter taps with the new prototype filter

pfb_interpolator_ccf_sptr.set_thread_priority(pfb_interpolator_ccf_sptr self, int priority) → int
pfb_interpolator_ccf_sptr.taps(pfb_interpolator_ccf_sptr self) → std::vector< std::vector< float,std::allocator< float > >,std::allocator< std::vector< float,std::allocator< float > > > >

Return a vector<vector<>> of the filterbank taps

pfb_interpolator_ccf_sptr.thread_priority(pfb_interpolator_ccf_sptr self) → int
gnuradio.filter.pfb_synthesizer_ccf(unsigned int numchans, pmt_vector_float taps, bool twox=False) → pfb_synthesizer_ccf_sptr

Polyphase synthesis filterbank with gr_complex input, gr_complex output and float taps.

The PFB sythesis filterbank combines multiple baseband signals into a single channelized signal. Each input stream is, essentially, modulated onto an output channel according the the channel mapping (see set_channel_map for details).

Setting this filterbank up means selecting the number of output channels, the prototype filter, and whether to handle channels at 2x the sample rate (this is generally used only for reconstruction filtering).

The number of channels sets the maximum number of channels to use, but not all input streams must be connected. For M total channels, we can connect inputs 0 to N where N < M-1. Because of the way GNU Radio handles stream connections, we must connect the channels consecutively, and so we must use the set_channel_map if the desired output channels are not the same as the the default mapping. This features gives us the flexibility to output to any given channel. Generally, we try to not use the channels at the edge of the spectrum to avoid issues with filtering and roll-off of the transmitter or receiver.

When using the 2x sample rate mode, we specify the number of channels that will be used. However, the actual output signal will be twice this number of channels. This is mainly important to know when setting the channel map. For M channels, the channel mapping can specy from 0 to 2M-1 channels to output onto.

For more details about this and the concepts of reconstruction filtering, see:

Constructor Specific Documentation:

Build the polyphase synthesis filterbank.

Parameters:
  • numchans – (unsigned integer) Specifies the number of channels
  • taps – (vector/list of floats) The prototype filter to populate the filterbank.
  • twox – (bool) use 2x oversampling or not (default is no)
pfb_synthesizer_ccf_sptr.active_thread_priority(pfb_synthesizer_ccf_sptr self) → int
pfb_synthesizer_ccf_sptr.channel_map(pfb_synthesizer_ccf_sptr self) → std::vector< int,std::allocator< int > >

Gets the current channel map.

pfb_synthesizer_ccf_sptr.declare_sample_delay(pfb_synthesizer_ccf_sptr self, int which, int delay)

declare_sample_delay(pfb_synthesizer_ccf_sptr self, unsigned int delay)

pfb_synthesizer_ccf_sptr.message_subscribers(pfb_synthesizer_ccf_sptr self, swig_int_ptr which_port) → swig_int_ptr
pfb_synthesizer_ccf_sptr.min_noutput_items(pfb_synthesizer_ccf_sptr self) → int
pfb_synthesizer_ccf_sptr.pc_input_buffers_full_avg(pfb_synthesizer_ccf_sptr self, int which) → float

pc_input_buffers_full_avg(pfb_synthesizer_ccf_sptr self) -> pmt_vector_float

pfb_synthesizer_ccf_sptr.pc_noutput_items_avg(pfb_synthesizer_ccf_sptr self) → float
pfb_synthesizer_ccf_sptr.pc_nproduced_avg(pfb_synthesizer_ccf_sptr self) → float
pfb_synthesizer_ccf_sptr.pc_output_buffers_full_avg(pfb_synthesizer_ccf_sptr self, int which) → float

pc_output_buffers_full_avg(pfb_synthesizer_ccf_sptr self) -> pmt_vector_float

pfb_synthesizer_ccf_sptr.pc_throughput_avg(pfb_synthesizer_ccf_sptr self) → float
pfb_synthesizer_ccf_sptr.pc_work_time_avg(pfb_synthesizer_ccf_sptr self) → float
pfb_synthesizer_ccf_sptr.pc_work_time_total(pfb_synthesizer_ccf_sptr self) → float
pfb_synthesizer_ccf_sptr.print_taps(pfb_synthesizer_ccf_sptr self)

Print all of the filterbank taps to screen.

pfb_synthesizer_ccf_sptr.sample_delay(pfb_synthesizer_ccf_sptr self, int which) → unsigned int
pfb_synthesizer_ccf_sptr.set_channel_map(pfb_synthesizer_ccf_sptr self, std::vector< int, std::allocator< int > > const & map)

Set the channel map. Channels are numbers as: N/2+1 | ... | N-1 | 0 | 1 | 2 | ... | N/2 <—————- 0 —————–> freq

So input stream 0 goes to channel 0, etc. Setting a new channel map allows the user to specify where in frequency he/she wants the input stream to go. This is especially useful to avoid putting signals into the channels on the edge of the spectrum which can either wrap around (in the case of odd number of channels) and be affected by filter rolloff in the transmitter.

The map must be at least the number of streams being sent to the block. Less and the algorithm will not have enough data to properly setup the buffers. Any more channels specified will be ignored.

pfb_synthesizer_ccf_sptr.set_min_noutput_items(pfb_synthesizer_ccf_sptr self, int m)
pfb_synthesizer_ccf_sptr.set_taps(pfb_synthesizer_ccf_sptr self, pmt_vector_float taps)

Resets the filterbank’s filter taps with the new prototype filter

pfb_synthesizer_ccf_sptr.set_thread_priority(pfb_synthesizer_ccf_sptr self, int priority) → int
pfb_synthesizer_ccf_sptr.taps(pfb_synthesizer_ccf_sptr self) → std::vector< std::vector< float,std::allocator< float > >,std::allocator< std::vector< float,std::allocator< float > > > >

Return a vector<vector<>> of the filterbank taps

pfb_synthesizer_ccf_sptr.thread_priority(pfb_synthesizer_ccf_sptr self) → int

Previous topic

gnuradio.analog: Modulators and Demodulators

Next topic

gnuradio.filter: Resamplers

This Page