Digital Control System NUST EME Lab Solution
Digital Control System NUST EME Lab Solution
Lab #3 Report
Objective:
• To realize the significance of z-transform.
• To determine the z-transform and inverse z-transform of discrete time signal and systems in
MATLAB.
Significance of 𝒛−𝒏:
Where z is a complex variable. The relation sometimes called the direct z-transform because it
transforms the time-domain signal x(n) into its complex-plane representation X(z).
Where,
‘r’ is a real number.
𝑒𝑗𝜔 is Euler's Number
𝜔 is the angular frequency in radians per samples.
Lab Tasks:
1. Find Z-transform and inverse Z-transform of some DT signals.
1. For sin(ꞷ*n):
MATLAB Code:
syms z n w
fn = sin(w*n)
F1 = ztrans(fn,z)
f1 = iztrans(F2)
MATLAB Output:
fn =
sin(n*w)
F1 =
(z*sin(w))/(z^2 - 2*cos(w)*z + 1)
f1 =
sin(n*w)
2. For cos(ω*n):
MATLAB Code:
syms z n w
fn = cos(w*n)
F1 = ztrans(fn,z)
f1 = iztrans(F2)
MATLAB Output:
fn =
cos(n*w)
F1 =
cos(n*w)
3. For a^n:
MATLAB Code:
syms a n z
fn = a^n;
F1 = symsum(fn.*(z.^-n),n,0,inf)
F2 = ztrans(fn,z)
f1 = simplify(iztrans(F2))
MATLAB Output:
fn =
a^n
F1 =
F2 =
-z/(a - z)
f1 =
4. For (1/2)^n:
MATLAB Code:
syms n z
fn = (1/2)^n;
F1 = simplify(symsum(fn.*(z.^-n),n,0,inf))
F2 = ztrans(fn,z)
f1 = simplify(iztrans(F2))
MATLAB Output:
fn =
(1/2)^n
F1 =
F2 =
z/(z - 1/2)
f1 =
1/2^n
2. Define some DT systems and draw pole-zero plot of the systems. Also find impulse response
of the systems.
DT System 1:
MATLAB Code:
%% DT System 1
num = [1 2 0];
den = [1 0 0.2];
sys = tf(num,den,0.1)
[z,p,k] = tf2zpk(num,den)
zplane(num,den)
impz(num,den)
MATLAB Output:
sys =
z^2 + 2 z
---------
z^2 + 0.2
-2
p =
0.0000 + 0.4472i
0.0000 - 0.4472i
k =
DT System 2:
MATLAB Code:
%% DT System 2
num = [1 0];
den = [1 -0.707 0.2499];
sys = tf(num,den,0.1)
[z,p,k] = tf2zpk(num,den)
zplane(num,den)
impz(num,den)
MATLAB Output:
sys =
----------------------
p =
0.3535 + 0.3535i
0.3535 - 0.3535i
k =
DT System 3:
MATLAB Code:
%% DT System 3
num = [1 4 0];
den = [1 5 9];
sys = tf(num,den,0.1)
[z,p,k] = tf2zpk(num,den)
zplane(num,den)
impz(num,den)
MATLAB Output:
sys =
z^2 + 4 z
-------------
z^2 + 5 z + 9
-4
p =
-2.5000 + 1.6583i
-2.5000 - 1.6583i
k =