Lab 8
Lab 8
Aims
IIR filters have infinite-duration impulse responses, hence they can be matched to analog filters, all of
which generally have infinitely long impulse responses. Therefore the basic technique of IIR filter design
transforms well-known analog filters into digital filters using complex-valued mappings. The advantage
of this technique lies in the fact that both analog filter design (AFD) tables and the mappings are
available extensively in the literature. This basic technique is called the A/D (analog-to-digital) filter
transformation. There are two approaches to this basic technique of IIR filter design:
The first approach is used in MATLAB to design IIR filters. A straightforward use of these MATLAB
functions does not provide any insight into the design methodology. Therefore we will study the second
approach because it involves the frequency band transformation in the digital domain. Hence in this IIR
filter design technique we will follow the following steps:
We begin with a discussion on the analog filter specifications and the properties of the magnitude
squared response used in specifying analog filters. This is followed by MATLAB implementation of widely
used analog filters: namely, Butterworth, Chebyshev
Page 1
Laboratory 8: IIR Chebyshev Filter Design 8.2
Pre-Lab:
Relative Linear Scale
Let be the frequency response of an analog filter. Then the lowpass filter specifications on the
magnitude-squared response are given by
| | | |
(8.1)
| | | |
A is a stopband attenuation parameter, and is the stopband cutoff in rad/sec. These specifications
are shown in Figure 8.2. The parameters ϵ and A are related to parameters Rp and As, respectively, of the
dB scale. These relations are
√ ⁄ (8.2)
and
(8.3)
√
√ (8.4)
and
(8.5)
Laboratory 8: IIR Chebyshev Filter Design 8.3
IIR filter design techniques rely on existing analog filters to obtain digital filters. We designate these
analog filters as prototype filters. In this section we briefly summarize the characteristics of Chebyshev
lowpass (Type I and II) filter. Although we will use MATLAB functions to design these filters, it is
necessary to learn the characteristics of these filters so that we can use proper parameters in MATLAB
functions to obtain correct results.
Chebyshev-I
The magnitude-squared response of a Chebyshev-I filter is
| |
(8.6)
( )
where N is the order of the filter, is the passband ripple factor, which is related to RP, and TN (x) is the
Nth-order Chebyshev polynomial given by
{ where x=
The equiripple response of the Chebyshev filters is due to this polynomial TN(x). Its key properties are (a)
for 0 < x < 1, TN(x) oscillates between -1 and 1, and (b) for 1 < x <∞, TN(x) increases monotonically to m.
There are two possible shapes of | | , one for N odd and one for N even as shown in. Note that
, is the normalized frequency.
From the above two response plots we observe the following properties:
Laboratory 8: IIR Chebyshev Filter Design 8.4
To determine a causal and stable Ha(s), we must find the poles of Ha(s)Ha(-s) and select the left half plane
poles for Ha(s). The poles of Ha(s)Ha(-s) are obtained by finding the roots of
( )
The solution of this equation can be shown that if , k = 0,. . ., N - 1 are the (left half plane)
roots of the above polynomial, then
[ ]
(8.7)
[ ]
where
(√ √ ) (√ √ ) and √ (8.8)
These roots fall on ellipse with major axis , and minor axis , Now the system function is given by
(8.9)
∏
{ (8.10)
√
Matlab implementation
MATLAB provides a function called [z, p, k] = cheb1ap(N, Rp) to design a normalized Chebyshev-I analog
prototype filter of order N and passband ripple Rp and that returns zeros in z array, poles in p array and
the gain value k. We need an unnormalized Chebyshev-I filter with arbitrary . This is achieved by
scaling the array p of the normalized filter by . Similar to the Butterworth prototype, this filter has no
zeros. The new gain k is determined using (11.10), which is achieved by scaling the old k by the ratio of
the unnorrnalized to the normalized denominator polynomials evaluated at s = 0. In the following
function, called U_chb1ap(N, Rp, Omegac), we design an unnormaliued Chebyshev-I analog prototype
filter that returns in the direct form.
Laboratory 8: IIR Chebyshev Filter Design 8.5
Design Equations
Given , , and , three parameters are required to determine a Chebyshev-I filter: and N.
From equations (8.2) and (8.3) we obtain
√ and
and (8.11)
√ (8.12)
[ √ ]
[ ] (8.13)
* √ +
Matlab Implementation
Using the u_chb1ap function, we provide a function called afd_chb1 to design an analog Chebyshev-1
lowpass filter.
Laboratory 8: IIR Chebyshev Filter Design 8.6
8A: Design the analog Chebyshev-I lowpass filter using MATLAB passband cutoff: ; passband
ripple: Rp = 1 dB, stopband cutoff: and stopband ripple: As = 16 dB.
>> wp = 0.2*pi;
>> ws = 0.3*pi;
>> Rp = 1;
>> As = 16;
>> Ripple=10^(-Rp/20);
>> Attn=10^(-As/20);
>> % Analog filter design:
>> [b,a] = afd_chb1(wp, ws, Rp, As);
*** Chebyshev-l Filter Order = 4
>> % Calculation of second-order sections:
>> [C,B,A] = sdir2cas(b,a)
C =
0.0383
B =
0 0 1
A =
1.0000 0.4233 0.1103
Laboratory 8: IIR Chebyshev Filter Design 8.7
Where the filter response of the system is calculated as shown in Figure 8.4
Chebyshev - II
A Chebyshev-II filter is related to the Chebyshev-I filter through a simple transformation. It has a
monotonic passband and an equiripple stopband, which implies that this filter has both poles and zeros
in the s-plane. Therefore the group delay characteristics are better (and the phase response more linear)
in the passband than the Chebyshev-I prototype. If we replace the term ( ) in (8.6) by its
reciprocal and also the argument ⁄ by its reciprocal, we obtain the magnitude squared
response of Chebyshev-I1 as
| |
* ( )+
One approach to designing a Chebyshev-II filter is to design the corresponding chebyshev-I first and then
apply the above transformations. We will not discuss the details of this filter but will use a function from
MATLAB to design a Chebyshev-II filter.
Laboratory 8: IIR Chebyshev Filter Design 8.8
MATLAB Implementation
MATLAB provides a function called [z ,p ,k] =cheb2ap (N, As) to design a normalized Chebyshev-II analog
prototype filter of order N and stopband attenuation As and that returns zeros in z array, poles in p
array, and the gain value k. In the following function, called u_chb2ap(N, As, Omegac) we design an
unnormalized Chebyshev-I1 analog prototype filter that returns Ha(s) in the direct form.
The design equations for the Chebyshev-II prototype are similar to those of the Chebyshev-I except that
since the ripples are in the stopband. Therefore we can develop a MATLAB function similar to
the afd_chb1 function for the Chebyshev-II prototype
8B: Design the analog Chebyshev-II lowpass filter using MATLAB passband cutoff: ; passband
ripple: Rp = 1 dB, stopband cutoff: and stopband ripple: As = 16 dB.
Main Lab
8C. Design a lowpass digital filter Chebyshev-I prototype to satisfy the condition
Choose T=1 .Determine the system function H(z) and plot the log magnitude response in dB