Group-9(119 150 153) lab6

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Submitted by: Faiq Jhanzaib

Reg no. FA20-BEE-048


Class: BEE-6B
Subject: Digital Signal Processing (EEE 324)
Instructor: Dr. Mubeen Sabir
Lab # 6
Z-Transform and Inverse Z-Transform
Objectives:
By the end of this lab students will be able to:
1. Become familiar with the computation of the z-transform of various signals and with the
determination of ROC.
2. Learn and understand the properties of the z-transform and how these properties can be
used to simplify computations.
3. Learn the process of inverting the z-transform by using method of partial fraction expansion.
4. Understand how LTI systems are represented in the z-domain and the relationship to the
frequency response.
5. Learn how to solve difference equations that describe LTI systems with initial conditions.
6. Understand the difference between bilateral and unilateral z-transform.

In Lab:
Task 1:
Using MATLAB we determine the partial-fraction expansion of the z-transform X(z) given by
18𝑧3
𝑋 ( 𝑧) =
18𝑧3 + 3𝑧2 − 4𝑧 − 1

Sol:
Code:
syms z
num = [18 0 0 0]
den = [18 3 -4 -1]
[r,p,k] = residuez(num,den)
x =
((r(1)*z)/(z+p(1)))+((r(2)*z)/(z+p(2)))+((r(3)*z)/(z+p(3)))
x = vpa(x)
disp('Partial fraction:')
pretty(x)
Result:

Task 2:
Determine the inverse z-transform of the 11 terms of following equation
1 − 2𝑧−1
𝐻(𝑧) =
(1 − 0.2𝑧−1)(1 + 0.6𝑧−1)

Sol:
Code:
syms z
l = 11;
num = [1 -2 0];
den = [1 0.4 -0.12];
[x,n] = impz(num,den,l)
stem(n,x,'linewidth',2)
xlabel('n')
ylabel('Amplitude')
title('Inverse z transform')
grid on
Plot:

Task 3:
Determine the Inverse z-transform of the following sequences, using partial fraction expansion
method.
1 − 𝑧−1 − 4𝑧−2 + 4𝑧−3
𝑥 ( 𝑧) =
1 − 2.75𝑧−1 + 1.625𝑧−2 + 0.25𝑧−3

Sol:
Code:
syms z
num = [1 -1 -4 4];
den = [1 -2.75 1.625 -0.25];
[r,p,k] = residuez(num,den)
x =
((r(1)*z)/(z+p(1)))+((r(2)*z)/(z+p(2)))+((r(3)*z)/(z+p(3)))
x = vpa(x)
disp('Partial fraction:')
pretty(x)
X = iztrans(x)
[num,den] = residuez(R,P,K)
X = vpa(X)
disp('Inverse z Transform:')
pretty(X)
Results:

Task 4:
A digital filter is described by the difference equation,
𝑌(𝑛) = 𝑥(𝑛) + 𝑥(𝑛 − 1) + 0.9𝑦(𝑛 − 1) − 0.81𝑦(𝑛 − 2)
Using the freqz function, plot the magnitude and phase of the frequency response of the filter.

Sol:
Code:
num = [1 1];
den = [1 -0.9 0.81];
fs = [0:1:500]*pi/500;
H=freqz(num,den,fs);
magH = abs(H);
phaH = angle(H)*180/pi;
subplot(2,1,1);
plot(fs/pi,magH,'LineWidth',3);
title('Magnitude');
xlabel('Frequency ');
ylabel('Magnitude of H');
grid on
subplot(2,1,2);
plot(fs/pi,phaH,'LineWidth',3);
title('Phase');
xlabel('Frequency');
ylabel('Degrees');
grid on
Plot:

Post Lab:
Conclusion/Critical Analysis:
In this lab we learned about Z-Transform and Inverse Z-Transform. The z transform is for the
discrete time signals as counter part of laplace transform for continuous time signals. In this lab
we learned about different commands of MATLAB that is used to compute frequency response,
plot zeros and poles etc. In this lab we perform four lab tasks:
In first task we determine the partial fraction of a given z transform. In second and third task we
perform inverse z transform of a given function and in last task we plot magnitude and phase of
the frequency response of the given filter.
With these tools and techniques at our disposal, we are now able to perform z and inverse z
transform. These skills are essential for many applications in signal processing, and can help us
to extract valuable information from complex datasets.

You might also like