Visible to Intel only — GUID: GUID-5F51DF63-FD34-44E2-BBC0-7DF4DEF8C6FF
Visible to Intel only — GUID: GUID-5F51DF63-FD34-44E2-BBC0-7DF4DEF8C6FF
IIR Filter Functions
The functions described in this section initialize an infinite impulse response (IIR) filter and perform filtering. Intel IPP supports two types of filters: arbitrary order filter and biquad filter.
The figure below shows the structure of an arbitrary order IIR filter.

Here x[n] is a sample of the input signal, y[n] is a sample of the output signal, order is the filter order, and b0, b1, . . ., b order, a1, . . ., a order are the reduced filter coefficients.
The output signal is computed by the following formula:

.
Reduced coefficients are calculated as ak = Ak/A0 and bk = Bk/A0
where A0, A 1,...Aorder, B0, B1,...Border are initial filter coefficients (taps).
A biquad IIR filter is a cascade of second-order filters. The figure below illustrates the structure of the biquad filter with k cascades of second-order filters.

By default, all Intel IPP IIR filter functions that do not have the _DF1_ suffix in a name, use the direct form 2 (DF2) delay line. The difference between the direct form 1 (DF1) and DF2 representations of the delay line is that DF1 contains delayed values of the source and destination vectors, while DF2 is two times shorter and contains pre-calculated values based on the following code [Opp75]:
for( i = 0; i < order; i++ ){ pDly[i] = 0; for( n = order - i; n > 0; n-- ){ pDly[i] += pTaps[n+i] * pSrc[len-n]; /* b- coefficients */ } } for( i = 0; i < order; i++ ){ for( n = order - i; n > 0; n-- ){ pDly[i] -= pTaps[order+n+i] * pDst[len-n]; /* a- coefficients */ } }
There is no way to transform DF2 back to DF1. Therefore, if you need DF1 output, copy the corresponding last order values of the source vector and last order values of the destination vector to DF1 buffer. Please note that the IIRSetDlyLine and IIRGetDlyLine functions get/return the delay line values also in DF2 form.
To initialize and use an IIR filter, follow this general scheme:
- Call ippsIIRInit to initialize the filter as an arbitrary order IIR filter in the external buffer, or ippsIIRInit_BiQuad to initialize the filter as a cascade of biquads in the external buffer. Size of the buffer can be computed by calling the functions ippsIIRGetStateSize or ippsIIRGetStateSize_BiQuad, respectively.
- Call ippsIIR to filter consecutive samples at once.
- Call ippsIIRGetDlyLine and ippsIIRSetDlyLine to get and set the delay line values in the IIR state structure.
- IIRInit
Initializes an arbitrary IIR filter state. - IIRInit_BiQuad
Initializes an IIR filter state. - IIRGetStateSize
Computes the length of the external buffer for the arbitrary IIR filter state structure. - IIRGetStateSize_BiQuad
Computes the length of the external buffer for the biquad IIR filter state structure. - IIRGetDlyLine
Retrieves the delay line contents from the IIR filter state. - IIRSetDlyLine
Sets the delay line contents in an IIR filter state. - IIR
Filters a source vector through an IIR filter. - IIRSparseInit
Initializes a sparse IIR filter structure. - IIRSparseGetStateSize
Computes the size of the external buffer for the sparse IIR filter structure. - IIRSparse
Filters a source vector through a sparse IIR filter. - IIRGenGetBufferSize
Computes the size of the buffer required for ippsIIRGenLowpass and ippsIIRGenHighpass internal calculations. - IIRGenLowpass, IIRGenHighpass
Computes lowpass and highpass IIR filter coefficients.