## Developer Reference

• 2020
• 10/21/2020
• Public Content
Contents

# 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 b
0
, b
1
, . . ., b
order
, a
1
, . . ., a
order
are the reduced filter coefficients.
The output signal is computed by the following formula:
.
Reduced coefficients are calculated as a
k
= A
k
/A
0
and b
k
= B
k
/A
0
where A
0
, A
1
,...A
order
, B
0
, B
1
,...B
order
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
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:
1. C
all
ippsIIRInit
to initialize the filter as an arbitrary order IIR filter in the external buffer, or
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
, respectively.
2. Call
ippsIIR
to filter consecutive samples at once.
3. Call
ippsIIRGetDlyLine
and
ippsIIRSetDlyLine
to get and set the delay line values in the IIR state structure.

#### Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804