NMK31003 Lab 3 - Sem 1 2023 - 24
NMK31003 Lab 3 - Sem 1 2023 - 24
NMK31003 Lab 3 - Sem 1 2023 - 24
LAB 3:
TRANSFORM-DOMAIN REPRESENTATION OF
SIGNALS AND SYSTEMS
[Z-TRANSFORM]
1
OBJECTIVES:
(a) To use MATLAB software in z-transform domain representation of signals and systems.
(b) To gain the ability in deploying MATLAB built-in functions for discrete z-transform
operations e.g., tf2zp, zp2tf, zp2sos, zplane, and residuez.
Generally, z-transform is a fundamental tool in DSP for the analysis of linear-time invariant
(LTI) systems. It plays especially very significant role in digital filter design. Hence, it
becomes vitally important to understand its use and draw conclusions about LTI systems
using z-transform analysis.
The z-transform converts a sequence, {x[n]}, into a function, X(z), of an arbitrary complex-
valued variable z. Why do it?
Complex functions are easier to manipulate than sequences.
Useful operations on sequences correspond to simple operations on the z-transform:
o Addition, multiplication, scalar multiplication, time-shift, convolution
Definition:
+∞
X ( z )= ∑ x [n] z−n (1)
n=−∞
The poles and zeros of a system can be found by applying MATLAB function roots to the
denominator and numerator polynomials of its system function H(z). The arguments to the
function roots are the coefficients of the respective polynomial in the ascending powers of z-1.
The set of z for which X(z) converges is its region of convergence (ROC).
Complex analysis ⇒: the ROC of a power series (if it exists at all) is always an annular
region of the form 0 ≤ Rmin < |z| < Rmax ≤ ∞.
X(z) will always converge absolutely inside the ROC and may converge on some, all, or none
of the boundary.
+∞
“converge absolutely” ⇔ ∑ |x [ n ] z |<∞
−n
n=−∞
Finite ⇔ Rmin = 0, Rmax = ∞
o ROC may include either, both or none of 0 and ∞
Absolutely summable ⇔ X(z) converges for |z| = 1.
Right-sided ⇔ Rmax = ∞
o Causal ⇔ X(∞) converges
Left-sided ⇔ Rmin = 0
o Anticausal ⇔ X(0) converges
2
Most z-transforms that we will meet are rational polynomials with real coefficients, usually
one polynomial in z−1 divided by another.
M −1 M
Π m =1 (1−z m z ) K− M Π m=1 (z−z m )
G ( z )=g K −1
=g z K
(2)
Π k=1 (1− p k z ) Π k−1 ( z− pk )
Example:
1. To find the roots of the polynomial: 1 - 10z-1 + 5z-2
roots([1 -10 5])
ans =
9.4721
0.5279
3
2. The function tf2zp(num,den) can also be used to compute poles and zeros of a
system, where num and den have their usual meanings.
[z,p,k]=tf2zp(num,den);
Zeros and poles are respectively returned in the column vectors z and p, whereas, the
gain constant is returned in the variable k. However, the length of vectors num and
den must be made equal by zero padding. Determine the poles and zeros of the
following systems function using tf2zp function:
−1 −2
1+ 0.2 z −0.5 z
H ( z )= −1 −2 −3 −4
1−0.6 z −0.19 z +0.144 z −0.018 z
num=[1 0.2 -0.5];
den=[1 -0.6 -0.19 0.144 -0.018];
[z,p,k]=tf2zp(num,den)
z =
-0.8141
0.6141
p =
-0.5000
0.6000
0.3000
0.2000
k =
1
Hence, the output:
Zeros: -0.8141 0.6141 0 0
Poles: -0.5 0.6 0.3 0.2
Gain: 1
The function [num,den]=zp2tf(z,p,k) does the reverse of the function
tf2zp.
z=[-0.8141 0.6141 0 0]';
p=[-0.5 0.6 0.3 0.2]';
k=[1]';
[num,den]=zp2tf(z,p,k)
num =
den =
4
Hence, the output:
−1 −2
1+ 0.2 z −0.5 z
H ( z )= −1 −2 −3 −4
1−0.6 z −0.19 z +0.144 z −0.018 z
3. The pole-zero plot can be obtained using the function zplane. The arguments to this
function can be specified in two ways:
i. Passing coefficients of numerator and denominator polynomials of system
function where they are specified as two row vectors.
−1 −2
1+ 0.2 z −0.5 z
H ( z )= −1 −2 −3 −4
1−0.6 z −0.19 z +0.144 z −0.018 z
num=[1 0.2 -0.5 0 0];
den=[1 -0.6 -0.19 0.144 -0.018];
zplane(num,den);
grid on;
0.8
0.6
0.4
Imaginary Part
0.2
2
0
-0.2
-0.4
-0.6
-0.8
-1
-1 -0.5 0 0.5 1
Real Part
ii. Passing zeros and poles where the function zplane can also be passed zeros
and poles of the system. However, the difference must be appreciated between
passing (zeros,poles) and (num,den) as arguments. That is, zeros and
poles are entered as column vectors while num and den are entered as row
vectors.
4. The factored form of the z-transform can be obtained from the zero-pole description
using the function sos=zp2sos(z,p,k)where sos stands for second-order
sections. The function computes the coefficients of each second-order factor given as
an L × 6 matrix sos where
5
[ ]
b 01 b 11 b21 a01 a 11 a21
b 02 b12 b22 a02 a12 a22
sos= (3)
⋮ ⋮ ⋮ ⋮ ⋮ ⋮
b 0 L b1 L b2 L a 0 L a 1 L a2 L
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):
L −1 −2
b 0 l+ b1 l z +b 2l z
G ( z )=∏ −1 −2
(4)
l=1 a 0 l + a1 l z +a 2 l z
num=[1 0.2 -0.5 0 0];
den=[1 -0.6 -0.19 0.144 -0.018];
%Conversion from factored to second-ordered factored
sos=zp2sos(z,p,k);
disp('Second-Order Sections:');
disp(sos);
num=[0 1 0];
den=[3 -4 1];
[r,p,k]=residuez(num,den)
r =
0.5000
-0.5000
6
p =
1.0000
0.3333
k =
0
Hence, the output:
1 1
2 2
H ( z )= −1
− −1
1−z 1
1− z
3
()
n
1 1 1
∴ h [ n ]= u [ n ]− u[n]
2 2 3
Exercise:
1. Find the zeros, poles and gain of the following transfer function. Then, generate a
pole-zero plot via passing coefficients of numerator and denominator polynomials of
system function, which are specified as two row vectors.
−1 −2
(1−z −2 z )
H ( z )= −1 −2 −3
1−1.75 z +1.25 z −0.3756 z
num=[1 -1 -2];
den=[1 -1.75 1.25 -0.3756];
zplane(num,den);
grid on;
2. Find the zeros, poles and gain of the following transfer function. Then, generate a
pole-zero plot via passing coefficients of numerator and denominator polynomials of
system function. Get also the second-order factored form, G(z).
−2 −3 −4
5+30 z −77 z +67 z
H ( z )= −1 −2 −4
10−11 z +10 z −75 z
7
3. Consider the following function to generate a pole-zero plot via passing coefficients
of numerator and denominator polynomials of system function. Find also the impulse
response h[n].
2
z +z
H ( z )=
2 1
z−
2
num=[1 1];
den=[1 -1/2];
num=[3];
den=[1 -4];