You are on page 1of 6

Lab Report | 1

M RAFAY TARIQ
FA18-BEE-100
BEE-A

Lab Report 13
To Reproduce the Properties of Z-Transform Using MATLAB Functions.
Objective
The main objective is to make student familiar to Z-transformation and the properties of Z-
Transform.

Required Equipment:
Hardware
 No hardware was used to perform this lab.

Software
MATLAB software is used to perform this lab.

Procedure/ Methodology
 Before starting this lab we were guided by our lab instructor through video lecture.
 To Reproduce the Properties of Z-Transform Using MATLAB Functions.
 Before performing the in lab task we studied pre lab section.
 In pre lab section we studied different properties of z transform.
 The properties were Linearity, Right Shift, Right Shift 2, Left Shift, Scaling in the Z-
Domain, Time Reversal, Differentiation in the Z-Domain, Summation Convolution
in the time domain.
 And then we performed our lab tasks.

Results and Conclusion


 This lab helped the students to familiarize with the properties of Z-Transform.
 These properties are very crucial when using the table of transforms to find the transform
of a more complicated signal.
 We also studied the properties and observed there graphs.
 Pre lab tasks, In Lab tasks and properties are written below.
Lab Report | 1

Lab Tasks
Properties
Linearity:
syms n z
x1=n^2;
x2=2^n;
a1=3;
a2=4;
L=a1*x1+a2*x2;
Left=ztrans(L, z)
X1=ztrans(x1, z);
X2=ztrans(x2, z);
Right=a1*X1+a2*X2

Result:
Left =
(4*z)/(z - 2) + (3*z*(z + 1))/(z - 1)^3
Right =
(4*z)/(z - 2) + (3*z*(z + 1))/(z - 1)^3

Right Shift:
syms n z m=2; x1=3^(n-
m)*heaviside(n-m);
Left=simplify(ztrans(x1,z)
) x=3^n*heaviside(n);
X=ztrans(x, z);
Right=simplify((z^(-m))*X)

Result:
Left =
(3/(z - 3) + 1/2)/z^2
Right =
(3/(z - 3) + 1/2)/z^2

Right Shift 2:
n=-3:3; x=0.8.^n;
xminus1=x(3);
xminus2=x(2);
xminus3=x(1);
syms z n
xn2=0.8^(n-2);
Left=simplify(ztrans(xn2,z))
x=0.8.^n;
X=ztrans(x,z);
Right=simplify((z^-2)*X+xminus2+(z^-1)*xminus1)
Result:
Left = (25*z)/(16*(z - 4/5))
Right = (125*z)/(16*(5*z - 4))

Left Shift:
x0=0.8^(0);
x1=0.8^(1);
Lab Report | 1

syms n z
xn2=0.8^(n+2);
Left=simplify(ztrans(xn2,z))
x=0.8^n;
X=ztrans(x,z);
Right=simplify((z^2)*X-(z^2)*x0-x1*z)
Result:
Left = (16*z)/(25*(z - 4/5))
Right = (16*z)/(5*(5*z - 4))

Scaling in the Z-Domain:

syms n z a w0 x=4^n; X=ztrans(x,z);


%case 1
Right=subs(X,z,a*z)
L=a^(-n)*x;
Left=simplify(ztrans(L,z))
%case 2
Right=simplify(subs(x,z,z/a))
L=a^n*x;
Left=simplify(ztrans(L,z))
%case 3
Right=subs(X,z,exp(-j*w0)*z);
L=exp(j*w0*n)*x;
Left=simplify(ztrans(L,z)); error=simplify(Left-Right)
Result:
Right = (a*z)/(a*z - 4)
Left = (a*z)/(a*z - 4)
Right = 2^(2*n) Left = -z/(4*a - z) error = 0

Time Reversal:

syms z x=[1 2 3 4];


n=[0 1 2 3];
X=sum(x.*(z.^-n));
Right=subs(X,z,z^-1)
nrev=[-3 -2 -1 0];
xrev=[4 3 2 1];
Left=sum(xrev.*(z.^nrev))
Result:
Right =
4*z^3 + 3*z^2 + 2*z + 1
Left =
2/z + 3/z^2 + 4/z^3 + 1

Differentiation in the Z-Domain:

syms n z x=0.9^n;
Left=ztrans(n*x,z)
X=ztrans(x,z);
d=diff(X,z);
Right=simplify(-z*d)
Result:
Lab Report | 1

Left =
(90*z)/(10*z - 9)^2
Right =
(90*z)/(10*z - 9)^2

Summation:
syms n z x=n^2;
s=symsum(x,n,0,n);
Left=simplify(ztrans(s,z))
X=ztrans(x,z);
Right=(z/(z-1))*X
Result:
Left =
(z^2*(z + 1))/(z - 1)^4
Right =
(z^2*(z + 1))/(z - 1)^4

Convolution in the time domain:


n=0:50;
x1=0.9.^n;
x2=0.8.^n;
y=conv(x1,x2);
subplot (121)
stem(0:100,y)
legend('Convolution');
syms n z x1=0.9.^n
x2=0.8.^n;
X1=ztrans(x1,z);
X2=ztrans(x2,z);
Right=iztrans(X1*X2);
n=0:100;
Right=subs(Right,n);
subplot(122)
stem(0:100,Right)
legend('Z^-^1[X_1(z)*X_2(z)]')
Lab Report | 1

Pre Task 1

Solution
%mrafaytariq
%fa18-bee-100
%bee_a
%prelab task
%mrafaytariq
%fa18-bee-100
%bee_a
%prelab task
clear all;
close all;
syms z n
x1_z=z/(z-0.9);
x2_z= ((2.*z)+3)./((z.^2)+(5.*z)+6);
convolution= x1_z*x2_z
Timedom=iztrans(convolution)
r=-100:200
s=subs(Timedom,r)
stem(r,s)

Lab Task 1

Solution
%mrafaytariq
%fa18-bee-100
%bee_a
%lab13task1
clc;
clear all;
close all;
syms z n
x1_z=z./(z-0.9)
x2_z=(z)./(z+6)
convolution=x1_z*x2_z
Timedom=iztrans(convolution)
Lab Report | 1

You might also like