IIRBiQuadDf2T

Applies a BiQuad cascade infinite impulse response (IIR) filter of the direct form II transposed structure.

Syntax

Intel IPP style:

IppStatus ippsqIIRBiQuadDf2TDirect_32f (const Ipp32f* pSrc, Ipp32f* pDst, Ipp32u len, const Ipp32f* pTaps, Ipp32u numBq, Ipp32f* pDlyLine);

IppStatus ippsqIIRBiQuadDf2TDirect_64f (const Ipp64f* pSrc, Ipp64f* pDst, Ipp32u len, const Ipp64f* pTaps, Ipp32u numBq, Ipp64f* pDlyLine);

IppStatus ippsqIIRBiQuadDf2TDirect_32fc (const Ipp32fc* pSrc, Ipp32fc* pDst, Ipp32u len, const Ipp32f* pTaps, Ipp32u numBq, Ipp32fc* pDlyLine);

DSP style:

typedef struct {
    Ipp8u   numStages;
    Ipp64f *pState;
    Ipp64f *pCoeffs;
} ippsq_biquad_cascade_df2T_instance_f64;

void ippsq_biquad_cascade_df2T_init_f64 (ippsq_biquad_cascade_df2T_instance_f64 *S, uint8_t numStages, float64_t *pCoeffs, float64_t *pState);

void ippsq_biquad_cascade_df2T_f64 (const ippsq_biquad_cascade_df2T_instance_f64 *S, float64_t *pSrc, float64_t *pDst, uint32_t len);

typedef struct {
    Ipp8u   numStages;
    Ipp32f *pState;
    Ipp32f *pCoeffs;
} ippsq_biquad_cascade_df2T_instance_f32;

void ippsq_biquad_cascade_df2T_init_f32 (ippsq_biquad_cascade_df2T_instance_f32 *S, uint8_t numStages, float32_t *pCoeffs, float32_t *pState);

void ippsq_biquad_cascade_df2T_f32 (const ippsq_biquad_cascade_df2T_instance_f32 *S, float32_t *pSrc, float32_t *pDst, uint32_t len);

typedef ippsq_biquad_cascade_df2T_instance_f32 ippsq_biquad_cascade_stereo_df2T_instance_f32;

void ippsq_biquad_cascade_stereo_df2T_init_f32 (ippsq_biquad_cascade_stereo_df2T_instance_f32 *S, uint8_t numStages, float32_t *pCoeffs, float32_t *pState);

void ippsq_biquad_cascade_stereo_df2T_f32 (const ippsq_biquad_cascade_stereo_df2T_instance_f32 *S, float32_t *pSrc, float32_t *pDst, uint32_t len);

Include Files

ippsq.h

dsp.h

Parameters

pSrc

Pointer to the source vector.

pDst

Pointer to the destination vector.

len, blockSize

Number of elements in the source/destination vectors.

pTaps, pCoeffs

Pointer to the filter coefficients.

numBq, numStages

Number of biquad stages in a filter.

pDlyLine, pState

Pointer to the filter delay line.

Description

These functions apply a BiQuad cascade infinite impulse response (IIR) filter of the direct form II transposed structure to the source vector. The following figure demonstrates the direct form II transposed structure of a biquad second-order IIR filter:

where

  • x[n] is a sample of the input signal

  • y[n] is a sample of the output signal

  • b0, b1, b2, a1, a2 are filter coefficients

The output signal is computed by the following formulas:

y[n]=b0*x[n]+d1

d1=b1*x[n]+a1*y[n]+d2

d2=b2*x[n]+a2*y[n]

The figure below shows the structure of the biquad filter with k cascades of second-order filters:

The pDlyLine (pState for DSP) array specifies the state variables. The number of elements in the array is 2*numBq (2*numStages for DSP). The state variables are arranged in the array as follows:

d0,1; d0,2; d1,1; d1,2; ...dnumBq-1,1; dnumBq-1,2

A biquad IIR filter is defined by a cascade of biquads. The number of cascades of biquads is specified by the numBq (numStages for DSP) value. The 5*numBq-length array pTaps (pCoeffs for DSP) specifies the taps arranged in the array as follows:

b0,0; b0,1; b0,2; b1,0; b1,1; b1,2;a1,1; a1,2; ...bnumBq-1,0; bnumBq-1,1; bnumBq-1,2; anymBq-1,1; anymBq-1,2

Intel IPP style: Functions perform filtering without initialization of the filter state structure. All required parameters are directly set in functions.

DSP style: Each function type (f64, f32, and f32 stereo) has its own state structure, which must be initialized with the corresponding initialization function. The initialization function copies arguments into the state structure and sets the pState array to zero.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when any of the specified pointers is NULL.
For more complete information about compiler optimizations, see our Optimization Notice.