Lab Report#5: Digital Signal Processing EEE-324
Lab Report#5: Digital Signal Processing EEE-324
Lab report#5
Class BEE-6A
Objective
By the end of this lab students will be able to:
Become familiar with the computation of the z-transform of various signals and with the
determination of ROC.
Learn and understand the properties of the z-transform and how these properties can be
used to simplify computations.
Learn the process of inverting the z-transform by using method of partial fraction
expansion.
Understand how LTI systems are represented in the z-domain and the relationship to the
frequency response.
Learn how to solve difference equations that describe LTI systems with initial conditions.
Understand the difference between bilateral and unilateral z-transform.
Pre-Lab
The z-Transform for the discr0.
ete time signals is the counter part of Laplace transform for continuous time signals and they each
have similar relationship to the corresponding Fourier transform.
One motivation for introducing this generalization is that the Fourier transform does not converge
for all sequences and it is useful to have a generalization of the Fourier transform that encompasses
a broad class of signals.
Also we will see in this lab session that how we can calculate the inverse z-transform analytically
and by using one of the simple command of Matlab.(Particularly to solve partial expansion).
1. Region of convergence
The region of convergence, known as the ROC, is important to understand because it defines the
region where the z-transform exists. For a given sequence, the set of values of z for which the z-
transform converges is called the Region of Convergence (ROC). The ROC for a given x[n], is
defined as the range of z for which the z-transform converges. Since the z-transform is a power
series, it converges when x[n] z−n is absolutely summable. Further, the convergence is dependent
only on the magnitude of z i.e |z|. Thus, if z = z1 is in the ROC, then all values of z on the circle
defined by |z| = |z1| will also be in the ROC. As a result, the ROC will consist of a ring in the z-
plane centered about the origin. The ROC might extend outward to ∞ or inward to origin depending
on the sequence.
Lab # 05 Z-Transform and Inverse Z-Transform
2. Pole-Zero Plot
Pole-Zero plot is an important tool, which helps us to relate the Frequency domain and Z-domain
representation of a system. A plot of Pole and Zeros of a system on the z-plane is called a Pole-
Zero plot. Usually, a Zero is represented by a 'o'(small-circle) and a pole by a 'x'(cross). Since
H(z) evaluated on the unit-circle gives the frequency response of a system, it is also shown for
reference in a pole-zero plot. It also helps in determining stability of a system, given its transfer
function H(z).
In-Lab Task:
1. Some Useful MATLAB Commands
freqz: can be used to plot the magnitude and phase of system response. Also it is used to find
Frequency response of any system. The function freqz(b,a,w) returns the frequency response
at frequencies designated in vector W, in radians/sample (normally between 0 and pi).
Examples:
1. The Freqz function computes and display the frequency response of given Z- Transform
of the function
freqz(b,a,Fs)
b= Coeff. Of Numerator
a= Coeff. Of Denominator
Matlab Code:
b=[2 5 9 5 3]
a= [5 45 2 1 1]
freqz(b,a);
2. Plot the magnitude and phase of the frequency response of the given digital filter
Using freqz function:
H=freqz(b,a,w);
magH = abs(H);
Lab # 05 Z-Transform and Inverse Z-Transform
phaH = angle(H)*180/pi;
subplot(2,1,1);
plot(w/pi,magH);
title('Magnitude Response');
xlabel('frequency in pi units');
ylabel('│H│');
subplot(2,1,2);
plot(w/pi,phaH);
title('Phase Response');
xlabel('frequency in pi units');
ylabel('Degrees');
zplane: This function plots zeros and poles of discrete time systems.
zplane(b,a)
[hz,hp,ht] = zplane(z,p)
o zplane(b,a) where b and a are row vectors, first uses roots to find the
zeros and poles of the transfer function represented by numerator coefficients b
and denominator coefficients a.
o [hz,hp,ht] = zplane(z,p) returns vectors of handles to the zero lines, hz, and
the pole lines, hp. ht is a vector of handles to the axes/unit circle line and to text
objects, which are present when there are multiple zeros or poles.
Example:
Matlab Code:
b=[0 1 1 ]
a= [1 -2 +3]
roots(a)
roots(b)
zplane(b,a);
Lab # 05 Z-Transform and Inverse Z-Transform
residuez: It can be used to develop the partial-fraction expansion of a rational z-transform and
to convert a z-transform expressed in a partial-fraction form to its rational form. [r,p,k] =
residuez(b,a) finds the residues, poles and direct terms of the partial-fraction expansion of
B(z)/A(z). ‘b’ and ‘a’ are the numerator and denominator polynomial coefficients,
respectively, in ascending powers of z^(-1). R and P are column vectors containing the
residues and poles, respectively. K contains the direct terms in a row vector. The number of
poles is
[r,p,k] = residuez(b,a)
[b,a] = residuez(r,p,k)
Example:
MATLAB Code:
b = [0,0,1];
Result:
R = 4,0,-4
P = -1,-0.5,-0.5
K=[]
tf2zp: This function is used to find poles and zeros of a rational z-transform expressed as ratios
of polynomials in descending powers of z.
impz: The inverse of a rational z-transform can be readily calculated using this function.
filter: This command can also be used for calculating inverse of z-transform.
sptool: Signal Processing Tool - Graphical User Interface. sptool opens the sptool window
which allows you to import, analyze, and manipulate signals, filters, and spectra.
Lab # 05 Z-Transform and Inverse Z-Transform
Lab Tasks
Task-1: Using MATLAB we determine the partial-fraction expansion of the z-transform X(z)
given by
18z3
X(z) =
18z3 + 3z2 – 4z -1
Code:
roots(a)
roots(b)
zplane(b,a);
[R,P,K] = residuez(b,a);
Figure:
Lab # 05 Z-Transform and Inverse Z-Transform
1- 2z-1
H(z) =
(1-0.2z-1)(1+0.6z-1)
Code:
[R,P,K]= residuez(b,a)
Figure:
Lab # 05 Z-Transform and Inverse Z-Transform
Task-3: Determine the Inverse z-transform of the following sequences, using partial fraction
expansion method.
Code:
a =[ 1 -2.75 1.625 -0.25]
b =[1 -1 -4 4]
[R,P,K] = residuez(b,a)
[x,y] = impz(b,a)
stem(y,x)
Figure:
Lab # 05 Z-Transform and Inverse Z-Transform
Code:
clc
clear all
close all
b = [1 1];
a= [1, -0.9, +0.68];
w_freq = [0:1:500]*pi/500;
H=freqz(b,a,w_freq);
magH = abs(H);
phaH = angle(H)*180/pi;
subplot(2,1,1);
plot(w_freq/pi,magH, 'k');
title('Magnitude Response');
ylabel('H');
subplot(2,1,2);
plot(w_freq/pi,phaH, 'k');
title('Phase Response');
ylabel('Degrees');
Figure:
Lab # 05 Z-Transform and Inverse Z-Transform
In this lab we had learnt that the Z-Transform and the Inverse Z-
Transform. The commands that we implemented are freqz, zplane,
residue, impz and filter command. We learnt to compute both of
these in MATLAB. We determined the ROC and used the partial
fraction expansion method to compute the inverse Z- transform.
Lab Assessment
Pre Lab /5
Performance /5
Results /5 /25
Viva /5
Critical Analysis /5