Lab4 Z Transform
Lab4 Z Transform
OBJECTIVES:
The z-transform is useful for the manipulation of discrete data sequences and has
acquired a new significance in the formulation and analysis of discrete-time
systems. It is used extensively today in the areas of applied mathematics, digital
signal processing, control theory, population science, economics. These discrete
models are solved with difference equations in a manner that is analogous to solving
continuous models with differential equations. The role played by the z-transform in
the solution of difference equations corresponds to that played by the Laplace
transforms in the solution of differential equations.
Where z is a complex variable. The set of z values for which X (z) exists is called the
region of convergence (ROC) .
The inverse z-transform of a complex function X(z) is given by:
1
(𝑛) = 𝑍−1[𝑋(𝑧)] =
2𝜋𝑗 (𝑧)𝑧𝑛−1𝑑𝑧
𝐶
Where C is a counterclockwise contour encircling the origin and lying in the ROC.
Notes:
1) The complex variable z is called the complex frequency given by 𝑧 = |𝑧|𝑒𝑗𝜔
where |z| is the attenuation and 𝜔 is the real frequency.
DSP Lab Manual, Electrical Engineering Department, Air University Kamra Campus
𝑋(𝑧)|𝑧=𝑒𝑗𝜔 = 𝑋(𝑒𝑗𝜔 ) = ∑
𝑥(𝑛)𝑒−𝑗𝜔𝑛
𝑛=−∞
EXAMPLE 4.1
Let 𝑥1(𝑛) = 𝑎𝑛 𝑢(𝑛) , 0 < |𝑎| < ∞. (This sequence is called a positive-time
sequence). Then
X (z )
a n u[n ]z n (az 1)n
1
z
1
n n 0 1 az 1 z a
ROC1: |az 1 | 1 | a | | z |
EXAMPLE 4.2:
Let 𝑥2(𝑛) = −𝑏𝑛 𝑢(−𝑛 − 1) , 0 < |𝑏| < ∞. (This sequence is called a negative-
time sequence.)
Then 1
X 2 (z ) (bz 1)n
n
b n
u (n 1)z
n n
let: n= k 1
n 1 k 0, n k
1 0
X (z ) 1 k 1
(bz ) = (bz ) 1 k 1 1 1
= (bz ) (b 1
z )k
DSP Lab Manual, Electrical Engineering Department, Air University Kamra Campus
k 1 k k 0
1 1 1
|b z |
1
1
bz 1 1 b z
1
z 1
= , ROC2: 0<|z| < |b|
bz 1 1 1 bz 1 z b
DSP Lab Manual, Electrical Engineering Department, Air University Kamra Campus
The ROC2 and the pole-zero plot for this x2(n) are shown in Figure 4.2.
Note: If b = a in previous examples, then 𝑋1 (𝑧) = 𝑋2 (𝑧) except for their respective
ROCs; that is, ROC1 ROC2. This implies that the ROC is a distinguishing feature that
guarantees the uniqueness of the z-transform. Hence it plays a very important role in
system analysis.
EXAMPLE 4.3
Let 𝑥3(𝑛) = 𝑥1(𝑛) + 𝑥2(𝑛) = 𝑎𝑛 𝑢(𝑛) − 𝑏𝑛 𝑢(−𝑛 − 1) (This sequence is called a two-
sided sequence.) Then using the above two examples,
If |b| < |a|, the ROC3 is a null space and X3 (z) does not exist. If |a| <|b|, then the
ROC3 is |a|<|z|<|b| and X3(z) exists in this region as shown in Figure 4.3.
Example: 4.4
n
2
1 1 1 1 1
u (n ) = , |z | 2 | 2
2 1 |
1 1 1
1 z z 1
ROC: | 2 2
z 1
|
2
syms n;
f = ((-1).^n)*2^-n
ztrans(f)
syms z;
f=z/(z+0.5)
iztrans(f)
ans =(-1/2)^n
Example: 4.5
z=[0 ]
p=[0.5;-
75]
zplane(z,p)
1
Imaginary Part
-1
-1 0 1
Real Part
Figure 4.5 Zero-pole diagram for Example 6.13
DSP Lab Manual, Electrical Engineering Department, Air University Kamra Campus
The properties of the z-transform are generalizations of the properties of the discrete-
time Fourier transform. We state the following important properties of the z-transform
without proof.
1. Linearity:
{𝑎1𝑥1(𝑛) + 𝑎2𝑥2(𝑛)} = 𝑎1𝑋1(𝑧) + 𝑎2𝑋2(𝑧) ; 𝑅𝑂𝐶: 𝑅𝑂𝐶𝑥1 ∩ 𝑅𝑂𝐶𝑥2
2. Sample shifting:
𝑍{𝑥(𝑛 − 𝑛𝑜 )} = 𝑧−𝑛𝑜 𝑋(𝑧) ; 𝑅𝑂𝐶: 𝑅𝑂𝐶𝑥
3. Frequency shifting:
𝑧
𝑍{𝑎𝑛 𝑥(𝑛)} = 𝑋 ( ) ; 𝑅𝑂𝐶: 𝑅𝑂𝐶 𝑠𝑐𝑎𝑙𝑒𝑑 𝑏𝑦 |𝑎|
𝑥
𝑎
4. Folding:
{𝑥(−𝑛)} = (1/𝑧) ; 𝑅𝑂𝐶: 𝐼𝑛𝑣𝑒𝑟𝑡𝑒𝑑 𝑅𝑂𝐶𝑥
5. Complex conjugation:
𝑍{𝑥∗(𝑛)} = 𝑋∗(𝑧∗) ; 𝑅𝑂𝐶: 𝑅𝑂𝐶𝑥
7. Convolution:
{𝑥1(𝑛) ∗ 𝑥2(𝑛)} = 𝑋1(𝑧)𝑋2(𝑧) ; 𝑅𝑂𝐶: 𝑅𝑂𝐶𝑥1 ∩ 𝑅𝑂𝐶𝑥2
This last property transforms the time-domain convolution operation into a
multiplication between two functions. It is a significant property in many ways. First,
if X1(z) and X2(z) are two polynomials, then their product can be implemented using
the conv function in MATLAB.
□□ □
EXAMPLE 4.6
Solution:
From the definition of the z-transform we observe that x1(n) = {2,3,4} and x2(n) =
{3,4,5,6}
Then the convolution of the above two sequences will give the coefficients of the
required polynomial product.
>> xl=[2,3,4]; x2=[3,4,5,6];
>> x3= conv(xl,x2)
x3 = 6 17 34 43 38 24
Hence
X3(z) = 6 + 17z−1 + 34z−2 + 43z−3 + 38z−4 + 24z−5
DSP Lab Manual, Electrical Engineering Department, Air University Kamra Campus
Using the conv_m function developed in Lab 3, we can also multiply two z-domain
polynomials corresponding to non-causal sequences.
EXAMPLE 4.7
𝐿𝑒𝑡 𝑋1(𝑧) = 𝑧 + 2 + 3𝑧−1 𝑎𝑛𝑑 𝑋2(𝑧) = 2𝑧2 + 4𝑧 + 3 + 5𝑧−1
𝐷𝑒𝑡𝑒𝑟𝑚𝑖𝑛𝑒 𝑋3(𝑧) = 𝑋1(𝑧) 𝑋2(𝑧)
we have
𝑋3(𝑧) = 2𝑧3 + 8𝑧2 + 17𝑧 + 23 + 19𝑧−1 + 15𝑧−2
In passing we note that to divide one polynomial by another one, we would require an
inverse operation called deconvolution. In MATLAB [p,r] = deconv(b,a)
computes the result of dividing b by a in a polynomial part p and a remainder r. For
example, if we divide the polynomial X3(z) in Example 4.4 by X1(z),
>> x3 = [6,17,34,43,38,24]; xl= [2,3,4];
>> [x2,r] = deconv(x3,xl)
x2 = 3 4 5 6
r = 0 0 0 0 0 0
DSP Lab Manual, Electrical Engineering Department, Air University Kamra Campus
Lab Tasks
Lab Task 1 :
Implement all examples given in manual (Example 4.1 to 4.7) in
DSP Lab Manual, Electrical Engineering Department, Air University Kamra Campus
DSP Lab Manual, Electrical Engineering Department, Air University Kamra Campus
Lab Task 2 :
Plot the zero-pole diagram for:
1
( 𝑧) =
(1 − 0.9𝑧−1)2(1 + 0.9𝑧−1)