gnuradio.filter: Resamplers

gnuradio.filter.fractional_interpolator_cc(float phase_shift, float interp_ratio) → fractional_interpolator_cc_sptr

Interpolating MMSE filter with complex input, complex output.

Constructor Specific Documentation:

Build the interpolating MMSE filter (complex input, complex output)

Parameters:
  • phase_shift – The phase shift of the output signal to the input
  • interp_ratio – The interpolation ratio = input_rate / output_rate.
fractional_interpolator_cc_sptr.active_thread_priority(fractional_interpolator_cc_sptr self) → int
fractional_interpolator_cc_sptr.declare_sample_delay(fractional_interpolator_cc_sptr self, int which, int delay)

declare_sample_delay(fractional_interpolator_cc_sptr self, unsigned int delay)

fractional_interpolator_cc_sptr.interp_ratio(fractional_interpolator_cc_sptr self) → float
fractional_interpolator_cc_sptr.message_subscribers(fractional_interpolator_cc_sptr self, swig_int_ptr which_port) → swig_int_ptr
fractional_interpolator_cc_sptr.min_noutput_items(fractional_interpolator_cc_sptr self) → int
fractional_interpolator_cc_sptr.mu(fractional_interpolator_cc_sptr self) → float
fractional_interpolator_cc_sptr.pc_input_buffers_full_avg(fractional_interpolator_cc_sptr self, int which) → float

pc_input_buffers_full_avg(fractional_interpolator_cc_sptr self) -> pmt_vector_float

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

pc_output_buffers_full_avg(fractional_interpolator_cc_sptr self) -> pmt_vector_float

fractional_interpolator_cc_sptr.pc_work_time_avg(fractional_interpolator_cc_sptr self) → float
fractional_interpolator_cc_sptr.pc_work_time_total(fractional_interpolator_cc_sptr self) → float
fractional_interpolator_cc_sptr.sample_delay(fractional_interpolator_cc_sptr self, int which) → unsigned int
fractional_interpolator_cc_sptr.set_interp_ratio(fractional_interpolator_cc_sptr self, float interp_ratio)
fractional_interpolator_cc_sptr.set_min_noutput_items(fractional_interpolator_cc_sptr self, int m)
fractional_interpolator_cc_sptr.set_mu(fractional_interpolator_cc_sptr self, float mu)
fractional_interpolator_cc_sptr.set_thread_priority(fractional_interpolator_cc_sptr self, int priority) → int
fractional_interpolator_cc_sptr.thread_priority(fractional_interpolator_cc_sptr self) → int
gnuradio.filter.fractional_interpolator_ff(float phase_shift, float interp_ratio) → fractional_interpolator_ff_sptr

Interpolating MMSE filter with float input, float output.

Constructor Specific Documentation:

Build the interpolating MMSE filter (float input, float output)

Parameters:
  • phase_shift – The phase shift of the output signal to the input
  • interp_ratio – The interpolation ratio = input_rate / output_rate.
fractional_interpolator_ff_sptr.active_thread_priority(fractional_interpolator_ff_sptr self) → int
fractional_interpolator_ff_sptr.declare_sample_delay(fractional_interpolator_ff_sptr self, int which, int delay)

declare_sample_delay(fractional_interpolator_ff_sptr self, unsigned int delay)

fractional_interpolator_ff_sptr.interp_ratio(fractional_interpolator_ff_sptr self) → float
fractional_interpolator_ff_sptr.message_subscribers(fractional_interpolator_ff_sptr self, swig_int_ptr which_port) → swig_int_ptr
fractional_interpolator_ff_sptr.min_noutput_items(fractional_interpolator_ff_sptr self) → int
fractional_interpolator_ff_sptr.mu(fractional_interpolator_ff_sptr self) → float
fractional_interpolator_ff_sptr.pc_input_buffers_full_avg(fractional_interpolator_ff_sptr self, int which) → float

pc_input_buffers_full_avg(fractional_interpolator_ff_sptr self) -> pmt_vector_float

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

pc_output_buffers_full_avg(fractional_interpolator_ff_sptr self) -> pmt_vector_float

