iirfilt_crcf
Variants: iirfilt_cccf, iirfilt_crcf, iirfilt_rrrf
Infinite impulse response (IIR) filter
Public Functions
iirfilt_crcf | iirfilt_crcf_create( |
iirfilt_crcf | iirfilt_crcf_create_sos( |
iirfilt_crcf | iirfilt_crcf_create_prototype( |
iirfilt_crcf | iirfilt_crcf_create_lowpass( |
iirfilt_crcf | iirfilt_crcf_create_integrator( |
iirfilt_crcf | iirfilt_crcf_create_differentiator( |
iirfilt_crcf | iirfilt_crcf_create_dc_blocker( |
iirfilt_crcf | iirfilt_crcf_create_pll( |
iirfilt_crcf | iirfilt_crcf_copy( |
int | iirfilt_crcf_destroy( |
int | iirfilt_crcf_print( |
int | iirfilt_crcf_reset( |
int | iirfilt_crcf_set_scale( |
int | iirfilt_crcf_get_scale( |
int | iirfilt_crcf_execute( |
int | iirfilt_crcf_execute_block( |
unsigned int | iirfilt_crcf_get_length( |
int | iirfilt_crcf_freqresponse( |
float | iirfilt_crcf_get_psd( |
float | iirfilt_crcf_groupdelay( |
Interfaces
iirfilt_crcf iirfilt_crcf_create(
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_crcf iirfilt_crcf_create_sos(
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_crcf iirfilt_crcf_create_prototype(
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_crcf iirfilt_crcf_create_lowpass(
Create simplified low-pass Butterworth IIR filter
- _order : filter order, 0 < _order
- _fc : low-pass prototype cut-off frequency
iirfilt_crcf iirfilt_crcf_create_integrator(
Create 8th-order integrator filter
iirfilt_crcf iirfilt_crcf_create_differentiator(
Create 8th-order differentiator filter
iirfilt_crcf iirfilt_crcf_create_dc_blocker(
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_crcf iirfilt_crcf_create_pll(
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_crcf iirfilt_crcf_copy(
Copy object including all internal objects and state
int iirfilt_crcf_destroy(
Destroy iirfilt object, freeing all internal memory
int iirfilt_crcf_print(
Print iirfilt object properties to stdout
int iirfilt_crcf_reset(
Reset iirfilt object internals
int iirfilt_crcf_set_scale(
Set output scaling for filter
- _q : filter object
- _scale : scaling factor to apply to each output sample
int iirfilt_crcf_get_scale(
Get output scaling for filter
- _q : filter object
- _scale : scaling factor applied to each output sample
int iirfilt_crcf_execute(
Compute filter output given a single input sample
- _q : iirfilt object
- _x : input sample
- _y : output sample pointer
int iirfilt_crcf_execute_block(
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_crcf_get_length(
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_crcf_freqresponse(
Compute complex frequency response of filter object
- _q : filter object
- _fc : normalized frequency for evaluation
- _H : pointer to output complex frequency response
float iirfilt_crcf_get_psd(
Compute power spectral density response of filter object in dB
- _q : filter object
- _fc : normalized frequency for evaluation
float iirfilt_crcf_groupdelay(
Compute and return group delay of filter object
- _q : filter object
- _fc : frequency to evaluate