








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









Islamic University of Gaza
Faculty of Engineering Electrical Engineering Department ENG.MOHAMMED ELASMER Spring- ______________________________________________________________________________
Our aim is to become familiar with: Z-transform and its properties Inverse of Z-transform Using Z-transform in solving difference equations.
THE BILATERAL Z-TRANSFORM
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.
The z-transform of a sequence x (n) is given by:
∞
𝑛 =−∞
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:
𝐶
Where C is a counterclockwise contour encircling the origin and lying in the ROC.
Notes:
∞
𝑛 =−∞
Let 𝑥 1 𝑛 = 𝑎𝑛^ 𝑢 𝑛 , 0 < 𝑎 < ∞. (This sequence is called a positive-time sequence). Then
Note: X1(z) in this example is a rational function; that is,
where 𝐵 𝑧 = 𝑧 is the numerator polynomial and 𝐴(𝑧) = 𝑧 − 𝑎 is the denominator polynomial. The roots of B(z) are called the zeros of X(z), while the roots of A(z) are called the poles of X(z). In this example X1 (z) has a zero at the origin z = 0 and a pole at z = a. Hence x1(n) can also be represented by a pole-zero diagram in the z- plane in which zeros are denoted by „o‟ and poles by „x‟ as shown in Figure 4.1.
Figure 4.1 The ROC in Example 6.
EXAMPLE 4.2: Let 𝑥 2 𝑛 = −𝑏𝑛^ 𝑢 −𝑛 − 1 , 0 < 𝑏 < ∞. (This sequence is called a negative- time sequence.) Then
1 (^1 ) 0 1
n n n n n
1
1 1 2
1 0 1 1 1 1 1 1 1 1 0 1 1 1
1 1
let: n= 1 1 0,
( ) ( ) = ( ) = ( ) ( )
1 1 | | 1 1 1 1 = , RO 1 1
n n n n n
k k k k k k
X z b u n z bz
k n k n k
X z bz bz bz b z
b z bz b z z bz bz z b
C2: 0<|z| < |b|
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: 𝑍 𝑥∗^ 𝑛 = 𝑋∗^ 𝑧∗^ ; 𝑅𝑂𝐶: 𝑅𝑂𝐶𝑥 6. Differentiation in the z-domain
𝑍 𝑛𝑥 𝑛 = −𝑧
This property is also called “multiplication by a ramp” property.
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. 𝐿𝑒𝑡 𝑋 1 𝑧 = 2 + 3𝑧−^1 + 4𝑧−^2 𝑎𝑛𝑑 𝑋 2 𝑧 = 3 + 4𝑧−^1 + 5𝑧−^2 + 6𝑧−^3. 𝐷𝑒𝑡𝑒𝑟𝑚𝑖𝑛𝑒 𝑋 3 𝑧 = 𝑋 1 𝑧 𝑋 2 𝑧
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 X 3 z = 6 + 17z−^1 + 34z−^2 + 43z−^3 + 38z−^4 + 24z−^5
Using the conv_m function developed in Lab 3, we can also multiply two z-domain polynomials corresponding to non-causal sequences.
EXAMPLE 4. 𝐿𝑒𝑡 𝑋 1 𝑧 = 𝑧 + 2 + 3𝑧−^1 𝑎𝑛𝑑 𝑋 2 𝑧 = 2𝑧^2 + 4𝑧 + 3 + 5𝑧−^1 𝐷𝑒𝑡𝑒𝑟𝑚𝑖𝑛𝑒 𝑋 3 𝑧 = 𝑋 1 𝑧 𝑋 2 𝑧
Note that Using MATLAB, x1(n)={1,2,3} and x2(n){2,4,3,5}
x1= [1,2,3]; n1 = [-1:1]; x2= [2,4,3,5]; n2= [-2:1]; [x3,n3]=conv_m(x1,n1,x2,n2) x3 = 2 8 17 23 19 15 n3 = -3 -2 -1 0 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 X 3 (z) in Example 4.4 by X 1 (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
Then we obtain the coefficients of the polynomial X 2 (z) as expected. To obtain the sample index, we will have to modify the deconv function as we did in the conv.m function. This operation is useful in obtaining a proper rational part from an improper rational function. ======================================================== % modified deconvolution routine function [y,ny,r]=deconv_m(x,nx,h,nh) nyb=nx(1)-nh(1); nye=nx(length(x))-nh(length(h)); ny=[nyb:nye]; [y,r]=deconv(x,h); end ======================================================== Resolving Example 4.4 using deconv_m function:
x3 = [6,17,34,43,38,24]; nx3=[0:5] ; xl= [2,3,4]; nx1=[0,1,2]; [y,ny,r]=deconv_m(x3,nx3,xl,nx1)
y = 3 4 5 6 ny= 0 1 2 3 r = 0 0 0 0 0 0
Using z-transform properties and the z-transform table, determine the z-transform of
Solution: Applying the sample-shift property,
− 1
1 − 𝑧−^1 + 𝑧−^2
Frequency shifting: 𝑍 𝑎𝑛^ 𝑥 𝑛 = 𝑋 𝑧 𝑎 ;^ 𝑅𝑂𝐶:^ 𝑅𝑂𝐶𝑥^ 𝑠𝑐𝑎𝑙𝑒𝑑^ 𝑏𝑦^ |𝑎|
− 1
− 1
− 1
− 2
Differentiation in the z-domain: 𝑍 𝑛𝑥 𝑛 = −𝑧 𝑑𝑋 (𝑧) 𝑑𝑧 ;^ 𝑅𝑂𝐶:^ 𝑅𝑂𝐶𝑥
− 1
− 2
Sample shifting: 𝑍 𝑥 𝑛 − 𝑛𝑜 = 𝑧−𝑛𝑜^ 𝑋 𝑧 ; 𝑅𝑂𝐶: 𝑅𝑂𝐶𝑥
− 1
− 2
Hence
MATLAB verification: To check that the above X (z) is indeed the correct expression, let us compute the first 8 samples of the sequence x (n) corresponding to X(z) as discussed before.
b = [0,0,0,0.25,-0.5,0.0625]; a=[1,-1,0.75,-0.25,0.0625,0]; [delta,n]=impseq(0,0,7) x= filter(b,a,delta) %check sequence
x = 0 0 0 0.25 -0.25 -0.375 -0.125 0.
% original sequence
n=0:7 ; x=[(n-2).(1/2).^(n-2).cos(pi(n-2)/3)].stepseq(2,0,7)
x = 0 0 0 0.25 -0.25 -0.375 -0.125 0. This approach can be used to verify the z-transform computations.
INVERSION OF THE Z-TRANSFORM The inverse z-transform computation requires an evaluation of a complex contour integral that, in general, is a complicated procedure. The most practical approach is to use the partial fraction expansion method. It makes use of the z-transform Table 4. (or similar tables available in many textbooks.) The z-transform, however, must be a rational function. This requirement is generally satisfied in digital signal processing.
Find the inverse z-transform of x (z)
− 1
− 1
Now, X (z) has two poles: z1 = 1 and z2 = 1/3 and since the ROC is not specified, there are three possible ROCs as shown in Figure 4.4.
Figure 4.4 The ROC in Example 4.
ROC1 (^1) < 𝑧 < ∞ 𝑥 𝑛 =
1 2
−
1 2
1 3
𝑛 𝑢(𝑛)
right-sided sequence ROC 0 < 𝑧 <
1 3 𝑥^ 𝑛^ =^ −^
1 2 𝑢 −𝑛 − 1 +
1 2
1 3
𝑛 𝑢(−𝑛 − 1 )
left-sided sequence ROC3 1 3 < 𝑧 < (^1) 𝑥 𝑛 = − 1 2 𝑢 −𝑛 − 1 −
1 2
1 3
𝑛 𝑢(𝑛)
two-sided sequence
So that:
− 1
− 2
=
Compute the inverse z-transform of
𝑋 𝑧 =
We can evaluate the denominator polynomial as well as the residues using MATLAB.
b=[1 0 0 0]; a= poly([0.9,0.9,-0.9]) [R,p,C] = residuez(b,a) a = 1.0000 -0.9000 -0.8100 0.
R =
p = -0.
C = 0 Note that the denominator polynomial is computed using MATLAB‟s polynomial function poly, which computes the polynomial coefficients, given its roots. We could have used the conv function, but the use of the poly function is more convenient for this purpose. From the residue calculations and using the order of residues given in (4.16), we have
Hence from Table 4.1 and using the z-transform property of time-shift,
which upon simplification becomes
𝑥 𝑛 = 0.75 0.9 𝑛^ 𝑢 𝑛 + 0.5𝑛 0.9 𝑛^ 𝑢 𝑛 + 0.25 −0.9 𝑛^ 𝑢 𝑛
MATLAB verification:
b=[1]; a =[1,-0.9,-0.81,0.729] [delta,n]= impseq(0,0,7); x=filter(b,a,delta) % check sequence
x =1 0.9 1.62 1.458 1.9683 1.7715 2.1258 1.
% answer sequence
x=(0.75)(0.9).^n + (0.5)n.(0.9).^n + (0.25)(-0.9).^n
x =1 0.9 1.62 1.458 1.9683 1.7715 2.1258 1.
Other verification:
ans =
(-9/10)^n/4 + (5(9/10)^n)/4 + ((9/10)^n(n - 1))/
Determine the inverse z-transform of
so that the resulting sequence is causal and contains no complex numbers.
Solution We will have to find the poles of X (z) in the polar form to determine the ROC of the causal sequence.
b=[1,0.4sqrt(2),0]; a=[1,-0.8sqrt(2),0.64]; [R,p,C]= residuez(b,a) R = 0.5000 - 1.0000i 0.5000 + 1.0000i p = 0.5657 + 0.5657i 0.5657 - 0.5657i C = [] Mp=abs(p') % pole magnitudes Ap = angle(p')/pi % pole angles in pi units Mp = 0.8 0. Ap =-0.25 0. From the above calculations
syms z f=1/(((1-0.9z^-1)^2)(1+0.9*z^-1)) iztrans(f)
Example: 4.
syms n; f = ((-1).^n)*2^-n ztrans(f)
syms z; f=z/(z+0.5) iztrans(f)
Example: 4.
Plot the zero-pole diagram of 𝑋 𝑧 =
>> help zplane ZPLANE Z-plane zero-pole plot. ZPLANE(Z,P) plots the zeros Z and poles P (in column vectors) with the unit circle for reference.
z=[0 ] p=[0.5;-75]
Figure 4.5 Zero-pole diagram for Example 6.
1 1
n n n
n
Real Part
Imaginary Part
Determine the results of the following polynomial operations using MATLAB 𝑎) 𝑋 1 (𝑧) = ( 1 − 2 𝑧−^1 + 3 𝑧−^2 − 4 𝑧−^3 ) ( 4 + 3 𝑧−^1 − 2 𝑧−^2 + 𝑧−^3 ) 𝑏) 𝑋 2 (𝑧) = (𝑧^2 − 2 𝑧 + 3 + 2 𝑧−^1 ) (𝑧^3 − 𝑧−^3 ) 𝑐) 𝑋 3 (𝑧) = ( 1 + 𝑧−^1 + 𝑧−^2 )^3
Determine the following inverse z-transforms using the partial fraction expansion method.
− 3
Solve the difference equation for y (n), n>0; 𝑦 𝑛 = 0.5𝑦 𝑛 − 1 + 0.25𝑦 𝑛 − 2 + 𝑥 𝑛 , 𝑛 ≥ 0 𝑤ℎ𝑒𝑟𝑒: 𝑦 − 1 = 1 𝑎𝑛𝑑 𝑦 − 2 = 2. 𝑥 𝑛 = 0.8 𝑛^ 𝑢(𝑛)
Generate the first 20 samples of y (n) using MATLAB.
A causal, linear, and time-invariant system is given by the following difference equation: 𝑦 𝑛 = 𝑦 𝑛 − 1 + 𝑦 𝑛 − 2 + 𝑥 𝑛 − 1
a) Find the system function H (z) for this system. b) Plot the poles and zeros of H (z) and indicate the region of convergence (ROC). c) Find the unit sample response h (n) of this system.
Plot the zero-pole diagram for:
𝑋 𝑧 =