fractional_interpolator_ff_sptr.pc_work_time_avg(fractional_interpolator_ff_sptr self) → float
fractional_interpolator_ff_sptr.pc_work_time_total(fractional_interpolator_ff_sptr self) → float
fractional_interpolator_ff_sptr.sample_delay(fractional_interpolator_ff_sptr self, int which) → unsigned int
fractional_interpolator_ff_sptr.set_interp_ratio(fractional_interpolator_ff_sptr self, float interp_ratio)
fractional_interpolator_ff_sptr.set_min_noutput_items(fractional_interpolator_ff_sptr self, int m)
fractional_interpolator_ff_sptr.set_mu(fractional_interpolator_ff_sptr self, float mu)
fractional_interpolator_ff_sptr.set_thread_priority(fractional_interpolator_ff_sptr self, int priority) → int
fractional_interpolator_ff_sptr.thread_priority(fractional_interpolator_ff_sptr self) → int
gnuradio.filter.fractional_resampler_cc(float phase_shift, float resamp_ratio) → fractional_resampler_cc_sptr

resampling MMSE filter with complex input, complex output

Constructor Specific Documentation:

Build the resampling MMSE filter (complex input, complex output)

Parameters:
  • phase_shift – The phase shift of the output signal to the input
  • resamp_ratio – The resampling ratio = input_rate / output_rate.
fractional_resampler_cc_sptr.active_thread_priority(fractional_resampler_cc_sptr self) → int
fractional_resampler_cc_sptr.declare_sample_delay(fractional_resampler_cc_sptr self, int which, int delay)

declare_sample_delay(fractional_resampler_cc_sptr self, unsigned int delay)

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

pc_input_buffers_full_avg(fractional_resampler_cc_sptr self) -> pmt_vector_float

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

pc_output_buffers_full_avg(fractional_resampler_cc_sptr self) -> pmt_vector_float

fractional_resampler_cc_sptr.pc_work_time_avg(fractional_resampler_cc_sptr self) → float
fractional_resampler_cc_sptr.pc_work_time_total(fractional_resampler_cc_sptr self) → float
fractional_resampler_cc_sptr.resamp_ratio(fractional_resampler_cc_sptr self) → float
fractional_resampler_cc_sptr.sample_delay(fractional_resampler_cc_sptr self, int which) → unsigned int
fractional_resampler_cc_sptr.set_min_noutput_items(fractional_resampler_cc_sptr self, int m)
fractional_resampler_cc_sptr.set_mu(fractional_resampler_cc_sptr self, float mu)
fractional_resampler_cc_sptr.set_resamp_ratio(fractional_resampler_cc_sptr self, float resamp_ratio)
fractional_resampler_cc_sptr.set_thread_priority(fractional_resampler_cc_sptr self, int priority) → int
fractional_resampler_cc_sptr.thread_priority(fractional_resampler_cc_sptr self) → int
gnuradio.filter.fractional_resampler_ff(float phase_shift, float resamp_ratio) → fractional_resampler_ff_sptr

Resampling MMSE filter with float input, float output.

Constructor Specific Documentation:

Build the resampling MMSE filter (float input, float output)

Parameters:
  • phase_shift – The phase shift of the output signal to the input
  • resamp_ratio – The resampling ratio = input_rate / output_rate.
fractional_resampler_ff_sptr.active_thread_priority(fractional_resampler_ff_sptr self) → int
fractional_resampler_ff_sptr.declare_sample_delay(fractional_resampler_ff_sptr self, int which, int delay)

declare_sample_delay(fractional_resampler_ff_sptr self, unsigned int delay)

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

pc_input_buffers_full_avg(fractional_resampler_ff_sptr self) -> pmt_vector_float

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

pc_output_buffers_full_avg(fractional_resampler_ff_sptr self) -> pmt_vector_float

fractional_resampler_ff_sptr.pc_work_time_avg(fractional_resampler_ff_sptr self) → float
fractional_resampler_ff_sptr.pc_work_time_total(fractional_resampler_ff_sptr self) → float
fractional_resampler_ff_sptr.resamp_ratio(fractional_resampler_ff_sptr self) → float
fractional_resampler_ff_sptr.sample_delay(fractional_resampler_ff_sptr self, int which) → unsigned int
fractional_resampler_ff_sptr.set_min_noutput_items(fractional_resampler_ff_sptr self, int m)
fractional_resampler_ff_sptr.set_mu(fractional_resampler_ff_sptr self, float mu)
fractional_resampler_ff_sptr.set_resamp_ratio(fractional_resampler_ff_sptr self, float resamp_ratio)
fractional_resampler_ff_sptr.set_thread_priority(fractional_resampler_ff_sptr self, int priority) → int
fractional_resampler_ff_sptr.thread_priority(fractional_resampler_ff_sptr self) → int
gnuradio.filter.pfb_arb_resampler_ccf(float rate, pmt_vector_float taps, unsigned int filter_size=32) → pfb_arb_resampler_ccf_sptr

