6.7. IIR Filter Design#
Typically, we convert standard continuous-time (analog) filters to obtain discrete-time IIR filters by applying appropriate transformations.
6.7.1. Prototype Analog Filters#
Let’s start by introducing a few common lowpass analog filter prototypes.
6.7.1.1. Butterworth Filter#
A Butterworth filter of order
is an all-pole filter characterized by the following square-magnitude response:(6.16)#where
is the passband edge and is the dB cutoff frequency.The transfer function
, i.e. the Laplace transform of the impulse response , of the Butterworth filter satisfies:(6.17)#Tip
Note that
.The roots of the denominator polynomial on the RHS of (6.17) are
for . That is, they are evenly spaced points on the circle of radius centered at the origin on the -plane. Selecting all the roots on the left-half plane, we obtain a stable filter with transfer function:which gives our lowpass Butterworth filter prototype.
Note that
in (6.16) is monotone decreasing in (positive) . Thus there are no ripples in either the passband or stopband for the Butterworth filter. We often say that the Butterworth filter has flat passband and stopband.
6.7.1.2. Type-I Chebyshev Filter#
A type-I Chebyshev filter of order
is an all-pole filter characterized by:(6.18)#where
is the Chebyshev polynomial of degree
.Tip
One may also get the Chebyshev polynomials using the following recursion:
The poles of
of the type-I Chebyshev filter lie on an ellipse centered at the origin on the -plane with major and minor axis radii and , where . Choosing all poles on the left half plane gives a stablewhere
and for .The type-I Chebyshev filter is equiripple in the passband and flat in the stopband.
6.7.1.3. Type-II Chebyshev Filter#
A type-II Chebyshev filter of order
is a filter with zeros and poles characterized by:(6.19)#where
and are the passband and stopband edge frequency, respectively.For a stable filter, the transfer function of the type-II Chebyshev filter is given by
where
and for .The type-II Chebyshev filter is equiripple in the stopband and flat in the passband.
6.7.1.4. Elliptic Filter#
An elliptic filter of order
is a filter with zeros and poles characterized by:(6.20)#where
is the Jacobian elliptic function of order (see [Orf06] for details).The zeros of the transfer function
of the elliptic filter are on the -axis.The elliptic filter is equiripple in both the passband and stopband.
The elliptic filter has a lower order than the Butterworth and Chebyshev filters for the same specification.
6.7.1.5. Analog Filter Design#
To design an analog lowpass filter with specification
:After obtaining the transfer function
of a lowpass prototype design with passband edge frequency , one may use the transformations given in the table below to get the transfer function of another type of filter:New filter type
New band edge(s)
Transformation
Lowpass
Highpass
Bandpass
Bandstop
6.7.2. Impulse Invariance Method#
Sample the impulse response
of an analog lowpass filter prototype at sampling rate to obtain the impulse response of the target discrete-time lowpass IIR filter.If
is bandlimited and we oversample to get , then from that the Poisson sum formula (3.6), the frequency response of iswhere
is the frequency response of . Thus, the design specification of the discrete-time lowpass IIR filter will be met if we set , , and design the continuous-time lowpass filter prototype to satisfy the specification .Often, we use the Butterworth, Chebyshev, and elliptic filters described above as prototypes for the analog filter design.
Tip
Since the magnitude responses of the Butterworth, Chebyshev, and elliptic (see (6.16), (6.18), (6.19), and (6.20)) are functions of the ratio
or , we may simply set in the design process without any loss of generality.Caution
As none of the Butterworth, Chebyshev, and elliptic filters are strictly bandlimited, the impulse invariance design obtained by sampling the impulse response of the analog filter prototype may suffer from aliasing, typically causing larger stopband ripples. To overcome this problem, we may need to use a tighter values for
and so that the achieved ripples in the passband and stopband are within the original specification.Note that the analog filter prototypes described in Section 6.7.1 above all have single-order poles. Hence their continuous-time transfer functions have the following partial fraction expansion:
where
are the poles. Taking inverse Laplace transform to get the causal impulse responseSampling
at givesTaking
-transform on , we getSince
is stable by construction, for . Thus the poles of the transfer function of the resulting discrete-time IIR filter are all strictly inside the unit circle, i.e., is also stable.MATLAB Example 7:
Consider again the same design specification as in Examples 1 and 4 in Section 6.6, except in this example we want to design a lowpass IIR filter with the specification
based on an analog type-I Chebyshev filter prototype. Using the impulse invariance method with , the required specifications of the analog type-I Chebyshev filter prototype are , , , and .Next, we employ (6.18) to determine the value of
and the filter order required to meet the specifications. We can be done using the MATLAB functioncheb1ord
:>> Rp = -20*log10(1-0.01); >> Rs = -20*log10(0.001); >> [N, wp] = cheb1ord(0.3*pi, 0.35*pi, Rp, Rs, 's') N = 17 wp = 0.9425
to get that the filter required order is
. Note that the value of depends only on and . Then we can use the MATLAB functioncheby1
to obtain the analog type-I Chebyshev filter prototype:>> [bc, ac]= cheby1(N, Rp, wp, 's'); >> freqs(bc, ac, [0:0.0001:pi]);
We can see that the analog filter prototype meets its specifications. Finally, we may use the MATLAB function
impinvar
to apply the impulse invariance method to obtain the target discrete-time IIR filter:>> [b, a] = impinvar(bc, ac); >> fvtool(b, a);
We can check that the original specification
is met.Tip
Note that the order of the IIR filter obtained from the impulse invariance method is much smaller than those of the FIR filters obtained in Examples 1 and 4 with the same specification. However, the group delay of the IIR filter is not a constant over the passband.
MATLAB Example 8:
Repeat Example 7 using an analog elliptic filter prototype instead:
>> Rp = -20*log10(1-0.01); >> Rs = -20*log10(0.001); >> [N, wp] = ellipord(0.3*pi, 0.35*pi, Rp, Rs, 's') N = 9 wp = 0.9425 >> [bc, ac] = ellip(N, Rp, Rs, wp, 's'); >> freqs(bc, ac, [0:0.0001:pi]);
We can see that this analog filter prototype also meets its specifications. However, applying the impulse invariance method:
>> [b, a] = impinvar(bc, ac); >> fvtool(b, a);
We see that the resulting IIR filter violates its specifications in both the passband and stopband. Redoing the design with more stringent values for
and :>> Rp = -20*log10(1-0.01); >> Rs = -20*log10(0.001); >> [N, wp] = ellipord(0.3*pi, 0.35*pi, Rp*0.75, Rs+15, 's') N = 10 wp = 0.9425 >> [bc, ac] = ellip(N, Rp*0.75, Rs+15, wp, 's'); >> [b, a] = impinvar(bc, ac); >> fvtool(b, a);
gives an IIR filter that satisfies the specification of
. Note that the order of this IIR filter is , smaller than that of the IIR filter obtained from the type-I Chebyshev prototype.
6.7.3. Bilinear Transform Method#
Obtain the transfer function
of the discrete-time IIR filter directly from the transfer function of an anlog prototype filter by the bilinear transformation:(6.21)#where
is the sampling rate.Let
. Inverting the bilinear transform givesThus:
If
, then . That is, the left half -plane is mapped onto the inside of the unit circle in the -plane by the bilinear transform.If
, then . That is, the right half -plane is mapped onto the outside of the unit circle in the -plane by the bilinear transform.If
, then . That is, the axis of -plane is mapped onto the unit circle of the -plane by the bilinear transform.
From observation 1, the bilinear transform (6.21) maps causal stable analog filter to a causal stable discrete-time IIR filter.
Based on observation 3, substituting
and into (6.21) gives(6.22)#for
, which shows that the mapping between the axis of -plane and the unit circle of the -plane, i.e., between the angular frequency of the analog filter and the normalized radian frequency of the discrete-time filter, induced by the bilinear transform (6.21) is one-to-one. As a result, the bilinear transform (6.21) can be employed to turn lowpass, highpass, bandpass, and bandstop analog filter prototypes to their respective discrete-time counterparts.The design steps of the bilinear tranform method are then simply:
Starting from the specification of the discrete-time IIR filter, use (6.22) to convert the specification to one for the analog filter prototype. For example, the specification
for the case of a lowpass discrete-time filter is converted to the specification of a lowpass analog filter prototype, where and are obtained from and using (6.22), respectively.Design an analog filter prototype that satisfies the specification obtained in step 1.
Use the bilinear transform (6.21) to obtain the transfer function
of the target discrete-time IIR filter from the transfer function of the analog filter prototype in step 2.
MATLAB Example 9:
Repeat Example 7 above, except using the bilinear transform method with
to obtain the discrete-time IIR filter from an analog type-I Chebyshev filter prototype. First, use (6.22) to obtain and from the IIR filter’s specification in order to design the analog prototype:>> Rp = -20*log10(1-0.01); >> Rs = -20*log10(0.001); >> wp = 2*tan(0.3*pi/2); >> ws = 2*tan(0.35*pi/2); >> [N, wp] = cheb1ord(wp, ws, Rp, Rs, 's') N = 16 wp = 1.0191 >> [bc, ac] = cheby1(N, Rp, wp, 's'); >> freqs(bc, ac, [0:0.0001:pi]);
Then, we can use the MATLAB function
bilinear
to apply the bilinear transformation in (6.21) to get the discrete-time IIR filter:>> [b, a] = bilinear(bc, ac, 1); >> fvtool(b, a);
Tip
One may more conveniently use the MATLAB function
cheby1
to directly perform the steps above:>> [N, wp] = cheb1ord(0.3, 0.35, Rp, Rs) N = 16 wp = 0.3000 >> [b, a] = cheby1(N, Rp, wp); >> fvtool(b, a);
MATLAB Example 10:
Design a discrete-time highpass IIR filter with passband
and ripple tolerance , and stopband and ripple tolerance as in Example 5 in Section 6.6. Following Example 9, we use the type-I Chebyshev filter as our prototype analog filter to perform the design.The following MATLAB commands:
>> Rp = -20*log10(1-0.01); >> Rs = -20*log10(0.001); >> [N, wp] = cheb1ord(0.7, 0.65, Rp, Rs) N = 16 wp = 0.7000 >> [b, a] = cheby1(N, Rp, wp, 'high'); >> fvtool(b, a);
design an analog lowpass type-I Chebyshev filter with
radian per second satisfying the and specifications, transform the lowpass prototype to a highpass prototype using the table in Section 6.7.1.5, and finally apply the bilinear transformation to obtain the desired discrete-time highpass IIR filter.MATLAB Example 11:
Design a discrete-time bandpass IIR filter with passband
and ripple tolerance , and stopband and ripple tolerance . Again, we use the type-I Chebyshev filter as our prototype analog filter to perform the design as in the following MATLAB commands:>> Rp = -20*log10(1-0.01); >> Rs = -20*log10(0.001); >> [N, wp] = cheb1ord([0.5 0.7], [0.45 0.75], Rp, Rs) N = 10 wp = 0.5000 0.7000 >> [b, a] = cheby1(N, Rp, wp); >> fvtool(b, a);
to obtain the desired discrete-time bandpass IIR filter. Note that the order of the filter obtained is
.
6.7.4. Frequency Transformation of IIR filters#
In Section 6.5.4, we discuss how to transform a lowpass FIR filter to a highpass one by frequency shifting. The same frequency-shifting transformation clearly applies to IIR filters also. As a matter of fact, a more general class of transformations that map the unit circle (on the
-plane) onto itself can be applied to convert a lowpass IIR filter to another IIR filter fo other types.Write the mapping discussed above as
. Since the unit circle is mapped onto itself, . That means, we can think of as the transfer function of an allpass filter of the general form (6.5) with , i.e.,For example, the frequency shifting by
considered in Section 6.5.4 corresponds to the mapping .Other useful mappings of this form are summarized in the table below. The listed mappings can be employed to convert a lowpass IIR filter with passband edge frequency
to another lowpass filter, a highpass filter, a bandpass filter, and a bandstop filter, respectively.New filter type
New band edge(s)
Transformation
Parameter(s)
Lowpass
Highpass
Bandpass
Bandstop
The MATLAB functions
iirlp2??
implement the frequency transformations in the table above.MATLAB Example 12:
We apply the bandpass transformation to obtain a bandpass IIR filter with passband
from the lowpass IIR filter in Example 9 above:>> Rp = -20*log10(1-0.01); >> Rs = -20*log10(0.001); >> [N, wp] = cheb1ord(0.3, 0.35, Rp, Rs); >> [b, a] = cheby1(N, Rp, wp); >> [b11, a11] = iirlp2bp(b, a, 0.3, [0.5 0.7]); >> fvtool(b11, a11);
Caution
Note that since the frequency transformation maps the unit circle onto itself, the specifications of
and are perserved. However, as the transformation may include frequency shifting and scaling, the width of the transition bands may not be the same as that of the original filter. In addition, the order of the transformed filter may also be larger than that of the original filter.In this example, the transformed filter has order
, which is higher than that of the filter obtained in Example 11. We can also check that the width of transition bands is smaller than that of the filter in Example 11.