Exp5 B2Grp3
Exp5 B2Grp3
Ritu Ann Roy George Rahul Anand Ravi Yadav Rahul Chaudhary
B170106EC B170518EC B170556EC B170912EC
B-Batch B-Batch B-Batch B-Batch
NIT Calicut NIT Calicut NIT Calicut NIT Calicut
Abstract—The aim of this experiment is to get familiarized where C is a counterclockwise closed path encircling the origin
with various MATLAB functions to analyze z-transforms, pole- and entirely in the region of convergence (ROC). In the case
zero plot and study Region of Convergence, stability of a system where the ROC is causal , this means the path C must encircle
Minimum, Maximum, and Mixed phase systems
all of the poles of X(z).
I. I NTRODUCTION Region of convergence:
In mathematics and signal processing, the Z-transform con-
The region of convergence (ROC) is the set of points in
verts a discrete-time signal which is a sequence of real or
the complex plane for which the Z-transform summation
complex numbers into a complex frequency-domain represen-
converges.
tation.
It can be considered as a discrete-time equivalent of the P∞
| n=−∞ x[n]z −n | < ∞
Laplace Transform. This similarity is explored in the theory
of time-scale calculus.
Properties of ROC of Z-Transforms:
II. THEORY
Z-transform ROC of z-transform is indicated with circle in z-plane.
ROC does not contain any poles.
The Z-transform converts a discrete-time signal which is If x(n) is a finite duration causal sequence or right sided
a sequence of real or complex numbers into a complex sequence, then the ROC is entire z-plane except at z = 0.
frequency-domain representation.It can be considered as a If x(n) is a finite duration anti-causal sequence or left sided
discrete-time equivalent of the Laplace transform. sequence, then the ROC is entire z-plane except at z = ∞
If x(n) is a infinite duration causal sequence, ROC is exterior
The bilateral or two-sided Z-transform of a discrete-time
of the circle with radius a. i.e.|z| > a.
signal x[n] is the formal power series X(Z) defined as
If x(n) is a infinite duration anti-causal sequence, ROC is
∞
X interior of the circle with radius a. i.e. |z| < a.
X(z) = Z{x[n]} = x[n]z −n If x(n) is a finite duration two sided sequence, then the ROC
n=−∞ is entire z-plane except at z = 0 and z = ∞.
where n is an integer and z is in general a complex number: Causality:
The inverse Z-transform is Let z1,z2,z3... are roots of N(z), and p1,p2,p3... those of
1
I D(z), then the z-transform can be put in the form
x[n] = Z −1 {X(z)} = X(z)z n−1 dz H(z) = N (z) G(z−z1 )(z−z2 )..(z−zL )
2πj C D(z) = (z−p1 )(z−p2 )...(z−zm )
where G is a gain factor ; z1 ,z2 ,z3 ... are the zeros which 2.Obtain the pole-zero plot of the transfer function
make X(z) go to zero; and p1 ,p2 ,p3 ...the poles which make
H(z) = 1 − 0.3z −1 − 0.2z −2
X(z) go to infinity , L is the order of numerator , M of
denominator . Plot the magnitude and phase spectrum of the same.
Distribution of poles and zeros of X(z) or H(z) in the z-plane 3.Show stable and unstable conditions for the linear time
is called pole – zero plot. invariant system h[n] = an u(n). Obtain pole-zero plot for
Minimum Phase: both conditions. Vary location of the pole, one at ROC limit,
one outside and one inside and observe the system response
A linear, time-invariant system is said to be minimum-phase over time. Discuss in detail the pole-zero plots you obtained
if the system and its inverse are causal and stable. For example, relating to stability.
a discrete-time system with rational transfer function H(z) can 4.Determine the zeros for the systems
only satisfy causality and stability requirements if all of its
poles are inside the unit circle. However, we are free to choose H1(z) = 6 + z −1 − z −2
whether the zeros of the system are inside or outside the unit andH2(z) = 1 − z −1 − 6z −2
circle. A system with rational transfer function is minimum-
, and indicate whether the system is minimum phase,
phase if all its zeros are also inside the unit circle.
maximum-phase or mixed-phase system. Explain the results
Maximum Phase:
obtained in terms of the magnitude and phase responses.
A maximum-phase system is the opposite of a minimum IV. CODES
phase system. A causal and stable LTI system is a maximum- A. Question One
phase system if its inverse is causal and unstable.That is,the
• Part a
zeros of the discrete-time system are outside the unit circle.
Mixed Phase:
clc;
close all;
A mixed-phase system has some of its zeros inside the unit
clearvars
circle and has others outside the unit circle.
num = [2 5 9 5 3];
III. QUESTIONS: den = [5 45 2 1 1];
1. a) Write a MATLAB program to compute and display TS = -1;
the poles and zeros, to compute and display the factored form H = tf(num, den, TS, ’variable’,’z− 10 )
z,p,k
and to generate the pole-zero plot of a z-transform that is a
= tf 2zpk(num, den);
ratio of two polynomials in z1. Using this program, analyze
z
the z transform
p
2 + 5z −1 + 9z −2 + 5z −3 + 3z −4 k
H(z) =
5 + 45z −1 + 2z −2 + z −3 + z −4
b) From the pole-zero plot generated in part a), determine the hnew = zpk(z, p, k, 1,0 variable0 ,0 z − 10 );
possible ROCs. Can you tell from the pole-zero plot whether pzmap(H,0 g 0 );
or not the DTFT exists? Is the Filter stable if it is causal? xlim([−1010])
c) Using zp2tf(), determine the rational form of a z transform ylim([−1010])
whose zeros are at z1 = 0.3, z2 = 2.5,z3 = 0.2 + j0.4, and z4 • Part c
= 0.2 + j0.4; the poles are at p1 = 0.5,p2 = 0.75,p3 = 0.6 + clc;
j0.7, and p4 = 0.6 + j0.7; and the gain constant k is 3.9. close all;
d) Using impz() determine the First 10 samples of the inverse clearvars
z transform of zeros = [0.3, 2.5, -0.2+0.4i, -0.2-0.4i];
z −1 zeros = zeros.’
H(z) = poles = [0.5,-0.75,0.6+0.7i,0.6-0.7i];
3 − 4z −1 + z −2
poles = poles.’
Using residuez() obtain the partial fraction expansion of num,den
X(z). From the partial fraction expansion, write down the = zp2tf(zeros, poles, 3.9);
closed form expression of the inverse z transform (assuming H = tf(num, den,1,’variable’,’z− 10 )
causal). Evaluate the First 10 samples of the closed form H
expression for x[n] using MATLAB and compare with the pzmap(H,0 o0 );
result obtained using impz(). • Part d,e
e) Using residuez() convert back the partial fraction expression clc;
for X(z) in part d) to the rational function form. close all;
clearvars
num = [0 1 0]; C. Question Three
den = [3 -4 1];
= impz(num,den,10); clc;
subplot(2,1,1) close all;
stem(t,h,’k’);
title(’Using impz’); a = 2;
ylabel(’h[n]’); num = [1 0];
xlabel(’n’); den = [1 -a];
r,p,k H1 = tf(num, den, 1, ’variable’,’z’);
= residuez(num, den); figure
r pzmap(H1,’k’);
p title(’Unstable, a = 2’);
k t = 1000;
n = 0:9; dw = 2*pi/t;
syms z w = -pi:dw:pi-dw;
f=r(1)/(1-(p(1)*(z− 1))) + r(2)/(1 − (p(2) ∗ (z − 1))) hh = freqz(num, den, w);
g = iztrans(f ) mag = abs(hh);
subplot(2, 1, 2) figure
stem(n, subs(g),0 k 0 ); subplot(2,1,1);
title(0 U singinverse0 ); plot(w, mag,’k’);
ylabel(0 h[n]0 ); title(’Magnitude Spectrum’);
xlabel(0 n0 ); xlabel(’freq(Hz)’);
= residuez(r,p,k); ylabel(’amplitude’);
phase = angle(hh);
H= tf(a, b, 1, ’variable’, ’z− 10 ); subplot(2,1,2);
H plot(w, phase,’k’);
title(’Phase Spectrum’);
xlabel(’freq(Hz)’);
B. Question Two ylabel(’phase’);
a = .5;
clc; num = [1 0];
close all; den = [1 -a];
clearvars H2 = tf(num, den, 1, ’variable’,’z’);
num = [1 -0.3 -0.2]; figure
den = [1]; pzmap(H2,’k’);
H = tf(num, den, 1, ’variable’,’z− 10 ); title(’stable, a = .5’);
f igure t = 1000;
pzmap(H,0 k 0 ); dw = 2*pi/t;
w = -pi:dw:pi-dw;
t = 1000; hh = freqz(num, den, w);
dw = 2 ∗ pi/t; mag = abs(hh);
w = −pi : dw : pi; figure
hh = f reqz(num, den, w); subplot(2,1,1);
mag = abs(hh); plot(w, mag,’k’);
f igure title(’Magnitude Spectrum’);
subplot(2, 1, 1); xlabel(’freq(Hz)’);
plot(w, mag,0 k 0 ); ylabel(’amplitude’);
title(0 M agnitudeSpectrum0 ); phase = angle(hh);
xlabel(0 f req(Hz)0 ); subplot(2,1,2);
ylabel(0 amplitude0 ); plot(w, phase,’k’);
phase = angle(hh); title(’Phase Spectrum’);
subplot(2, 1, 2); xlabel(’freq(Hz)’);
plot(w, phase,0 k 0 ); ylabel(’phase’);
title(0 P haseSpectrum0 ); a = 1;
xlabel(0 f req(Hz)0 ); num = [1 0];
ylabel(0 phase0 ); den = [1 -a];
H3 = tf(num, den, 1, ’variable’,’z’); mag = abs(hh);
figure subplot(2, 2, 2);
pzmap(H3,’k’); plot(w, mag,0 k 0 );
title(’critically stable, a = 1’); title(0 H2M agnitudeSpectrum0 );
t = 1000; xlabel(0 f req(Hz)0 );
dw = 2*pi/t; ylabel(0 amplitude0 );
w = -pi:dw:pi-dw; phase = angle(hh);
hh = freqz(num, den, w); subplot(2, 2, 4);
mag = abs(hh); plot(w, phase,0 k 0 );
figure title(0 H2P haseSpectrum0 );
subplot(2,1,1); xlabel(0 f req(Hz)0 );
plot(w, mag,’k’); ylabel(0 phase0 );
title(’Magnitude Spectrum’); pzmap(H1,0 k 0 );
xlabel(’freq(Hz)’); title(0 pole − zeroplotof H1, M inP haseSystem0 );
ylabel(’amplitude’); f igure
phase = angle(hh); pzmap(H2,0 k 0 );
subplot(2,1,2); title(0 pole − zeroplotof H2, M axP haseSystem0 );
plot(w, phase,’k’);
V. OUTPUT FIGURES
title(’Phase Spectrum’);
xlabel(’freq(Hz)’); A. Question 1
ylabel(’phase’);
D. Question Four
clc;
close all;
num = [6 1 -1];
den = [1];
H1 = tf(num, den, 1, ’variable’,’z− 10 );
z1,p1,k
= tf 2zpk(num, den);
t = 1000;
dw = 2 ∗ pi/t;
w = −pi : dw : pi − dw;
hh = f reqz(num, den, w);
mag = abs(hh);
subplot(2, 2, 1);
plot(w, mag,0 k 0 );
title(0 H1M agnitudeSpectrum0 );
Fig. 1. Pole Zero Plot
xlabel(0 f req(Hz)0 );
ylabel(0 amplitude0 );
phase = angle(hh);
subplot(2, 2, 3);
plot(w, phase,0 k 0 );
title(0 H1P haseSpectrum0 );
xlabel(0 f req(Hz)0 );
ylabel(0 phase0 );
num = [1 − 1 − 6];
den = [1];
H2 = tf (num, den, 1,0 variable0 ,0 z − 10 );
z2,p2,k
= tf 2zpk(num, den);
t = 1000;
dw = 2 ∗ pi/t;
w = −pi : dw : pi − dw;
hh = f reqz(num, den, w);
Fig. 4. Inverse Z Transform h[n]