Lab 4
Lab 4
system analysis.
The z-transform is a useful tool in the analysis of discrete-time signals and systems and is the discrete-
time counterpart of the Laplace transform for continuous-time signals and systems. The z-transform may
be used to solve constant coefficient difference equations, evaluate the response of a linear time-invariant
system to a given input, and design linear filters. In this lab, we will look at the z-transform and examine
how it may be used to solve a variety of different problems.
Background Review
R 5.1 In previous lab, we saw that the discrete-time Fourier transform (DTFT) of a sequence x[n] is
equal to
However in order for this series to converge, it is necessary that the signal be absolutely summable.
Unfortunately, many of the signals that we would like to consider are not absolutely summable and,
therefore, do not have a DTFT. Some examples include
R 5.2 The z-transform is a generalization of the DTFT that allows one to deal with such sequences. The z-
transform G(z) of a sequence g[n] is defined as
and we see that X(z) is the discrete-time Fourier transform of the sequence r -n x[n]. Furthermore, the ROC
is determined by the range of values of r for which
1
R 5.4 In the case of LTI discrete-time systems, all pertinent z-transforms are rational functions of z−1, that
is, they are ratios of two polynomials in z−1:
The roots of the numerator polynomial, ξr, are referred to as the zeros of X(z), and the roots of the
denominator polynomial, λs, are referred to as the poles. There are additional N − M zeros at z=0 (the
origin in the z-plane) if N>M or additional M − N poles at z=0 if N<M.
R 5.5 For a sequence with a rational z-transform, the ROC of the z-transform cannot contain any poles and
is bounded by the poles.
R 5.6 A rational z-transform G(z)= P(z) /D(z) , where the degree of the polynomial P(z) is M and the
degree of the polynomial D(z) is N, and with distinct poles at z=λs,s=1 ,2 ,...,N, can be expressed in a
partial-fraction expansion form given by
2
abs angle conj exp imag real
3
Two-Dimensional Graphics
axis grid legend plot stem title
xlabel ylabel
General Purpose Graphics Functions
clf subplot
Signal Processing Toolbox
freqz impz tf2zp zplane
For additional information on these commands, type help command in the Command window.
Exercise 5.1 Analysis of z-Transforms:
The function freqz can be used to evaluate the values of a rational z-transform on the unit circle. To do this,
Program P6_1 (it’s rewritten below) can be used without any modifications.
% Program P6_1
% Evaluation of the DTFT
clf;
% Compute the frequency samples of the DTFT
w = -4*pi:8*pi/511:4*pi;
num = [2 1];den = [1 -0.6];
h = freqz(num, den, w);
% Plot the DTFT
subplot(2,1,1)
plot(w/pi,real(h));grid
title('Real part of H(e^{j\omega})')
xlabel('\omega /\pi');
ylabel('Amplitude');
subplot(2,1,2)
plot(w/pi,imag(h));grid
title('Imaginary part of H(e^{j\
omega})') xlabel('\omega /\pi');
ylabel('Amplitude');
pause
subplot(2,1,1)
plot(w/pi,abs(h));grid
4
title('Magnitude Spectrum |H(e^{j\omega})|')
xlabel('\omega /\pi');
ylabel('Amplitude');
subplot(2,1,2)
plot(w/pi,angle(h));grid
title('Phase Spectrum arg[H(e^{j\omega})]')
xlabel('\omega /\pi');
ylabel('Phase in radians');
Questions:
Q 5.1 Using Program P6_1 evaluate the following z-transform on the unit circle:
5
where the Lth row contains the coefficients of the numerator and the denominator of the Lth second order
factor of the z-transform G z :
Q 5.2 Write a MATLAB program to compute and display the poles and zeros, to compute and display the
factored form, and to generate the pole-zero plot of a z-transform that is a ratio of two polynomials in z−1.
Using this program, analyze
Q 5.3 From the pole-zero plot generated in Question Q 5.2, determine the number of regions of
convergence (ROC) of G(z) . Show explicitly all possible ROCs. Can you tell from the pole-zero plot
whether or not the DTFT exists?
Q 5.4 Write a MATLAB program to compute and display the rational z-transform from its zeros, poles
and gain constant. Using this program, determine the rational form of a z-transform whose zeros are at
ξ1=0.3
,ξ2=2.5 ,ξ3=-0.2+j 0.4 and ξ4= −0.2-j 0.4 ;the poles are at λ1=0.5 ,λ2=-0.75,λ3=0.6+j 0.5, and λ4=0.6-j 0.7;
and the gain constant k is 3.9.
Exercise 5.2 Inverse z-Transform
The function [g,t]=impz(num,den,L) provides the samples of the time-domain sequence, which is assumed
to be causal. Where num and den are row vectors containing the coefficients of the numerator and
denominator polynomials of G(z) in ascending powers of z−1, L is the desired number of the samples of
the inverse transform, g is the vector containing the samples of the inverse transform starting with the
sample at n=0 & t is the length of g.
Questions:
Q 5.5 Write a MATLAB program to compute the first L samples of the inverse of a rational z-transform
where the value of L is provided by the user through the command input. Using this program compute and
plot the first 50 samples of the inverse of
6
Partial Fraction Representation
[r,p,k] = residuez(num,dem) converts a discrete time system, expressed as the ratio of two polynomials, to
partial fraction expansion
𝑟1 𝑟2 𝑟𝑛
( 𝑧) = + + …………………+ +𝑘
−1 −1 −1
1 − 𝑝1𝑧 1 − 𝑝2 𝑧 1 − 𝑝𝑛𝑧
Q5.6 Write a MATLAB program to determine the partial-fraction expansion of a rational z-transform. Using
this program determine the partial-fraction expansion of