Professional Documents
Culture Documents
Handout - 5 The Z-Transform
Handout - 5 The Z-Transform
Handout - 5 The Z-Transform
Using Matlab
The z-Transform
Overview
• Introduction
• Definition of the z-transform
• 3D Visualization of the z-Transform
• Properties of the ROC
• Common z-Transform Pairs
• Properties of the z-Transform
• The Inverse z-Transform
• System representation in the z-domain
Introduction
• The discrete-time Fourier transform (DTFT) approach represents
discrete signals and systems using complex exponential
sequence
∞
𝑋 𝜔 = 𝑥[𝑛]𝑒 −𝑗𝜔𝑛
𝑛=−∞
• However, in order for the DTFT to converge (exist), it is
necessary for the represented signal or system to be absolutely
summable.
• In practice, there are many useful signals for which the DTFT
does not exist because they are not absolutely summable.
• Furthermore, the transient response of a system due to initial
conditions or due to changing inputs cannot be computed using
the DTFT approach.
Definition of the z-transform
• To address the previous two problems, z-transform is proposed
as a generalization of the DTFT.
• The z-transform of a signal 𝑥[𝑛] is defined as
∞
𝑋 𝑧 = 𝑍 𝑥[𝑛] = 𝑥[𝑛]𝑧 −𝑛
𝑛=−∞
𝑋 𝑧 = 𝑥[𝑛]𝑧 −𝑛 = − 𝑎𝑛 𝑧 −𝑛 = − 𝑎−1 𝑧 𝑛
= 1 − σ∞ −1
𝑛=0 𝑎 𝑧
𝑛
∞
The z-plane
3D Visualization of the z-Transform
𝑧
𝐻 𝑧 =
𝑧 − 0.5
30
20
20 log |H(z)|, dB
10
-10
-20
-30
2
1 2
0 1
Im{z} 0
-1 Re{z}
-1
-2 -2 z-plane
Properties of the ROC
1. The z-transform of a sequence consists of an algebraic formula
and its associated ROC. Thus, to uniquely specify a sequence
𝑥[𝑛] we need both 𝑋 𝑧 and its ROC.
2. The function 𝑋 𝑧 is not defined when z is outside the ROC,
even if the formula for 𝑋 𝑧 yields meaningful results for these
values.
3. The ROC does not contain any poles (a pole means 𝑋 𝑧 = ∞).
4. The ROC is one contiguous region and does not come in pieces.
5. If 𝑋 𝑧 is a rational function, there will be at least one pole on
the boundary of the ROC.
Properties of the ROC
6. If the signal is finite-length (i.e., 𝑥[𝑛] = 0 except for 𝑛1 ≤ 𝑛 ≤
𝑛2 ), the ROC is the entire z-plane.
If 𝑛1 < 0, then 𝑧 = ∞ is not in the ROC.
If 𝑛2 > 0, then 𝑧 = 0 is not in the ROC.
7. If the signal is right-sided (i.e., 𝑥[𝑛] = 0 for 𝑛 < 𝑛0 )
the ROC is the exterior of a circle: 𝑧 > 𝛼
(if 𝑛0 ≥ 0, therefore 𝑥[𝑛] is a causal sequence)
8. If the signal is left-sided (i.e., 𝑥[𝑛] = 0 for 𝑛 > 𝑛0 )
the ROC is the interior of a circle: 𝑧 < 𝛽
(if 𝑛0 ≤ 0, therefore 𝑥[𝑛] is an anticausal sequence)
9. If the signal is two-sided
the ROC is an open ring: 𝛼 < 𝑧 < 𝛽
Common z-Transform Pairs
Example (5):
1
𝑎𝑛 𝑢[𝑛]=1−𝑎𝑧 −1
Examples**
1
Note: 𝑍{𝑎𝑛 𝑢 𝑛 } = 1−𝑎𝑧 −1
1
𝑍{(𝑎−1 )𝑛 𝑢 𝑛 } = 1−𝑎−1 𝑧 −1
1
𝑍{(𝑎−1 )−𝑛 𝑢 −𝑛 } = 1−𝑎−1𝑍
The Inverse z-Transform
Method A: Inversion Formula
1
𝑥[𝑛] = ර 𝑋(𝑧) 𝑧 𝑛−1 𝑑𝑧
2𝜋𝑗 𝐶
This, in general, is a complicated procedure.
(𝑧 − 𝑧1 ) ⋯ (𝑧 − 𝑧𝑙 ) ς𝑙𝑘=1 𝑧 − 𝑧𝑘
𝑋 𝑧 =𝐶 =𝐶 𝑚
(𝑧 − 𝑝1 ) ⋯ (𝑧 − 𝑝𝑚 ) ς𝑘=1 𝑧 − 𝑝𝑘
Assuming that 𝑚 ≥ 𝑙 and that all the roots in the denominator are
simple and distinct (not repeated), 𝑋 𝑧 may be expressed as follows
𝑧 𝑧
𝑋 𝑧 = 𝐴0 + 𝐴1 + ⋯ + 𝐴𝑚
𝑧 − 𝑝1 𝑧 − 𝑝𝑚
where
𝑋(𝑧)
𝐴0 = 𝑋(𝑧)ቚ and 𝐴𝑘 = (𝑧 − 𝑝𝑘 ) ቤ
𝑧=0 𝑧 𝑧=𝑝
𝑘
The Inverse z-Transform
Example:
Find the inverse z-transform of
𝑧
𝑋 𝑧 = 2
3𝑧 − 4𝑧 + 1
Solution:
(1/3)𝑧 (1/3)𝑧 𝑧 𝑧
𝑋 𝑧 = = = 𝐴0 + 𝐴1 + 𝐴2
4 1 1 𝑧−1 1
𝑧2 − 𝑧 + (𝑧 − 1)(𝑧 − ) 𝑧−
3 3 3 3
𝐴0 = 𝑋(𝑧)ቚ =0
𝑧=0
𝑋 𝑧 (1/3) 1
𝐴1 = 𝑧 − 1 ቤ = =
𝑧 𝑧=1 1 ቮ 2
(𝑧 − )
3
𝑧=1
The Inverse z-Transform
1 𝑋 𝑧 (1/3) 1
𝐴2 = 𝑧 − ቤ = ቤ =−
3 𝑧 𝑧=1 (𝑧 − 1) 𝑧=1 2
3 3
Therefore
𝑧 1 𝑧 𝑧
𝑋 𝑧 = 2 = −
3𝑧 − 4𝑧 + 1 2 𝑧 − 1 𝑧 − (1/3)
1
Now, 𝑋 𝑧 has two poles: 𝑝1 = 1 and 𝑝2 = 3 and since the ROC is
not specified, there are three possible ROCs.
• Right-sided sequence
• Left-sided sequence
• Two-sided sequence
The Inverse z-Transform
The Inverse z-Transform
Matlab Implementation
• A Matlab function residuez is available to compute the residue part
and the direct (or polynomial) terms of a rational function in 𝑧 −1 .
• Let
𝑧 𝑧 −1 0 + 𝑧 −1
𝑋 𝑧 = 2 = −1 −2
=
3𝑧 − 4𝑧 + 1 3 − 4𝑧 + 𝑧 3 − 4𝑧 −1 + 𝑧 −2
MATLAB:
>> b = [0, 1];
>> a = [3, -4, 1];
>> [r, p, k] = residuez(b, a)
r=
0.5000
-0.5000 0.5 𝑧 0.5 𝑧
p= 𝑋 𝑧 = −
1.0000 𝑧 − 1 𝑧 − (1/3)
0.3333
k=
[]
Matlab Implementation
• Similarly, [b,a] = residuez(r,p,k) can be used to convert the partial
fraction expansion back to polynomials with coefficients in row
vectors b and a.
MATLAB:
>> r = [0.5, -0.5];
>> p = [1, 1/3];
1
>> k = []; 0 + 3 𝑧 −1 𝑧 −1
>> [b, a] = residuez(r, p, k) 𝑋 𝑧 = =
4 1 3 − 4𝑧 −1 + 𝑧 −2
b= 1 − 3 𝑧 −1 + 3 𝑧 −2
0.0000 𝑧
= 2
0.3333 3𝑧 − 4𝑧 + 1
a=
1.0000
-1.3333
0.3333
System representation in the z-domain
System Function
• Recall that, for a LSI system with a unit sample response ℎ[𝑛], the
output is given by the convolution sum
∞
𝐻 𝑧 = 𝑍 ℎ[𝑛] = ℎ[𝑛]𝑧 −𝑛
𝑛=−∞
• Similar to the frequency response function 𝐻(𝜔), the z-domain
function, 𝐻 𝑧 is called the system function.
X (z ) H (z ) Y ( z) = H ( z) X ( z)
System representation in the z-domain
System Function From Difference Equation
𝑁 𝑀
𝑁 𝑀
𝑌 𝑧 + 𝑎𝑘 𝑧 −𝑘 𝑌 𝑧 = 𝑏𝑚 𝑧 −𝑚 𝑋 𝑧
𝑘=1 𝑚=0
𝑌(𝑧) σ𝑀
𝑚=0 𝑏𝑚 𝑧
−𝑚
𝑏0 𝑧 −𝑀 ς𝑀
𝑚=1 𝑧 − 𝑧𝑚
𝐻 𝑧 = = 𝑁 = −𝑁
𝑋(𝑧) 1 + σ𝑘=1 𝑎𝑘 𝑧 −𝑘 𝑧 ς𝑁
𝑘=1 𝑧 − 𝑝𝑘
Thus 𝐻(𝑧) can also be represented in the z-plane using a pole-zero plot.
This fact is useful in designing simple filters by proper placement of
poles and zeros.
Matlab Implementation
• To determine zeros and poles of a rational 𝐻 𝑧 you can use Matlab
functions:
roots: polynomial → roots
poly: roots → polynomial
• Also, zplane(b,a) plots the poles and zeros, given the numerator row
vector b and the denominator row vector a.
• Similarly, zplane(z,p) plots the zeros in column vector z and the poles
in the column vector p.
• [H,w]=freqz(b,a,N) returns the N-point frequency vector w and the N-
point complex frequency response vector H of the system.
Example
Consider a causal discrete-time system whose
output y[n] and input x[n] are related by
y[n]-5/6 y[n-1]+1/6 y[n-2]=x[n]
• Find its system function H(z).
• Find its impulse response h[n].
Matlab Implementation
Example
𝑧 𝑧
𝐻 𝑧 = 2 =
3𝑧 − 4𝑧 + 1 3(𝑧 − 1)(𝑧 − 1/3)
MATLAB:
>> b = [0, 1]; a = [3, -4, 1]; 1
>> zplane(b, a); 0.8
>> freqz(b, a); 0.6
0.2
-0.2
-0.4
-0.6
-0.8
-1
-1 -0.5 0 0.5 1
Real Part
Matlab Implementation
Magnitude (dB) 40
20
-20
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
0
Phase (degrees)
-50
-100
-150
-200
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
Relationships between system representation
Express H(z) in
1/z cross H(z) Take inverse z-
multiply and transform
take inverse Take z-transform Take
solve for Y/X z-transform
Difference
h(n)
Equation Substitute
z=ejw Take inverse
DTFT