Polyphase filterbank arbitrary resampler with gr_complex input, gr_complex output and float taps.

This block takes in a signal stream and calls gr::filter::kernel::pfb_arb_resampler_ccf to perform arbitrary resampling on the stream.

Output sampling rate is * input rate.

Constructor Specific Documentation:

Build the polyphase filterbank arbitray resampler.

Parameters:
  • rate – (float) Specifies the resampling rate to use
  • taps – (vector/list of floats) The prototype filter to populate the filterbank. The taps should be generated at the filter_size sampling rate.
  • filter_size – (unsigned int) The number of filters in the filter bank. This is directly related to quantization noise introduced during the resampling. Defaults to 32 filters.
pfb_arb_resampler_ccf_sptr.active_thread_priority(pfb_arb_resampler_ccf_sptr self) → int
pfb_arb_resampler_ccf_sptr.decimation_rate(pfb_arb_resampler_ccf_sptr self) → unsigned int

Gets the decimation rate of the filter.

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

declare_sample_delay(pfb_arb_resampler_ccf_sptr self, unsigned int delay)

pfb_arb_resampler_ccf_sptr.fractional_rate(pfb_arb_resampler_ccf_sptr self) → float

Gets the fractional rate of the filter.

pfb_arb_resampler_ccf_sptr.group_delay(pfb_arb_resampler_ccf_sptr self) → int

Get the group delay of the filter.

pfb_arb_resampler_ccf_sptr.interpolation_rate(pfb_arb_resampler_ccf_sptr self) → unsigned int

Gets the interpolation rate of the filter.

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

pc_input_buffers_full_avg(pfb_arb_resampler_ccf_sptr self) -> pmt_vector_float

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

pc_output_buffers_full_avg(pfb_arb_resampler_ccf_sptr self) -> pmt_vector_float

pfb_arb_resampler_ccf_sptr.pc_work_time_avg(pfb_arb_resampler_ccf_sptr self) → float
pfb_arb_resampler_ccf_sptr.pc_work_time_total(pfb_arb_resampler_ccf_sptr self) → float
pfb_arb_resampler_ccf_sptr.phase(pfb_arb_resampler_ccf_sptr self) → float

Gets the current phase of the resampler in radians (2 to 2pi).

pfb_arb_resampler_ccf_sptr.phase_offset(pfb_arb_resampler_ccf_sptr self, float freq, float fs) → float

Calculates the phase offset expected by a sine wave of frequency and sampling rate (assuming input sine wave has 0 degree phase).

pfb_arb_resampler_ccf_sptr.print_taps(pfb_arb_resampler_ccf_sptr self)

Print all of the filterbank taps to screen.

pfb_arb_resampler_ccf_sptr.sample_delay(pfb_arb_resampler_ccf_sptr self, int which) → unsigned int
pfb_arb_resampler_ccf_sptr.set_min_noutput_items(pfb_arb_resampler_ccf_sptr self, int m)
pfb_arb_resampler_ccf_sptr.set_phase(pfb_arb_resampler_ccf_sptr self, float ph)

Sets the current phase offset in radians (0 to 2pi).

pfb_arb_resampler_ccf_sptr.set_rate(pfb_arb_resampler_ccf_sptr self, float rate)

Sets the resampling rate of the block.

pfb_arb_resampler_ccf_sptr.set_taps(pfb_arb_resampler_ccf_sptr self, pmt_vector_float taps)

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

