You are on page 1of 4

IIR Digital Filter Design

Similar to FIR digital filter design, the IIR digital filter design consists of two steps. In
the first step, the filter order N is estimated from the given specifications. In the second
step, the coefficients of the transfer function are determined using the estimated order and
the filter specifications.

Order Estimation

The figure below shows the typical magnitude specifications for a digital lowpass filter.

The peak passband ripple 𝛼! and the minimum stopband attenuation 𝛼" are given in dB;
that is, the loss specifications of a digital filter are given by

𝛼! = −20𝑙𝑜𝑔#$ (1 − 𝛿! ) dB,
𝛼" = −20𝑙𝑜𝑔#$ (𝛿" ) dB.

For the filter estimation of the IIR digital filter to be designed using the bilinear
transformation method, the functions to use are as follows: buttord for the Butterworth
filters, cheb1ord for the Type 1 Chebyshev filters, cheb2ord for the Type 2 Chebyshev
filters, and ellipord for the elliptic filters.

Ex 1. Determine the minimum order of the transfer function of a Type 2 Chebyshev


digital highpass filter operating at a sampling rate of 4 kHz with the following
specifications: passband edge at 1000 Hz, stopband edge at 600 Hz, passband ripple of 1
dB, and minimum stopband attenuation of 40 dB.

The normalized passband edge is 1000 Hz / (4000 Hz/2) = 0.5 and the normalized
stopband edge is 600 Hz / (4000 Hz/2) = 0.3. Using the function cheb2ord

[N,Wn] = cheb2ord(0.5, 0.3, 1, 40);

What’s the resulting value for N? How would you compare the result if you used the FIR
function kaiserord?
Ex 2. Determine the minimum order of an elliptic bandpass filter operating at a sampling
rate of 1600 Hz with the following specifications: passband edges at 200 Hz and 280 Hz,
stopband edges at 160 Hz and 300 Hz, passband ripple of 0.1 dB, and minimum stopband
edge of 70 dB.

Wp = [200 280]/800; Ws = [160 300]/800;


Rp = 0.1; Rs = 70;
[n,Wp] = ellipord(Wp,Ws,Rp,Rs) % Gives mimimum order of filter

IIR Filter Design

For IIR filter design based on the bilinear transformation, MATLAB/Octave includes
functions for each one of the four magnitude approximation techniques. Specifically, the
following M-files are available: butter for the design of butterworth filters, cheby1 for
the design of Type 1 Chebyshev filters, cheby2 for the design of Type 2 Chebyshev
filters, and ellip for the design of elliptic filters. The output could be either the numerator
and denominator coefficient vectors or the vectors of zeros, the vector of poles, and the
scalar gain factor. The numerator and denominator coefficients of the transfer function
can be determined from the latter data using the function zp2tf. After the transfer function
has been computed, the frequency response can be computed using the function freqz.

Ex 3. Determine the transfer function and plot the gain response of an elliptic IIR lowpass
filter with the following specifications: passband edge at 800 Hz, stopband edge at 1000
Hz, passband ripple of 0.5 dB, minimum stopband attenuation of 40 dB, and sampling
rate of 4000 Hz.

Wp = 800/2000; Ws = 1000/2000;
Rp = 0.5; Rs = 40;
[n,Wp] = ellipord(Wp,Ws,Rp,Rs) % Gives mimimum order of filter
[b,a] = ellip(n,Rp,Rs,Wp); % Elliptic filter design
freqz(b,a,512,4000) %plot frequency response

Other types of digital filters can be designed by simple modifications of the filter
functions.

Ex 4. Design a Type 1 Chebyshev IIR highpass filter. The specifications of the highpass
filters are as follows: passband edge at 700 Hz, stopband edge at 500 Hz, passband ripple
of 1 dB, minimum stopband attenuation of 32 dB, and sampling frequency of 2000 Hz.

If your design is correct, the magnitude response of the filter should look like the figure
below.
Type I Chebyshev Highpass Filter
0
X: 0.7031
Y: −0.6847

−50

−100
Gain, dB

−150

−200

−250
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
ω/π

Ex 5. Design a Butterworth IIR bandpass filter. The specifications are as follows:


normalized passband edges at 0.45p and 0.65p, normalized stopband edges at 0.3p and
0.75p, passband ripple of 1 dB, and a minimum stopband attenuation of 40 dB.

If your design is correct, the magnitude response of the filter should look like the figure
below.
IIR Butterworth Bandpass Filter
50

0
X: 0.75
Y: −40

−50

−100
Gain, dB

−150

−200

−250

−300

−350
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
ω/π
Challenge: The figure below shows the mapping of DTMF frequencies to the digits.

Suppose digit 8 is pressed for 1-second.


a. Generate the corresponding DTMF signal, i.e. create 2 sinusoids with frequencies
852 Hz and 1336 Hz then get their sum. Assume Fs=8 kHz.
b. Verify the signal by displaying its spectrum.
c. Design two IIR filters to separate the two frequency components of the signal.
d. Verify the IIR designs by filtering the signal. Use the function filter(B,A,x), where
B and A are vectors of filter coefficients in the numerator and denominator
respectively, and x is the signal to be filtered.
e. Display the two spectra of the filtered signals.

You might also like