gnuradio.filter: Filters

gnuradio.filter.adaptive_fir_ccc(char name, int decimation, std::vector<(gr_complex, std::allocator<(gr_complex)>)> taps) → sptr

Adaptive FIR filter with gr_complex input, gr_complex output and gr_complex taps.

This is a base class to implement an adaptive FIR filter. Generally, another block will inherit from this one to build a new type of adaptive filter such as an equalizer.

This class implements two functions that are designed to be overloaded by the child class: error(gr_complex out) and update_tap(gr_complex tap, gr_complex in).

The error() function calculates the error value that will be used to adjust the taps. The update_tap function then uses the error and the input signal value to update a particular tap. Typically, the error is calculated for a given output and then this is used in a loop to update all of the filter taps in a loop:

See digital::cma_equalizer_cc and digital::lms_dd_equalizer_cc for example usage.

Constructor Specific Documentation:

Adaptive FIR filter with gr_complex input, gr_complex output and gr_complex taps.

Parameters:
  • name – Provides a name to identify this type of algorithm
  • decimation – (interger) decimation rate of the filter
  • taps – (complex) filter taps
adaptive_fir_ccc_sptr.active_thread_priority(self) → int
adaptive_fir_ccc_sptr.set_taps(self, std::vector<(gr_complex, std::allocator<(gr_complex)>)> taps)
adaptive_fir_ccc_sptr.set_thread_priority(self, int priority) → int
adaptive_fir_ccc_sptr.taps(self) → std::vector<(gr_complex,std::allocator<(gr_complex)>)>
adaptive_fir_ccc_sptr.thread_priority(self) → int
gnuradio.filter.adaptive_fir_ccf(char name, int decimation, pmt_vector_float taps) → sptr

Adaptive FIR filter with gr_complex input, gr_complex output and float taps.

This is a base class to implement an adaptive FIR filter. Generally, another block will inherit from this one to build a new type of adaptive filter such as an equalizer.

This class implements two functions that are designed to be overloaded by the child class: error(gr_complex out) and update_tap(float tap, gr_complex in).

The error() function calculates the error value that will be used to adjust the taps. The update_tap function then uses the error and the input signal value to update a particular tap. Typically, the error is calculated for a given output and then this is used in a loop to update all of the filter taps in a loop:

Constructor Specific Documentation:

Adaptive FIR filter with gr_complex input, gr_complex output and float taps.

Parameters:
  • name – Provides a name to identify this type of algorithm
  • decimation – (interger) decimation rate of the filter
  • taps – (real) filter taps
adaptive_fir_ccf_sptr.active_thread_priority(self) → int
adaptive_fir_ccf_sptr.set_taps(self, pmt_vector_float taps)
adaptive_fir_ccf_sptr.set_thread_priority(self, int priority) → int
adaptive_fir_ccf_sptr.taps(self) → pmt_vector_float
adaptive_fir_ccf_sptr.thread_priority(self) → int
gnuradio.filter.dc_blocker_cc(int D, bool long_form) → sptr

a computationally efficient controllable DC blocker

This block implements a computationally efficient DC blocker that produces a tighter notch filter around DC for a smaller group delay than an equivalent FIR filter or using a single pole IIR filter (though the IIR filter is computationally cheaper).

The block defaults to using a delay line of length 32 and the long form of the filter. Optionally, the delay line length can be changed to alter the width of the DC notch (longer lines will decrease the width).

The long form of the filter produces a nearly flat response outside of the notch but at the cost of a group delay of 2D-2.

The short form of the filter does not have as flat a response in the passband but has a group delay of only D-1 and is cheaper to compute.

The theory behind this block can be found in the paper:

Constructor Specific Documentation:

Make a DC blocker block.

Parameters:
  • D – (int) the length of the delay line
  • long_form – (bool) whether to use long (true, default) or short form
dc_blocker_cc_sptr.active_thread_priority(self) → int
dc_blocker_cc_sptr.group_delay(self) → int
dc_blocker_cc_sptr.set_thread_priority(self, int priority) → int
dc_blocker_cc_sptr.thread_priority(self) → int
gnuradio.filter.dc_blocker_ff(int D, bool long_form = True) → sptr

a computationally efficient controllable DC blocker

This block implements a computationally efficient DC blocker that produces a tighter notch filter around DC for a smaller group delay than an equivalent FIR filter or using a single pole IIR filter (though the IIR filter is computationally cheaper).

