NMK31003 Lab 3 - Sem 1 2023 - 24

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

Universiti Malaysia Perlis

PGT 310: DIGITAL SIGNAL PROCESSING


LABORATORY MODULES
SEMESTER 1 SESSION 2023/2024

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 )

This is completely defined by the poles, zeros and gain.


There are K − M zeros or M − K poles at z = 0.
1
Inverse z-transform: g [ n ] =
2 πj
∮ G(z )z n−1 dz where the integral is anti-clockwise around a
circle within the ROC, z=R e jθ . Not unique unless ROC is specified that depends on the
circle with radius R (lying within the ROC). In practice use a combination of partial fractions
and table of z-transforms.
MATLAB routines used for z-transform:

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 =

1.0000 0.2000 -0.4999 0 0

den =

1.0000 -0.6000 -0.1900 0.1440 -0.0180

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);

Hence, the output:


Second-Order Sections:
1.0000 0 0 1.0000 -0.5000 0.0600
1.0000 0.2000 -0.4999 1.0000 -0.1000 -0.3000
Based on equations (3) and (4), respectively:
−1 −2
1 1+0.2 z −0.4999 z
G ( z )= −1 −2
× −1 −2
1−0.5 z + 0.06 z 1−0.1 z −0.3 z

5. MATLAB approaches to calculate inverse z-transform:


i. Long division: Here we use the MATLAB function
[q,r]=deconv(num,den) which returns the quotient of division in row
vector q and remainder in row vector r.
ii. Partial fractions: The MATLAB function residuez can be used to
decompose a rational z-transform into its partial fractions and vice versa.
a. [r,p,k]=residuez(num,den) returns the residues (numerator
constants) in row vector r, poles in row vector p and constants in k.
b. [num,den]=residuez(r,p,k); does the reverse process of
above.
Determine the partial fraction expansion (PFE) of the rational function and find also
the h[n]:
z
H ( z )= 2
3 z −4 z +1

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

num=[5 30 -77 67];


den=[10 -11 10 -75];

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];

4. Repeat Exercise 3 but with the following transfer function:


3z
H ( z )=
( z +2 ) ( z−2 )

num=[3];
den=[1 -4];

You might also like