You are on page 1of 7

Regd. No.

: 2019_EE_053

1
Name: Rimsha Parvaiz

2
Section: B

LAB 11

Design of Discrete-Time IIR Filters – I


Task 1

⦁ Design a lowpass analog Butterworth filter with Ω𝑝 = 1000 KHz, Ω𝑠 = 2000


KHz, passband ripple
𝑅𝑝 = 5 dBs and a stopband ripple of 𝛿𝑠2 = 40 dBs. Find the cutoff
freqeuency so that thespecifications are met exactly at Ω𝑝. Show your work in
the space below.
fc=946e3;
omegaC=2*pi*fc;
N=7;
[b,a] = u_buttap(N,omegaC)

⦁ Also complete the MATLAB function [N, Omegac] = butterap_design


(Omegap, Omegas, Rp, dS_sq)
to design the filter with above mentioned specifications.
OmegaP=1000e3;
OmegaS=2000e3;
Rp=5;
ds_sq=40;
[N,omegaC] = butterap_design(OmegaP,OmegaS,Rp,ds_sq)

⦁ Write a MATLAB script to plot the poles, obtained from the function above.
Also, plot a circle of radius

3
Ω𝑐 on the same figure to verify that the poles indeed lie on this circle.

[z,p,k] = buttap(7) % Butterworth filter prototype

[num,den] = zp2tf(z,p,k); % Convert to transfer function form


freqs(num,den) % Frequency response of analog filter

⦁ Complete the MATLAB function Hsq = butterap_msr (N, Omegac) given


below to compute the magnitude-squared response of the lowpass Butterworth
filter. Then, write a separate script file to call the function for the specifications
mentioned above.

4
% Write your code here.

Task 2
A method to display the frequency-domain plots of analog filter is provided by the
function freqs_m, given below, which is a modified version of a function freqs
provided by MATLAB. This function computes the magnitude response in absolute as
well as in relative dB scale and the phase response.

⦁ Call the above function in a script file to plot the absolute and dB magnitude
response along with thephase response of the lowpass Butterworth filter
designed in Task 1.
zplane(b,a)
viscircles([0 0],5.9464e+06)

[db,mag,pha,w] = freqs_m(b,a,500)
subplot(3,1,1)
plot(w,db)

subplot(3,1,2)
plot(w,mag)

subplot(3,1,3)
plot(w,pha)

5
Task 3
Design, by hand, a discrete-time Butterworth filter with the following specifications:
𝜔𝑝 = 0.3𝜋, 𝜔𝑠 = 0.5𝜋, 𝑅𝑝 = 1 dB and 𝛿𝑠2 = 20 dBs.
Show your working in the space below.

6
⦁ Following the design procedure listed in Section 2.1.1, and using the MATLAB
functions butterap_design, u_buttap and bilinear, design the discrete-time
lowpass Butterworth filter, for specifications given in Task 3, in MATLAB,
i.e., compute its direct-form coefficients.
⦁ Use the function freqs_m to plot the absolute and dB magnitude responses
along with the phase response of the filter.

You might also like