How To Design IIR Filter
How To Design IIR Filter
We start with H(s), redefine the variable s using the bilinear transform, and do the
algebra. Our goal is to form H(z) as given above and pick off the various coefficients for
use in the IIR filter.
These 2 equations are the desired results, where we have set a0 = 1. Now all that is
needed is to plug in the As, Bs .. Fs from the original H(s).
The value of T is determined by Omega, the desired cutoff frequency for the IIR filter,
which is in terms of Nyquist. For example, if the sampling frequency Fs is 20 kHz, and
the desired corner frequency is 2.0 kHz, then = 0.2. (2kHz / (Fs/2) = 0.2)
H(z) reduces to the following for all pole filters.
When doing low pass and high pass filters, we get a 2nd order section in H(z) for each
2nd order section in H(s). You will see however that band pass and notch filters generate
a forth order section in H(z) for each 2nd order low pass term of H(s).
If working with odd order polynomials, which have 1 pole sections, do not make the
mistake of assuming that the 2nd order H(z) reduces to the 1st order H(z) because A = D
= 0, it does not. If A and D are set to zero in the 2nd order H(z), the filter will work
correctly, but you will have implemented a single pole in a 2nd order section. Use the 1
pole H(z) equation for the odd pole.
Pole Ordering
An important aspect to filter design, whether digital or analog, is to place the 2nd order
sections in the correct order.
In the s domain, a 2nd order equation is routinely written as:
H(s) = s2 + 2 s + 2 where is referred to as the damping factor.
As an example, here are the 2nd order sections for a 6 pole Butterworth. In this case, =
1 for all three.
s2 + 0.5176380902 s + 1.0 = 0.258
s2 + 1.4142135624 s + 1.0 = 0.707
s2 + 1.9318516526 s + 1.0 = 0.965
In this plot, we show the frequency response for these sections and their pole locations on
the s plane.
If building an opamp filter, we order the sections by zeta, placing the section with =
0.965 first as a way to minimize the voltage swing of the succeeding sections. This is
simply good design practice because it reduces the chances for the first stage to saturate.
Similarly, when designing an IIR filter to be used on a fixed point processor, we want to
keep the math values minimized so we can prevent register overflow. To do this, we
order the sections by zeta, using the section with the largest zeta first.
If the pole count is odd, the odd pole resides on the real axis, so its zeta is essentially 1.0,
and should be used first.
Zero Ordering
The Inverse Chebyshev and Elliptic also have s plane zeros. From a mathematical
perspective, the poles and zeros can be grouped together in the 2nd order sections in any
manner desired, but we want to arrange the zeros in a way that minimizes the peak math
values. This can be done by ordering the zeros so that the inner most zero is used first.
This is a pole zero plot for a 6 pole Inverse Chebyshev.
Here is an example of how incorrect pole zero ordering can affect the peak math values
generated by the filter.
Peak Math Values for a 10 Pole Inv Chebyshev Low Pass
Correct Ordering
127.0
Zeros Reversed
198.8
Poles Reversed
513.0
Both Reversed
760.0
The following gives the derivations for high pass, band pass, and notch filters.
Rather than show the expanded view of this equation, we simply give the 10 coefficients.
As noted above, this 4th order H(z) would almost certainly need to be factored if
implemented in fixed point.
Q = OmegaC / BW / Q;