pfb_arb_resampler_ccf_sptr.set_thread_priority(pfb_arb_resampler_ccf_sptr self, int priority) → int
pfb_arb_resampler_ccf_sptr.taps(pfb_arb_resampler_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_arb_resampler_ccf_sptr.taps_per_filter(pfb_arb_resampler_ccf_sptr self) → unsigned int

Gets the number of taps per filter.

pfb_arb_resampler_ccf_sptr.thread_priority(pfb_arb_resampler_ccf_sptr self) → int
gnuradio.filter.pfb_arb_resampler_fff(float rate, pmt_vector_float taps, unsigned int filter_size=32) → pfb_arb_resampler_fff_sptr

Polyphase filterbank arbitrary resampler with float input, float output and float taps.

This block takes in a signal stream and performs arbitrary resampling. The resampling rate can be any real number . The resampling is done by constructing filters where is the interpolation rate. We then calculate where .

Using and , we can perform rational resampling where is a rational number close to the input rate where we have filters and we cycle through them as a polyphase filterbank with a stride of so that .

To get the arbitrary rate, we want to interpolate between two points. For each value out, we take an output from the current filter, , and the next filter and then linearly interpolate between the two based on the real resampling rate we want.

The linear interpolation only provides us with an approximation to the real sampling rate specified. The error is a quantization error between the two filters we used as our interpolation points. To this end, the number of filters, , used determines the quantization error; the larger , the smaller the noise. You can design for a specified noise floor by setting the filter size (parameters ). The size defaults to 32 filters, which is about as good as most implementations need.

The trick with designing this filter is in how to specify the taps of the prototype filter. Like the PFB interpolator, the taps are specified using the interpolated filter rate. In this case, that rate is the input sample rate multiplied by the number of filters in the filterbank, which is also the interpolation rate. All other values should be relative to this rate.

For example, for a 32-filter arbitrary resampler and using the GNU Radio’s firdes utility to build the filter, 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 the interpolation rate ().

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

Constructor Specific Documentation:

Build the polyphase filterbank arbitray resampler.

Parameters:
  • rate – (float) Specifies the resampling rate to use
  • taps – (vector/list of floats) The prototype filter to populate the filterbank. The taps should be generated at the filter_size sampling rate.
  • filter_size – (unsigned int) The number of filters in the filter bank. This is directly related to quantization noise introduced during the resampling. Defaults to 32 filters.
pfb_arb_resampler_fff_sptr.active_thread_priority(pfb_arb_resampler_fff_sptr self) → int
pfb_arb_resampler_fff_sptr.decimation_rate(pfb_arb_resampler_fff_sptr self) → unsigned int

Gets the decimation rate of the filter.

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

declare_sample_delay(pfb_arb_resampler_fff_sptr self, unsigned int delay)

pfb_arb_resampler_fff_sptr.fractional_rate(pfb_arb_resampler_fff_sptr self) → float

Gets the fractional rate of the filter.

pfb_arb_resampler_fff_sptr.group_delay(pfb_arb_resampler_fff_sptr self) → int

Get the group delay of the filter.

pfb_arb_resampler_fff_sptr.interpolation_rate(pfb_arb_resampler_fff_sptr self) → unsigned int

Gets the interpolation rate of the filter.

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

pc_input_buffers_full_avg(pfb_arb_resampler_fff_sptr self) -> pmt_vector_float

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

pc_output_buffers_full_avg(pfb_arb_resampler_fff_sptr self) -> pmt_vector_float

pfb_arb_resampler_fff_sptr.pc_work_time_avg(pfb_arb_resampler_fff_sptr self) → float
pfb_arb_resampler_fff_sptr.pc_work_time_total(pfb_arb_resampler_fff_sptr self) → float
pfb_arb_resampler_fff_sptr.phase(pfb_arb_resampler_fff_sptr self) → float

Gets the current phase of the resampler in radians (2 to 2pi).

pfb_arb_resampler_fff_sptr.phase_offset(pfb_arb_resampler_fff_sptr self, float freq, float fs) → float

Calculates the phase offset expected by a sine wave of frequency and sampling rate (assuming input sine wave has 0 degree phase).

pfb_arb_resampler_fff_sptr.print_taps(pfb_arb_resampler_fff_sptr self)

Print all of the filterbank taps to screen.

pfb_arb_resampler_fff_sptr.sample_delay(pfb_arb_resampler_fff_sptr self, int which) → unsigned int
pfb_arb_resampler_fff_sptr.set_min_noutput_items(pfb_arb_resampler_fff_sptr self, int m)
pfb_arb_resampler_fff_sptr.set_phase(pfb_arb_resampler_fff_sptr self, float ph)

Sets the current phase offset in radians (0 to 2pi).

pfb_arb_resampler_fff_sptr.set_rate(pfb_arb_resampler_fff_sptr self, float rate)

Sets the resampling rate of the block.

pfb_arb_resampler_fff_sptr.set_taps(pfb_arb_resampler_fff_sptr self, pmt_vector_float taps)

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

pfb_arb_resampler_fff_sptr.set_thread_priority(pfb_arb_resampler_fff_sptr self, int priority) → int
pfb_arb_resampler_fff_sptr.taps(pfb_arb_resampler_fff_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_arb_resampler_fff_sptr.taps_per_filter(pfb_arb_resampler_fff_sptr self) → unsigned int

Gets the number of taps per filter.

pfb_arb_resampler_fff_sptr.thread_priority(pfb_arb_resampler_fff_sptr self) → int

Previous topic

gnuradio.filter: Channelizers

Next topic

gnuradio.filter: Filters

This Page