United International University
Dept. of Electrical & Electronic Engineering (EEE)
Fall 2022
DIGITAL SIGNAL PROCESSING
LABORATORY EEE 3310
Lab Report – 4
Submitted to:
Dr. Khawza Iftekhar Uddin Ahmed
Submitted by:
GROUP 1
Name ID
Joyanta Debnath 021 182 032
Ranjan Kumer Sarker 021 191 027
Shakib Hasan 021 201 054
Mushfiqul Hoque 021 201 103
Date of Performance: 05th November 2022
Date of Submission: 12th November 2022
Lab Report - 4
Frequency Domain Analysis using MATLAB
Introduction: From this lab session-04 we get to know about Z-Transformation, IZ-Transformation,
Pole-Zero representation, F-response, Stability & Causality and get some idea about DTFT and finally
we implement some examples using MATLAB on these topics
Theoretical Background: During the class before going every lab session at first our teacher gave
us theoretical knowledge about that particular topic and the examples. This is how we can get to know
about Z-T, IZ-T, Pole-Zero, F-response, Stability & Causality etc. and so on.
In Lab Evaluation:
1. Consider the system having transfer function,
1 + 2 z −1
H (z) =
1 − 0.5 z −1 + z −2
(i) Sketch the impulse response using MATLAB. Comment on the stability of
the system.
(ii) Plot pole-zero diagram and comment on the stability of the system
assuming that the system is causal
Code:
b=[1 2];
a=[1 -.5 1];
subplot(2,1,1);
impz(b,a)
subplot(2,1,2);
zplane(b,a)
Page 2 of 15
2. Compute and plot the frequency response of a causal LTI discrete-time system
with a transfer function given by,
0.15(1 − z −2 )
(a) H (z) =
1 − 0.5 z −1 + 0.7 z −2
0.15(1 − z −2 )
(b) H (z) =
0.7 − 0.5 z −1 + z −2
What is the difference between the two filters in (a) and (b), respectively? Which
one will you choose for filtering and why?
Code: a
b=[.15 0 -.15];
a=[1 -.5 .7];
[H,w] = freqz(b,a,50); magH = abs(H); phaH = angle(H);
subplot(2,1,1);plot(w/pi,magH);grid
xlabel('frequency in pi units'); ylabel('Magnitude');
title('Magnitude Response')
subplot(2,1,2);plot(w/pi,phaH/pi);grid
Page 3 of 15
xlabel('frequency in pi units'); ylabel('Phase in pi
units');
title('Phase Response')
Code: b
b=[.15 0 -.15];
a=[.7 -.5 1];
[H,w] = freqz(b,a,50); magH = abs(H); phaH = angle(H);
subplot(2,1,1);plot(w/pi,magH);grid
xlabel('frequency in pi units'); ylabel('Magnitude');
title('Magnitude Response')
Page 4 of 15
subplot(2,1,2);plot(w/pi,phaH/pi);grid
xlabel('frequency in pi units'); ylabel('Phase in pi
units');
title('Phase Response')
Homework:
1. Consider the system having transfer function,
1 − 1.2z −1
H( z) =
1 − 0.5z −1
(i) Plot the impulse response using MATLAB. Comment on the stability
of the system.
(ii) Plot pole-zero diagrams and comment on the stability of the system.
Page 5 of 15
Code:
b=[1 -1.2];
a=[1 -0.5];
subplot(2,1,1);
impz(b,a)
subplot(2,1,2);
zplane(b,a)
2. Consider the system having transfer function,
1 + z −1
H ( z) =
1 − 2 z −1 + z −2
(i) Plot the impulse response using MATLAB. Comment on the stability
of the system.
(ii) Plot pole zero diagram and comment on the stability of the system.
Page 6 of 15
Code:
b=[1 1];
a=[1 -2 1];
subplot(2,1,1);
impz(b,a)
subplot(2,1,2);
zplane(b,a)
3. Consider a system which has poles at
p1, 2 = re j / 4
and a zero at
z1 = 0.707r
Page 7 of 15
where: (i) r = 0.96 (ii) r = 0.71 and (iii) r = 0.14
(a) Derive analytically the impulse response of the system and show its
dependence on r. Sketch the impulse response for r=0.96
(b) Plot the frequency and phase response for case (i)
(c) Plot the frequency and phase response for case (ii)
(d) Plot the frequency and phase response for case (iii)
(e) Observe the differences in the the three plots.
Code: a
a) P1=.96*e^(j*pi/4) = .68+j.68 . P2 = .68 – j.68. Z1 = 0.707*.96 = .68
b=[.68];
a=[0.68+.68j .68-.68j];
impz(b,a)
Page 8 of 15
Code: b
b=[.68];
a=[0.68+.68j .68-.68j];
[H,w] = freqz(b,a,100);
magH = abs(H);
phaH = angle(H);
subplot(2,1,1);
plot(w/pi,magH);
grid
xlabel('frequency in pi units'); ylabel('Magnitude');
title('Magnitude Response')
subplot(2,1,2);
plot(w/pi,phaH/pi);
grid
xlabel('frequency in pi units'); ylabel('Phase in pi
units');
title('Phase Response')
Page 9 of 15
P1=.71*e^(j*pi/4) = .502+j.502 . P2 = .502 – j.502. Z1 = 0.707*.71 = .502
Code: c
b=[.502];
a=[.502+.502j .502-.502j];
[H,w] = freqz(b,a,100);
magH = abs(H);
phaH = angle(H);
subplot(2,1,1);
plot(w/pi,magH);
grid
xlabel('frequency in pi units'); ylabel('Magnitude');
title('Magnitude Response')
subplot(2,1,2);
plot(w/pi,phaH/pi);
grid
xlabel('frequency in pi units'); ylabel('Phase in pi
units');
title('Phase Response')
Page 10 of 15
P1=.14*e^(j*pi/4) = .098+j.098 . P2 = .098 – j.098. Z1 = 0.707*.14 = .098
Code: c
b=[.098];
a=[.098+.098j .098-.098j];
Page 11 of 15
[H,w] = freqz(b,a,100);
magH = abs(H);
phaH = angle(H);
subplot(2,1,1);
plot(w/pi,magH);
grid
xlabel('frequency in pi units'); ylabel('Magnitude');
title('Magnitude Response')
subplot(2,1,2);
plot(w/pi,phaH/pi);
grid
xlabel('frequency in pi units'); ylabel('Phase in pi
units');
title('Phase Response')
Page 12 of 15
4. Consider the following system:
z −3 − 1.8z −2 + 1.62z −1 − 0.729
H(z) =
1 − 1.8z −1 + 1.62z −2 − 0.729z −3
(a) Find the poles and zeros of the transfer function.
(b) Plot the frequency and phase response of the system on a linear scale.
(c) Examine the frequency and phase response.
(d) What is the special characteristic of the system.
Code: a
b=[-.729 1.62 -1.8 1];
a=[1 -1.8 1.62 -.729]
zplane(b,a)
Page 13 of 15
Code: b
b=[-.729 1.62 -1.8 1];
a=[1 -1.8 1.62 -.729];
[H,w] = freqz(b,a,200);
magH = abs(H);
phaH = angle(H);
subplot(2,1,1);
plot(w/pi,magH);
grid
xlabel('frequency in pi units'); ylabel('Magnitude');
title('Magnitude Response')
subplot(2,1,2);
plot(w/pi,phaH/pi);
grid
xlabel('frequency in pi units'); ylabel('Phase in pi
units');
title('Phase Response')
Page 14 of 15
Statement: I Have contributed and given my full support in completing this report.
Page 15 of 15