Filters and Equalizers 799
23.5.1.2 FIR Length
The required number of taps (N) in an FIR filter at a
sample rate (fS) for a given transition band specified by a
width (ft ) and attenuation in dB(A) can be estimated as
(23-60)
As an example, we can calculate how may taps a
100 Hz, fourth order high-pass filter in a 48 kHz system
would use. Fourth order gives a roll-off of 24 dB per
octave, so the response will be 24 dB down by 50 Hz.
The transition band is for a 20 dB minimum attenuation
in the stop band and therefore is 50 × 20/24 or 42 Hz
wide and the desired attenuation is 24 dB so the equa-
tion gives us 48,000 × 20 × /(42 × 22) = 1049 taps. This
is a very long filter and introduces 520 samples or
10.8 ms of delay at the 48 kHz sample rate.
If we consider the same example, but for a 1000 Hz
cutoff frequency, everything scales by a factor of 10,
giving a much more acceptable filter length of 105
samples with a delay of 1.1 ms. This illustrates the limi-
tation of using FIR filters for low frequencies,
Fig. 23-24.
23.5.2 IIR Filters
There are many possible configurations of infinite
impulse response (IIR) filters, two of which are shown
in Figs. 23-25 and Fig. 23-26. They show the direct
form of a biquad filter in which the input and output
samples are passed into the delay line. The transpose
form has a sum between every delay and scaled copies
of the input and output samples are inserted into the
delay line. Direct form I is better suited to fixed point
implementation where it is important that the delayed
terms maintain as much precision as possible.
The biquad IIR filter is a second-order filter, and
forms the most common basis for higher-order IIR
filters. This form fits well with the transfer function
equations such as the Butterworth polynomials in Table
23-1. The feedback coefficients correspond to the poles
of the filter and the direct coefficients correspond to the
zeros. Each section can be represented as a short FIR
filter, but unlike the direct implementation of an FIR,
these sections can have complex coefficients, even if the
input and output are to be real only.
23.5.2.1 Calculation of Coefficients from Poles and
Zeros
IIR filters are designed in terms of the Z transform. In
this transform, the time domain representation of the
filter is used and the notation z^1 is used in place of the
common exponential terms in the discrete Fourier trans-
form:
Figure 23-23. Coefficients of a 100-tap low pass filter at 0.2
times the sample rate.
Figure 23-24. Increasing filter steepness with number of
FIR taps.
0.6
0.5
0.4
0.3
0.2
0.1
0
0.10 20 40 60 80 100
Tap number
Coefficient value
N
f 5 A
ft 22
---------=
Logarithmic frequency
Gain–dB
0
20
40
60
80
10
1
100
50
20
Figure 23-25. IIR Filter implementing a bi-quad section in
Direct Form I.
Figure 23-26. IIR filter implementing a bi-quad section in
Direct Form II.
a 0
a 2
a 2
b 1
b 2
Z^1
Z^1
Z^1
Z^1
3
a 0
a 2
a 2
b 2
b 2
Z^1
Z^1
3 3