0% found this document useful (0 votes)
45 views

Lab 8

The document is about designing IIR Chebyshev filters. It discusses how IIR filters can be matched to analog filters by transforming well-known analog filters into digital filters. There are two approaches to IIR filter design: direct digital implementation and frequency transformation of analog prototypes. The lab will follow the second approach by first designing analog lowpass filters, then applying transformations to obtain digital lowpass filters, and finally applying further transformations to obtain other digital filters. It focuses on designing Chebyshev filters in MATLAB by scaling and transforming normalized Chebyshev prototypes.

Uploaded by

Muhammad Sameer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Lab 8

The document is about designing IIR Chebyshev filters. It discusses how IIR filters can be matched to analog filters by transforming well-known analog filters into digital filters. There are two approaches to IIR filter design: direct digital implementation and frequency transformation of analog prototypes. The lab will follow the second approach by first designing analog lowpass filters, then applying transformations to obtain digital lowpass filters, and finally applying further transformations to obtain other digital filters. It focuses on designing Chebyshev filters in MATLAB by scaling and transforming normalized Chebyshev prototypes.

Uploaded by

Muhammad Sameer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

EE-384: Digital Signal Processing Spring 2021

Laboratory 8: IIR Chebyshev Filter Design


Instructor: Mr Ammar Naseer EE UET New Campus

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:

Figure 8.1: IIR Filter design approaches

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:

 Design analog lowpass filters


 Study and apply filter transformations to obtain digital lowpass filters.
 Study and apply frequency-band transformations to obtain other digital filters from digital
lowpass filters.

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)
| | | |

where ϵ is a passband ripple parameter, is the passband cutoff frequency in rad/sec,

Figure 8.2: Analog lowpass filter specifications

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)

The ripples, and , of the absolute scale are related to ϵ and A by


√ (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 Lowpass Filters


There are two types of Chebyshev filters. The Chebyshev I filters have equiripple response in the
passband, while the Chebyahev II filters have equiripple response in the stopband. Butterworth filters
have monotonic response in both bands. We noted that by choosing a filter that has an equiripple rather
than a monotonic behavior, we can obtain a lower-order filter. Therefore Chebyshev filters provide
lower order than Butterworth filters for the same specifications.

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.

Figure 8.3: Typical pole-zero pattern of

From the above two response plots we observe the following properties:
Laboratory 8: IIR Chebyshev Filter Design 8.4

 At (or ); | | for N odd.


| | for N even.
 At (or ); | | for all N.
 For 1 (or ), | | oscillates between 1 and .
 For (or ); | | decreases monotonically to 0.
 At ; | |

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)

where K is a normalizing factor chosen to make

