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

Lab 4-2

The document outlines a lab exercise on Z-Transform for a Digital Signal Processing course at Canadian International College. It includes objectives, significance, MATLAB code examples for calculating Z-transforms and inverse Z-transforms, and tasks for students to complete. Additionally, it provides exercises for finding Z-transforms, inverse Z-transforms, and convolution of functions.

Uploaded by

Diaa Abossrie
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Lab 4-2

The document outlines a lab exercise on Z-Transform for a Digital Signal Processing course at Canadian International College. It includes objectives, significance, MATLAB code examples for calculating Z-transforms and inverse Z-transforms, and tasks for students to complete. Additionally, it provides exercises for finding Z-transforms, inverse Z-transforms, and convolution of functions.

Uploaded by

Diaa Abossrie
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Canadian International College

Engineering School

Department of Electronics and Communication Engineering

Course Code ELE 471


Course Title Digital Signal Processing
Semester/Year Spring 21/22

Lab 4

Lab Title Z-Transform


Z-Transform
Objectives:
• To realize the significance of z-transform
• To determine the z-transform and inverse z-transform of discrete time signal
and systems in MATLAB
• To find the pole-zero plot of DT system.

Significance of 𝒛−𝒏
The z-transform of a discrete-time signal x(n) is defined as the power series

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

𝑧 = 𝑟𝑒 𝑗𝑤

𝑧 −𝑛 = 𝑟 −𝑛 𝑒 −𝑗𝑤𝑛

𝑧 −𝑛 = 𝑟 −𝑛 (cos(𝑤𝑛) − 𝑗𝑠𝑖𝑛(𝑤𝑛)

Where:

r: real number

𝑒 𝑗𝑤 : Euler’s number

𝑤 : angular frequency in radians/samples


MATLAB Code:
n=0:.1:100;
r=1.1;
w=pi/4;
y1=r.^(-n);
y2=cos(w*n);
y=y1.*y2;
subplot(3,1,1);
plot(n,y1);
xlabel('Sample No');
ylabel('amplitude');
title('r^-^n when r>1');
subplot(3,1,2);
plot(n,y2);
xlabel('Sample No');
ylabel('amplitude');
title('cos(wt) when w=pi/4');
subplot(3,1,3);
plot(n,y);
xlabel(' ');
ylabel('amplitude');
title('Real part of z^-^n= r^-^n *cos(wn)');
When,

r>1, 𝒛−𝒏 has exponentially decreasing oscillation

r<1, 𝒛−𝒏 has exponentially increasing oscillation

r=1, 𝒛−𝒏 has oscillation of constant amplitude.

So, we can say

𝒛−𝒏 represents a set of oscillating components of constant or increasing or


decreasing amplitude based on value of z
Finding z-transform of a Sequence
Lab Task:

Find z-transform of x[n] = [ 1 3 5 8 4 ]

Code:
syms z
x = [1 3 5 8 4];
m = length(x);
X=0;

for i=0:m-1
X = X + x(i+1)*z^(-i);
end
disp(X)

Lab Task:

Find z-transform of x[n] = [ 1 3 5 8 4 ]

Code:
syms z
x = input('Enter the sequence x(n): ');
n1 = input('Enter the start value of n: ');
n2 = n1+length(x)-1;
m = 1;
result = 0;
for i=n1:n2
result = result + x(m)*(z^(-i));
m = m + 1;
end
disp(result);
Finding z-transform of a function
Lab Task
Find z-transform of 𝑎𝑛 .
Code
syms n z a
f = a^n;
m=ztrans(f,z)

Lab Task
Find z-transform of sin(wn).
Code
syms w z n
f = sin(w*n);
m=ztrans(f,z)

Lab Task
1
Find z-transform of .
4𝑛
Code
syms z n
f = 1/4^n;
m = ztrans(f,n,z)
pretty(m)

Finding inverse z-transform of a function


Lab Task
2𝑧
Find inverse z-transform of .
2𝑧−1
Code
syms z n
f=2*z/(2*z-1);
m = iztrans(f)
pretty(m)
Z-Plane
Lab Task
1
Plot z-plane of 4^𝑛
code
syms n z a
f = 1/4^n;
m=ztrans(f,z);
[nem, den] = numden(m)
a = double (coeffs(nem))
b = double (coeffs(den))

zplane(a,b);
EXERCISES:

A) Find Z transform of the following:


1- x[n] = [ 1 3 2 5 9 4 2 ]

2- y[n] = u[n-2]

1 𝑛
3- ( ) 𝑢[𝑛 − 1]
4
Solution
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
B) Find the inverse z transform of the following

Solution
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
C) Find convolution of the following functions by means of Z transform:
1 𝑛
𝒙[𝒏]=2𝑛 𝒖[−𝒏+𝟏] , 𝒉[𝒏]=( ) 𝒖[𝒏−𝟐]
3

---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------

You might also like