gr::filter::kernel::iir_filter
gnuradio/filter/iir_filter.h
class i_type
class o_type
class tap_type
class acc_type
bool bool gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_oldstyle d_oldstyle gr::filter::kernel::iir_filter::d_oldstyle gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::iir_filter gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::set_taps
std::vector< tap_type > std::vector<tap_type> gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_fftaps d_fftaps gr::filter::kernel::iir_filter::d_fftaps gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::filter gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::ntaps_ff gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::set_taps
std::vector< tap_type > std::vector<tap_type> gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_fbtaps d_fbtaps gr::filter::kernel::iir_filter::d_fbtaps gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::filter gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::ntaps_fb gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::set_taps
int int gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_latest_n d_latest_n gr::filter::kernel::iir_filter::d_latest_n gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::filter gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::iir_filter gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::set_taps
int int gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_latest_m d_latest_m gr::filter::kernel::iir_filter::d_latest_m gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::filter gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::iir_filter gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::set_taps
std::vector< acc_type > std::vector<acc_type> gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_prev_output d_prev_output gr::filter::kernel::iir_filter::d_prev_output gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::filter gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::set_taps
std::vector< i_type > std::vector<i_type> gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_prev_input d_prev_input gr::filter::kernel::iir_filter::d_prev_input gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::filter gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::set_taps
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::iir_filter
(const std::vector< tap_type > &fftaps, const std::vector< tap_type > &fbtaps, bool oldstyle=true)
iir_filter
gr::filter::kernel::iir_filter::iir_filter
const std::vector< tap_type > & fftaps
const std::vector< tap_type > & fbtaps
bool oldstyle true

Construct an IIR with the given taps.

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

`oldstyle:` 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.

When `oldstyle` is set 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}^{N} b_k z^{-k}}{1 + \sum_{k=1}^{M} a_k z^{-k}} \] where: $x$ - input signal, $y$ - output signal, $a_k$ - k-th feedback tap, $b_k$ - k-th feed-forward tap, $M$ - `len(fbtaps)-1`, $N$ - `len(fftaps)-1`.

$a_0$, that is `fbtaps`[0], is ignored.

gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_oldstyle
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::set_taps
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::iir_filter
()
iir_filter
gr::filter::kernel::iir_filter::iir_filter
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_latest_m
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_latest_n
o_type o_type gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::filter (const i_type input) filter gr::filter::kernel::iir_filter::filter const i_type input

compute a single output value.

the filtered input value.

gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_fbtaps
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_fftaps
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_latest_m
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_latest_n
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_prev_input
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_prev_output
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::ntaps_fb
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::ntaps_ff
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::filter_n
void void gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::filter_n (o_type output[], const i_type input[], long n) filter_n gr::filter::kernel::iir_filter::filter_n o_type output [] const i_type input [] long n

compute an array of N output values. `input` must have N valid entries.

gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::filter
unsigned unsigned gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::ntaps_ff () const ntaps_ff gr::filter::kernel::iir_filter::ntaps_ff

number of taps in filter.

gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_fftaps
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::filter
unsigned unsigned gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::ntaps_fb () const ntaps_fb gr::filter::kernel::iir_filter::ntaps_fb gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_fbtaps gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::filter
void void gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::set_taps (const std::vector< tap_type > &fftaps, const std::vector< tap_type > &fbtaps) set_taps gr::filter::kernel::iir_filter::set_taps const std::vector< tap_type > & fftaps const std::vector< tap_type > & fbtaps

install new taps.

gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_fbtaps
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_fftaps
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_latest_m
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_latest_n
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_oldstyle
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_prev_input
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::d_prev_output
gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >::iir_filter
gr_complex gr_complex gr::filter::kernel::iir_filter< gr_complex, gr_complex, float, gr_complex >::filter (const gr_complex input) filter gr::filter::kernel::iir_filter::filter const gr_complex input
gr_complex gr_complex gr::filter::kernel::iir_filter< gr_complex, gr_complex, double, gr_complexd >::filter (const gr_complex input) filter gr::filter::kernel::iir_filter::filter const gr_complex input
gr_complex gr_complex gr::filter::kernel::iir_filter< gr_complex, gr_complex, gr_complexd, gr_complexd >::filter (const gr_complex input) filter gr::filter::kernel::iir_filter::filter const gr_complex input

Base class template for Infinite Impulse Response filter (IIR).

This class provides a templated kernel for IIR filters. These iir_filters can be instantiated with a set of feed-forward and feed-back taps in the constructor. We then call the iir_filter::filter function to add a new sample to the filter, or iir_filter::filter_n to add a vector of samples to be filtered.

Instantiating a filter means defining the templates for the data types being processed by the filter. There are four templates:

- i_type the data type of the input data (i.e., float).

- o_type the data type of the output data (i.e., float).

- tap_type the data type of the filter taps (i.e., double).

- acc_type the data type of the internal accumulator (i.e., double).

The acc_type is specified to control how data is handled internally in the filter. This should always be the highest precision data type of any of the first three. Often, IIR filters require double-precision values in the taps for stability, and so the internal accumulator should also be double precision.

Example:

    gr::filter::kernel::iir_filter<float,float,double,double>iir_filt(fftaps,fbtaps);
    ...
    floaty=iir_filt.filter(x);

    <or>

    iir_filt.filter(y,x,N);//yandxarefloatarrays

Another example for handling complex samples with double-precision taps (see filter::iir_filter_ccz):

    gr:;filter::kernel::iir_filter<gr_complex,gr_complex,gr_complexd,gr_complexd>
    iir_filt(fftaps,fbtaps);

gr::filter::kernel::iir_filter< i_type, o_type, tap_type, acc_type >
d_fbtaps
d_fftaps
d_prev_output
d_prev_input
std::vector< acc_type >
std::vector< i_type >
std::vector< tap_type >
- gr::filter::kernel::iir_filter
  d_fbtaps
- gr::filter::kernel::iir_filter
  d_fftaps
- gr::filter::kernel::iir_filter
  d_latest_m
- gr::filter::kernel::iir_filter
  d_latest_n
- gr::filter::kernel::iir_filter
  d_oldstyle
- gr::filter::kernel::iir_filter
  d_prev_input
- gr::filter::kernel::iir_filter
  d_prev_output
- gr::filter::kernel::iir_filter
  filter
- gr::filter::kernel::iir_filter
  filter
- gr::filter::kernel::iir_filter
  filter
- gr::filter::kernel::iir_filter
  filter
- gr::filter::kernel::iir_filter
  filter_n
- gr::filter::kernel::iir_filter
  iir_filter
- gr::filter::kernel::iir_filter
  iir_filter
- gr::filter::kernel::iir_filter
  ntaps_fb
- gr::filter::kernel::iir_filter
  ntaps_ff
- gr::filter::kernel::iir_filter
  set_taps