The block defaults to using a delay line of length 32 and the long form of the filter. Optionally, the delay line length can be changed to alter the width of the DC notch (longer lines will decrease the width).

The long form of the filter produces a nearly flat response outside of the notch but at the cost of a group delay of 2D-2.

The short form of the filter does not have as flat a response in the passband but has a group delay of only D-1 and is cheaper to compute.

The theory behind this block can be found in the paper:

Constructor Specific Documentation:

Make a DC blocker block.

Parameters:
  • D – (int) the length of the delay line
  • long_form – (bool) whether to use long (true, default) or short form
dc_blocker_ff_sptr.active_thread_priority(self) → int
dc_blocker_ff_sptr.group_delay(self) → int
dc_blocker_ff_sptr.set_thread_priority(self, int priority) → int
dc_blocker_ff_sptr.thread_priority(self) → int
gnuradio.filter.fft_filter_fff(int decimation, pmt_vector_float taps, int nthreads = 1) → sptr

Fast FFT filter with float input, float output and float taps.

This block implements a real-value decimating filter using the fast convolution method via an FFT. The decimation factor is an interger that is greater than or equal to 1.

The filter takes a set of real-valued taps to use in the filtering operation. These taps can be defined as anything that satisfies the user’s filtering needs. For standard filters such as lowpass, highpass, bandpass, etc., the filter.firdes and filter.optfir classes provide convenient generating methods.

This filter is implemented by using the FFTW package to perform the required FFTs. An optional argument, nthreads, may be passed to the constructor (or set using the set_nthreads member function) to split the FFT among N number of threads. This can improve performance on very large FFTs (that is, if the number of taps used is very large) if you have enough threads/cores to support it.

Constructor Specific Documentation:

Build an FFT filter block.

Parameters:
  • decimation – >= 1
  • taps – float filter taps
  • nthreads – number of threads for the FFT to use
fft_filter_fff_sptr.active_thread_priority(self) → int
fft_filter_fff_sptr.set_taps(self, pmt_vector_float taps)
fft_filter_fff_sptr.set_thread_priority(self, int priority) → int
fft_filter_fff_sptr.taps(self) → pmt_vector_float
fft_filter_fff_sptr.thread_priority(self) → int
gnuradio.filter.fft_filter_ccc(int decimation, std::vector<(gr_complex, std::allocator<(gr_complex)>)> taps, int nthreads = 1) → sptr

Fast FFT filter with gr_complex input, gr_complex output and gr_complex taps.

This block implements a complex decimating filter using the fast convolution method via an FFT. The decimation factor is an interger that is greater than or equal to 1.

The filter takes a set of complex (or real) taps to use in the filtering operation. These taps can be defined as anything that satisfies the user’s filtering needs. For standard filters such as lowpass, highpass, bandpass, etc., the filter.firdes and filter.optfir classes provide convenient generating methods.

This filter is implemented by using the FFTW package to perform the required FFTs. An optional argument, nthreads, may be passed to the constructor (or set using the set_nthreads member function) to split the FFT among N number of threads. This can improve performance on very large FFTs (that is, if the number of taps used is very large) if you have enough threads/cores to support it.

Constructor Specific Documentation:

Build an FFT filter blocks.

Parameters:
  • decimation – >= 1
  • taps – complex filter taps
  • nthreads – number of threads for the FFT to use
fft_filter_ccc_sptr.active_thread_priority(self) → int
fft_filter_ccc_sptr.set_taps(self, std::vector<(gr_complex, std::allocator<(gr_complex)>)> taps)
fft_filter_ccc_sptr.set_thread_priority(self, int priority) → int
fft_filter_ccc_sptr.taps(self) → std::vector<(gr_complex,std::allocator<(gr_complex)>)>
fft_filter_ccc_sptr.thread_priority(self) → int
gnuradio.filter.filter_delay_fc(pmt_vector_float taps) → sptr

Filter-Delay Combination Block.

The block takes one or two float stream and outputs a complex stream.

If only one float stream is input, the real output is a delayed version of this input and the imaginary output is the filtered output.

If two floats are connected to the input, then the real output is the delayed version of the first input, and the imaginary output is the filtered output.

The delay in the real path accounts for the group delay introduced by the filter in the imaginary path. The filter taps needs to be calculated before initializing this block.

