Logo
MSP DSP Library
Real IIR

Data Structures

struct  msp_biquad_df1_q15_params
 Parameter structure for Direct Form 1 biquad filter. More...
 
struct  msp_biquad_df2_q15_params
 Parameter structure for Direct Form 2 biquad filter. More...
 

Functions

msp_status msp_biquad_df1_q15 (const msp_biquad_df1_q15_params *params, const _q15 *src, _q15 *dst)
 Single order direct form 1 biquad filter. More...
 
msp_status msp_biquad_df2_q15 (msp_biquad_df2_q15_params *params, const _q15 *src, _q15 *dst)
 Single order direct form 2 biquad filter. More...
 

Detailed Description

Functions for performing real Infinite Impulse Response (IIR) filters.

Function Documentation

msp_status msp_biquad_df1_q15 ( const msp_biquad_df1_q15_params params,
const _q15 src,
_q15 dst 
)

Single order direct form 1 biquad filter.

Details
Single order biquad filter with direct form 1 implementation. Q15 multiplication is performed with a 32-bit accumulator to avoid intermediate overflow with saturation to Q15 when storing the result.
biquad_df1.png
Biquad DF1 structure
Transfer Function
$H(z)=\frac{b_0+b_1z^{-1}+b_2z^{-2}}{a_0+a_1z^{-1}+a_2z^{-2}}$
Pseudo code
y[n] = b0 * x[n] + b1 * x[n-1] + b2 * x[n-2] - a1 * y[n-1] - a2 * y[n-2]
Parameters
paramsPointer to the biquad direct form 1 parameter structure.
srcPointer to the source data to filter.
dstPointer to the destination vector.
Returns
Status of the operation.
msp_status msp_biquad_df2_q15 ( msp_biquad_df2_q15_params params,
const _q15 src,
_q15 dst 
)

Single order direct form 2 biquad filter.

Details
Single order direct form 2 biquad filter with bias and minimum and maximum result calculation. Q15 multiplication is performed with a 32-bit accumulator to avoid intermediate overflow with saturation to Q15 when storing the result. The maximum and minimum of the destination vector are returned for post processing.
biquad_df2.png
Biquad DF2 structure
Transfer Function
$H(z)=\frac{b_0+b_1z^{-1}+b_2z^{-2}}{a_0+a_1z^{-1}+a_2z^{-1}+a_3z^{-2}}$
Pseudo code
y[n] = b0 * w[n] + b1 * w[n-1] + b2 * w[n-2]
w[n] = x[n] - a1 * x[n-1] - a2 * x[n-1] - a3 * x[n-2]
Parameters
paramsPointer to the biquad direct form 2 parameter structure.
srcPointer to the source data to filter.
dstPointer to the destination vector.
Returns
Status of the operation.