iirfilt_cccf

Variants: iirfilt_cccf, iirfilt_crcf, iirfilt_rrrf

Infinite impulse response (IIR) filter

Public Functions

iirfilt_cccf iirfilt_cccf_create(float complex * _b, unsigned int _nb, float complex * _a, unsigned int _na)
iirfilt_cccf iirfilt_cccf_create_sos(float complex * _b, float complex * _a, unsigned int _nsos)
iirfilt_cccf iirfilt_cccf_create_prototype(liquid_iirdes_filtertype _ftype, liquid_iirdes_bandtype _btype, liquid_iirdes_format _format, unsigned int _order, float _fc, float _f0, float _ap, float _as)
iirfilt_cccf iirfilt_cccf_create_lowpass(unsigned int _order, float _fc)
iirfilt_cccf iirfilt_cccf_create_integrator()
iirfilt_cccf iirfilt_cccf_create_differentiator()
iirfilt_cccf iirfilt_cccf_create_dc_blocker(float _alpha)
iirfilt_cccf iirfilt_cccf_create_pll(float _w, float _zeta, float _K)
iirfilt_cccf iirfilt_cccf_copy(iirfilt_cccf _q)
int iirfilt_cccf_destroy(iirfilt_cccf _q)
int iirfilt_cccf_print(iirfilt_cccf _q)
int iirfilt_cccf_reset(iirfilt_cccf _q)
int iirfilt_cccf_set_scale(iirfilt_cccf _q, float complex _scale)
int iirfilt_cccf_get_scale(iirfilt_cccf _q, float complex * _scale)
int iirfilt_cccf_execute(iirfilt_cccf _q, float complex _x, float complex * _y)
int iirfilt_cccf_execute_block(iirfilt_cccf _q, float complex * _x, unsigned int _n, float complex * _y)
unsigned int iirfilt_cccf_get_length(iirfilt_cccf _q)
int iirfilt_cccf_freqresponse(iirfilt_cccf _q, float _fc, float complex * _H)
float iirfilt_cccf_get_psd(iirfilt_cccf _q, float _fc)
float iirfilt_cccf_groupdelay(iirfilt_cccf _q, float _fc)

Interfaces

iirfilt_cccf iirfilt_cccf_create(float complex * _b, unsigned int _nb, float complex * _a, unsigned int _na)

Create infinite impulse response filter from external coefficients. Note that the number of feed-forward and feed-back coefficients do not need to be equal, but they do need to be non-zero. Furthermore, the first feed-back coefficient \(a_0\) cannot be equal to zero, otherwise the filter will be invalid as this value is factored out from all coefficients. For stability reasons the number of coefficients should reasonably not exceed about 8 for single-precision floating-point.

  • _b : feed-forward coefficients (numerator), shape: (_nb, 1)
  • _nb : number of feed-forward coefficients, 0 < _nb
  • _a : feed-back coefficients (denominator), shape: (_na, 1)
  • _na : number of feed-back coefficients, 0 < _na

iirfilt_cccf iirfilt_cccf_create_sos(float complex * _b, float complex * _a, unsigned int _nsos)

Create IIR filter using 2nd-order sections from external coefficients.

  • _b : feed-forward coefficients, shape: (_nsos, 3)
  • _a : feed-back coefficients, shape: (_nsos, 3)
  • _nsos : number of second-order sections (sos), 0 < _nsos

iirfilt_cccf iirfilt_cccf_create_prototype(liquid_iirdes_filtertype _ftype, liquid_iirdes_bandtype _btype, liquid_iirdes_format _format, unsigned int _order, float _fc, float _f0, float _ap, float _as)

Create IIR filter from design template

  • _ftype : filter type (e.g. LIQUID_IIRDES_BUTTER)
  • _btype : band type (e.g. LIQUID_IIRDES_BANDPASS)
  • _format : coefficients format (e.g. LIQUID_IIRDES_SOS)
  • _order : filter order, 0 < _order
  • _fc : low-pass prototype cut-off frequency, 0 <= _fc <= 0.5
  • _f0 : center frequency (band-pass, band-stop), 0 <= _f0 <= 0.5
  • _ap : pass-band ripple in dB, 0 < _ap
  • _as : stop-band ripple in dB, 0 < _as

iirfilt_cccf iirfilt_cccf_create_lowpass(unsigned int _order, float _fc)

Create simplified low-pass Butterworth IIR filter

  • _order : filter order, 0 < _order
  • _fc : low-pass prototype cut-off frequency

iirfilt_cccf iirfilt_cccf_create_integrator()

Create 8th-order integrator filter

iirfilt_cccf iirfilt_cccf_create_differentiator()

Create 8th-order differentiator filter

iirfilt_cccf iirfilt_cccf_create_dc_blocker(float _alpha)

Create simple first-order DC-blocking filter with transfer function \( H(z) = \frac{1 - z^{-1}}{1 - (1-\alpha)z^{-1}} \)

  • _alpha : normalized filter bandwidth, 0 < _alpha

iirfilt_cccf iirfilt_cccf_create_pll(float _w, float _zeta, float _K)

Create filter to operate as second-order integrating phase-locked loop (active lag design)

  • _w : filter bandwidth, 0 < _w < 1
  • _zeta : damping factor, \( 1/\sqrt{2} \) suggested, 0 < _zeta < 1
  • _K : loop gain, 0 < _K

iirfilt_cccf iirfilt_cccf_copy(iirfilt_cccf _q)

Copy object including all internal objects and state

int iirfilt_cccf_destroy(iirfilt_cccf _q)

Destroy iirfilt object, freeing all internal memory

int iirfilt_cccf_print(iirfilt_cccf _q)

Print iirfilt object properties to stdout

int iirfilt_cccf_reset(iirfilt_cccf _q)

Reset iirfilt object internals

int iirfilt_cccf_set_scale(iirfilt_cccf _q, float complex _scale)

Set output scaling for filter

  • _q : filter object
  • _scale : scaling factor to apply to each output sample

int iirfilt_cccf_get_scale(iirfilt_cccf _q, float complex * _scale)

Get output scaling for filter

  • _q : filter object
  • _scale : scaling factor applied to each output sample

int iirfilt_cccf_execute(iirfilt_cccf _q, float complex _x, float complex * _y)

Compute filter output given a single input sample

  • _q : iirfilt object
  • _x : input sample
  • _y : output sample pointer

int iirfilt_cccf_execute_block(iirfilt_cccf _q, float complex * _x, unsigned int _n, float complex * _y)

Execute the filter on a block of input samples; in-place operation is permitted (the input and output buffers may be the same)

  • _q : filter object
  • _x : pointer to input array, shape: (_n, 1)
  • _n : number of input, 0 < _n
  • _y : pointer to output array, shape: (_n, 1)

unsigned int iirfilt_cccf_get_length(iirfilt_cccf _q)

Return number of coefficients for iirfilt object (maximum between the feed-forward and feed-back coefficients). Note that the filter length = filter order + 1

int iirfilt_cccf_freqresponse(iirfilt_cccf _q, float _fc, float complex * _H)

Compute complex frequency response of filter object

  • _q : filter object
  • _fc : normalized frequency for evaluation
  • _H : pointer to output complex frequency response

float iirfilt_cccf_get_psd(iirfilt_cccf _q, float _fc)

Compute power spectral density response of filter object in dB

  • _q : filter object
  • _fc : normalized frequency for evaluation

float iirfilt_cccf_groupdelay(iirfilt_cccf _q, float _fc)

Compute and return group delay of filter object

  • _q : filter object
  • _fc : frequency to evaluate