Constructor Specific Documentation:

Build a filter with delay block.

Parameters:taps
filter_delay_fc_sptr.active_thread_priority(self) → int
filter_delay_fc_sptr.set_thread_priority(self, int priority) → int
filter_delay_fc_sptr.thread_priority(self) → int
gnuradio.filter.hilbert_fc(unsigned int ntaps) → sptr

Hilbert transformer.

real output is input appropriately delayed. imaginary output is hilbert filtered (90 degree phase shift) version of input.

Constructor Specific Documentation:

Build a Hilbert transformer filter block.

Parameters:ntaps
hilbert_fc_sptr.active_thread_priority(self) → int
hilbert_fc_sptr.set_thread_priority(self, int priority) → int
hilbert_fc_sptr.thread_priority(self) → int
gnuradio.filter.iir_filter_ffd(pmt_vector_double fftaps, pmt_vector_double fbtaps, bool oldstyle = True) → sptr

IIR filter with float input, float output and double taps.

This filter uses the Direct Form I implementation, where contains the feed-forward taps, and the feedback ones.

The old style of the IIR filter uses feedback taps that are negative of what most definitions use (scipy and Matlab among them). This parameter keeps using the old GNU Radio style and is set to TRUE by default. When taps generated from scipy, Matlab, or gr_filter_design, use the new style by setting this to FALSE.

The input and output satisfy a difference equation of the form

y[n] - sum_{k=1}^{M} a_k y[n-k] = sum_{k=0}^{N} b_k x[n-k]

with the corresponding rational system function

H(z) = frac{sum_{k=0}^{M} b_k z^{-k}}{1 - sum_{k=1}^{N} a_k z^{-k}}

Constructor Specific Documentation:

Parameters:
  • fftaps
  • fbtaps
  • oldstyle
iir_filter_ffd_sptr.active_thread_priority(self) → int
iir_filter_ffd_sptr.set_taps(self, pmt_vector_double fftaps, pmt_vector_double fbtaps)
iir_filter_ffd_sptr.set_thread_priority(self, int priority) → int
iir_filter_ffd_sptr.thread_priority(self) → int
class gnuradio.filter.analysis_filterbank(mpoints, taps=None)

Uniformly modulated polyphase DFT filter bank: analysis

See http://cnx.org/content/m10424/latest

class gnuradio.filter.synthesis_filterbank(mpoints, taps=None)

Uniformly modulated polyphase DFT filter bank: synthesis

See http://cnx.org/content/m10424/latest

gnuradio.filter.single_pole_iir_filter_cc(double alpha, unsigned int vlen = 1) → sptr

single pole IIR filter with complex input, complex output

The input and output satisfy a difference equation of the form

y[n] - (1-alpha) y[n-1] = alpha x[n]

with the corresponding rational system function

H(z) = frac{alpha}{1 - (1-alpha) z^{-1}}

Note that some texts define the system function with a + in the denominator. If you’re using that convention, you’ll need to negate the feedback tap.

Constructor Specific Documentation:

Parameters:
  • alpha
  • vlen
single_pole_iir_filter_cc_sptr.active_thread_priority(self) → int
single_pole_iir_filter_cc_sptr.set_taps(self, double alpha)
single_pole_iir_filter_cc_sptr.set_thread_priority(self, int priority) → int
single_pole_iir_filter_cc_sptr.thread_priority(self) → int
gnuradio.filter.single_pole_iir_filter_ff(double alpha, unsigned int vlen = 1) → sptr

single pole IIR filter with float input, float output

The input and output satisfy a difference equation of the form

y[n] - (1-alpha) y[n-1] = alpha x[n]

with the corresponding rational system function

H(z) = frac{alpha}{1 - (1-alpha) z^{-1}}

Note that some texts define the system function with a + in the denominator. If you’re using that convention, you’ll need to negate the feedback tap.

Constructor Specific Documentation:

Parameters:
  • alpha
  • vlen
single_pole_iir_filter_ff_sptr.active_thread_priority(self) → int
single_pole_iir_filter_ff_sptr.set_taps(self, double alpha)
single_pole_iir_filter_ff_sptr.set_thread_priority(self, int priority) → int
single_pole_iir_filter_ff_sptr.thread_priority(self) → int

Previous topic

gnuradio.filter: Resamplers

Next topic

gnuradio.filter: Digital Filter Design

This Page