You are on page 1of 1

University of Engineering and Technology Lahore

Department of Mechatronics and Control Engineering

LAB: Z-Transform based Solution to Difference Equation

OBJECTIVE:
 To become familiar inverse Z-Transform through partial fraction.

TASK:
 Make partial fraction of given z-transform function. Take individual partial fraction, take its inverse
z-transform and plot on real time axis.

COMMANDS:
residuez, iztrans, subs,double

Comments:

________________________________________________________________________________________________________________________________

________________________________________________________________________________________________________________________________

________________________________________________________________________________________________________________________________

MATLAB code

Code:

clc,clear,close 10
x 10 10
22 x 10
syms z n
num=[1 0]; 11

den=[1 7 10]; 00

[r,p,k]=residuez(num,den); -1
-1

-2
x_val = 0; -2

-3
-3

for i = 1:length(r) -4
-4

ith_PF = r(i)/(1-p(i)*z^-1); -5
-5

i_inz = iztrans(ith_PF,z,n); -6
-60 55 10 15
i_val = double(subs(i_inz,n,[1:15])); 0 10 15

x_val = x_val + i_val;

end
plot([1:15],x_val)

MCT 413 : Discrete Signal Processing


Department of Mechatronics and Control Engineering, U.E.T. Lahore

You might also like