{ (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

function [b,a] = u_chb1ap(N,Rp,OmegaC);


% Unnormalized Chebyshev-l Analog Lowpass Filter Prototype
% ________________________________________________________
% [b,a] = u_chb1ap(N,Rp,Omegac) ;
% b = numerator polynomial coefficients
% a = denominator polynomial coefficients
% N = Order of the Chebyshev Filter
% Rp = Passband Ripple in dB; Rp > 0
% Omegac = Cutoff frequency in radiandsec
%
[z,p,k] = cheb1ap(N,Rp);
a = real (poly (p));
aNn = a(N+1);
p = p*OmegaC;
a = real(poly(p));
aNu=a(N+1);
k = k*aNu/aNn;
b0 = k;
B = real(poly(z));
b = k*B;
end

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

From the properties discussed above we have

and (8.11)

The order N is given by

√ (8.12)

[ √ ]
[ ] (8.13)
* √ +

Now using (8.7), (8.8) and (8.9), we can determine Ha(s).

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

function [b, a] = afd_chb1(wp, ws, Rp, As) ;


% Analog Lovpass Filter Design: Chebyshev-l
%___________________________________________
% [b,a] = afd_chb1(wp, ws, Rp, As);
% b = Numerator coefficients of Ha(s)
% a - Denominator coefficients of Ha(s)
% wp - Passband edge frequency in rad/sec; wp > 0
% ws = Stopband edge frequency in rad/sec; ws > wp > 0
% Rp = Passband ripple in +dB; (Rp > 0)
% As = Stopband attenuation in +dB; (As > 0)
%
if wp <= 0
error('Passband edge must be larger than 0')
end
if ws <= wp
error('Stopband edge muat be larger than Passband edge')
end
if (Rp <= 0) | (As < 0)
error('PB ripple and/or SB attenuation ust be larger than 0')
end
ep = sqrt(10^(Rp/10)-1);
A = 10^(As/20);
OmegaC = wp;
OmegaR = ws/wp;
g = sqrt(A*A-1)/ep;
N = ceil(log10(g+sqrt(g*g-1))/log10(OmegaR+sqrt(OmegaR*OmegaR-1))) ;
fprintf('\n*** Chebyshev-l Filter Order = %2.0f \n',N)
[b,a]=u_chb1ap(N,Rp,OmegaC) ;
End

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

1.0000 0.1753 0.3895


>> % Calculation of Frequency Response:
>> [db,mag,pha,w] = freqs_m(b,a,0.5*pi);
>> % Calculation of Impulse response:
>> [ha,x,t] = impulse(b,a);

The system function is given as

Where the filter response of the system is calculated as shown in Figure 8.4

Figure 8.4: response of Chebyshev-I analog filter

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.

function [b,a] = u_chb2ap(N, As, Omegac);


% Unnormalized Chebyshev-2 Analog Lowpass Filter Prototype
%__________________________________________________________
% [b,a] = u_chb2ap(N, As, Omegac);
% b = numerator polynomial coefficients
% a = denominator polynomial coefficients
% N = Order of the Chebyshev Filter
% As = Stopband Ripple in dB; As > 0
% Omegac = Cutoff frequency in radians/sec
%
[z,p,k] = cheb2ap(N,As);
a = real (poly(p));
aNn = a(N+1);
p = p*Omegac;
a = real(poly(p));
aNu = a(N+1);
b = real (poly(z));
H = length(b) ;
bNn = b(M);
z = z*Omegac;
b = real(poly(z));
bNu = b(M) ;
k=k*(aNu*bNn)/(aNn*bNu);
b0=k;
b=k*b;
end

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

function [b,a] = afd_chb2(wp, ws, Rp, As);


% Analog Lovpass Filter Design: Chebyshev-2
%___________________________________________
% [b,a] = afd_chb2(wp, ws, Rp, As);
% b = Numerator coefficients of Ha(s)
% a = Denominator coefficients of Ha(s)
% wp = Passband edge frequency in rad/sec; wp > 0
% ws = Stopband edge frequency in rad/sec; ws > wp > 0
% Rp = Passband ripple in +dB; (Rp > 0)
% As = Stopband attenuation in +dB; (As > 0)
%
if wp <= 0
Laboratory 8: IIR Chebyshev Filter Design 8.9

error('Passband edge must be larger than 0')


end
if ws <= wp
error('Stopband edge muat be larger than Passband edge')
end
if (Rp <= 0) | (As < 0)
error('PB ripple and/or SB attenuation ust be larger than 0')
end
ep = sqrt(10^(Rp/10)-1);
A = 10^(As/20);
OmegaC = wp;
OmegaR = ws/wp;
g = sqrt(A*A-1)/ep;
N = ceil(log10(g+sqrt(g*g-1))/log10(OmegaR+sqrt(OmegaR*OmegaR-1))) ;
fprintf('\n*** Chebyshev-2 Filter Order = %2.0f \n',N)
[b,a]=u_chb2ap(N,Rp,OmegaC) ;
End

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.

Digital Filter Transformation


After discussing approaches to the design of Analog Chebyshev Filter, we are now ready to transform
them into digital filters. These transformations are complex-valued mappings that have already
discussed and implemented in Laboratory 7. Using the same function digital filter would be designed

Main Lab
8C. Design a lowpass digital filter Chebyshev-I prototype to satisfy the condition

passband cutoff: ; passband ripple: Rp = 3 dB


stopband cutoff: and stopband ripple: As = 40 dB.
Sampling rate = 8000 sam/sec

Choose T=1 .Determine the system function H(z) and plot the log magnitude response in dB

a) Using Impulse Invariant Transform


b) Using Bilinear Transformation
c) Compare the filter designed in (a) and (b) Discuss which type of digital transformation was
better for designing Chebyshev-I filter.

You might also like