Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2K views

DSP Using Matlab® - 5

The document discusses properties and applications of the z-transform. It outlines 8 important properties including linearity, sample shifting, frequency shifting, folding, complex conjugation, differentiation in the z-domain, multiplication, and convolution. Examples are provided to demonstrate properties such as multiplication, deconvolution, and computing the inverse z-transform. The residuez function is introduced to find the residues, poles, and direct terms of a rational function for inverting a z-transform.

Uploaded by

api-3721164
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views

DSP Using Matlab® - 5

The document discusses properties and applications of the z-transform. It outlines 8 important properties including linearity, sample shifting, frequency shifting, folding, complex conjugation, differentiation in the z-domain, multiplication, and convolution. Examples are provided to demonstrate properties such as multiplication, deconvolution, and computing the inverse z-transform. The residuez function is introduced to find the residues, poles, and direct terms of a rational function for inverting a z-transform.

Uploaded by

api-3721164
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 26

Lecture 5: Z-Transform

Prof. Dr. Salina A.


Samad
Mr. Iskandar Yahya
Properties of z-Transform
The important properties of the z-transform:
1. Linearity
z [ αx1( n ) + β x2 ( n )] = αX 1( z ) + βX 2 ( z ) ROC : ROC x1  ROC x 2
2. Sample shifting
z [ x( n − n0 )] = z − n0 X ( z ) ROC : ROC x
3. Frequency shifting
z
z [ a n x( n )] = X ( ) ROC : ROC x scaled by a
a
4. Folding
1
z [ x( −n )] = X ( ) ROC : inverted ROC x
z
5. Complex conjugation
z [ x* ( n )] = X * ( z* ) ROC : ROC x
6. Differentiation in the z-domain
dX ( z )
z [ nx( n )] = − z ROC : ROC x
dz
Properties of z-Transform
The important properties of the z-transform:

7. Multiplication
1
z [ x1( n )x2 ( n )] = ∫
2πj c
X 1( v ) X 2 ( z / v )v −1dv ROC : ROC x1 inverted ROC x 2

8. Convolution
z [ x1( n )* x2 ( n )] = X 1( z ) X 2 ( z ) ROC : ROC x1  ROC x 2
Properties of z-Transform
The important properties of the z-transform:

7. Multiplication
1
z [ x1( n )x2 ( n )] = ∫
2πj c
X 1( v ) X 2 ( z / v )v −1dv ROC : ROC x1 inverted ROC x 2

8. Convolution
z [ x1( n )* x2 ( n )] = X 1( z ) X 2 ( z ) ROC : ROC x1  ROC x 2

The time domain convolution transforms into a


multiplication of two functions. We can use “conv” to
implement the product of X1(z) and X2(z).
Properties of z-Transform
Example 1:
Let X ( z ) = 2 + 3 z −1 + 4 z −2 , X 2 ( z ) = 3 + 4 z −1 + 5 z −2 + 6 z −3
1

Find X 3 ( z ) = X 1 ( z ) X 2 ( z ) ?
From definition of the z-transforms,
x1 (n) = {2, 3, 4} x 2 (n) = {3, 4, 5, 6}
↑ ↑
x1 = [2,3,4]; x2 = [3,4,5,6];
x3 = conv(x1,x2)

x3 =
6 17 34 43 38 24

Hence
X 3 ( z ) = 6 + 17 z −1 + 34 z −2 + 43 z −3 + 38 z −4 + 24 z −5
Properties of z-Transform
Example 2:
We can use the “conv_m” function in to
multiply two z-domain polynomials
corresponding
X 1 ( z ) to
=z+noncausal
2 + 3 z −1 , X 2 ( z )sequences:
= 2 z 2 + 4 z + 3 + 5 z −1
Find
X 3 ( z) = X1 ( z) X 2 ( z) ?

We have x1 (n) = {1, 2, 3} 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

Therefore X3(z) = 2z3 + 8z2 + 17z + 23 + 19z-1 +


Properties of z-Transform
To divide one polynomial by another, we need
an inverse operation called deconvolution.
In Matlab we use “deconv”, i.e. [p,r] =
deconv(b,a) where we are dividing “b” by “a” in a
polynomial part “p” and a remainder “r”.
Example,
 We divide polynomial X3(z) in previous example by
X1(z):
x3 = [6,17,34,43,38,24]; x1 = [2,3,4];
[x2, r] = deconv(x3,x1)

x2 =
3 4 5 6

r =
0 0 0 0 0 0
z-Transform Pairs
z-Transform Pairs
Let’s look at one example:
( n −2 ) π
Determine the z-transform of x ( n ) = ( n − 2 )( 0 .5 ) cos[ (n − 2)]u (n − 2)
3
sol ) applying the sample − shift property
π
X ( z ) = z − 2 Z [n(0.5) n cos[ n]u (n)]
3
applying the differentiation in the z − plane property
π
dZ [(0.5) n cos[ n]u (n)]
= z − 2 [− z 3 ] ; no change in the ROC
dz
from table 4.1
1 − ( 0. 5 cos π ) z −1
π 3 1 − 0.25 z −1
Z [(0.5) cos[ n]u (n)] =
n
= ; z > 0.5
3 π
1 − 2(0.5 cos ) z + 0.25 z−1 −2
1 − 0 . 5 z −1
+ 0 . 25 z −2
3
−1 d 1 − 0.25 z −1 −1 − 0.25 z − 2 + 0.5 z −3 − 0.0625 z − 4
hence X ( z ) = − z ( −1 −2
)=− z
dz 1 − 0.5 z + 0.25 z 1 − z −1 + 0.75 z − 2 − 0.25 z −3 + 0.0625 z − 4
0.25 z −3 − 0.5 z − 4 + 0.0625 z −5
= ; z > 0 .5
1 − z −1 + 0.75 z − 2 − 0.25 z −3 + 0.0625 z − 4
z-Transform Pairs
In this example, we can see that the transform is
of the form X(z) = B(z)/A(z).
We can use the coefficients of B(z) and A(z) as
the “b” and “a” in the “filter” routine and excite
this routine with an impulse sequence, δ(n),
where Z[δ(n)] = 1. The output of “filter” will be
x(n).
This is a numerical approach of computing the
inverse z-transform.
We can compare this output with the given x(n) to
verify our z-transform X(z) is indeed the transform
of x(n).
z-Transform Pairs
The Matlab inplementation:
b= [0,0,0,0.25,-0.5,0.0625]; a = [1,-1,0.75,-0.25,0.0625];
[delta,n] = impseq(0,0,10)
delta =
1 0 0 0 0 0 0 0
n =
0 1 2 3 4 5 6 7

x = filter(b,a,delta) % check sequence


x =
Columns 1 through 7
0 0 0 0.2500 -0.2500 -0.3750 -0.1250
Column 8
0.0781

x = [(n-2).*(1/2).^(n-2).*cos(pi*(n-2)/3)].*stepseq(2,0,7) %original sequence


x =
Columns 1 through 7
0 0 0 0.2500 -0.2500 -0.3750 -0.1250
Column 8
0.0781
z-Transform Inversion
A Matlab function “residuez” is available to
compute the residue part and the direct (or
polynomial) terms of a rational function in z-1.
Let b0 + b1 z −1 + .... + bM z − M
X ( z )= −1 −N
; Rx − < z < Rx +
1 + a1 z + .... + a N z
N M −N
Rk
= ∑ 1− p −1
+ ∑ Ck z −k
k =1 kz k =0

[R, p, C] = residuez(b,a)

Therefore we can find the Residues (R), Poles (p)


and Direct terms (C) of X(z).
z-Transform Inversion
Let’s look at an example:
z
Consider the rational X ( z) =
function: 3 z 2 − 4 z +1
 First rearrange X(z) so that it is a fucntion in
ascending powers of z-1:
z × z −2 z −1
X ( z) = =
(3 z 2 − 4 z +1) × z −2 3 − 4 z −1 +1z −2

 Use matlab: b = [0,1]; a = [3,-4,1];


[R,p,C] = residuez(b,a)
R =
0.5000
-0.5000
p =
1.0000
0.3333
C =
[]
z-Transform Inversion
We obtain:
1 −1
X( z ) = 2 + 2
1 − z −1 1 − 1 z −1
3

To convert back to the rational function form:


[b,a] = residuez(R,p,C)
b =
0.0000
0.3333
a =
1.0000
-1.3333
0.3333

So that we get: 1 z −1


3
X( z ) =
1 − 4 z −1 + 1 z − 2
3 3
z-Transform Inversion
Another example, compute the inverse z-
transform: 1
X( z ) = −1 2 −1
, z > 0.9
( 1 − 0.9 z ) ( 1 + 0.9 z )
b = 1; a = poly([0.9,0.9,-0.9])
a =
1.0000 -0.9000 -0.8100 0.7290
[R,p,c] = residuez(b,a)
R =
0.2500 + 0.0000i
0.5000 - 0.0000i
0.2500
p =
0.9000 + 0.0000i
0.9000 - 0.0000i
-0.9000
c = []
z-Transform Inversion
Using table 4.1:
0.5
x( n ) = 0.25( 0.9 )n u( n ) + ( n +1 )( 0.9 )n +1 u( n +1 ) + 0.25( −0.9 )n u( n )
0.9
Matlab verification:
[delta,n] = impseq(0,-1,7);
x = filter(b,a,delta) % check sequence
x =
Columns 1 through 7
0 1.0000 0.9000 1.6200 1.4580 1.9683
1.7715
Columns 8 through 9
2.1258 1.9132
x = (0.25)*(0.9).^n.*stepseq(0,-1,7) + (0.5)*(n+1).*(0.9).^n.*stepseq(-1,-
1,7) + (0.25)*(-0.9).^n.*stepseq(0,-1,7) % answer sequence
x =
Columns 1 through 7
0 1.0000 0.9000 1.6200 1.4580 1.9683
1.7715
Columns 8 through 9
2.1258 1.9132
z-Transform Inversion
Another Example. Determine the inverse z-
1 + 0.4 2 z −1
transform of X( z ) =
1 − 0.8 2 z −1 + 0.64 z − 2

so that the resulting sequence is causal and


contains no complex numbers.
 We will have to find the poles of X(z) in the polar
b = form to determine
[1,0.4*sqrt(2)]; the ROC of the
a=[1,-0.8*sqrt(2),0.64]; causal sequence.
[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.8000 0.8000
Ap = -0.2500 0.2500
z-Transform Inversion

From the Matlab calculation, we have:


0.5 + j 0.5 − j
X( z ) = + ,
− jπ jπ
1 − 0.8 e 4 z −1 1 − 0.8 e 4 z −1

z > 0.8 due to right − sided sequence

And from table 4.1 we have:


n − jπ4n n jπ n
x( n ) = ( 0.5 + j ) 0.8 e u( n ) + ( 0.5 − j ) 0.8 e 4 u( n )
n − jπ n jπ n − jπ n jπ n
= 0.8 [ 0.5( e 4 +e 4 )+ j( e 4 −e 4 )] u( n )
= 0.8 n [cos( πn ) + 2 sin( πn )] u( n )
4 4
z-Transform Inversion
Matlab Verification:

[delta,n] = impseq(0,0,6);
x = filter(b,a,delta) % check sequence
x=

1.0000 1.6971 1.2800 0.3620 -0.4096 -0.6951 -0.5243

x = ((0.8).^n).*(cos(pi*n/4)+2*sin(pi*n/4)) % answer sequence


x=

1.0000 1.6971 1.2800 0.3620 -0.4096 -0.6951 -0.5243


Systems in The z-Domain
To determine zeros and poles of a rational H(z),
we can use “roots” for both the numerator and
denominator. (“poly” is the inverse of “root”)
We can plot these roots in a pole-zero plot using
“zplane(b,a)”. This will plot poles and zeros given
the numerator row/coloumn vector “b” and the
denominator row/coloumn vector “a”. (H(z) =
B(z)/A(z))
We can calculate the magnitude and the phase
responses of our system using “freqz”:

[H,w] = freqz(b,a,N) – Returns the N-point


frequency vector “w” and the N-point complex
frequencey response vector “H”.
Systems in The z-Domain
Second form:
[H,w] = freqz(b,a,N,’whole’) – uses N points
around the whole unit circle for computation.
Another form:
H = freqz(b,a,w) – it returns the frequency
response at frequencies designated in vector “w”,
normally between 0 and π.
Example:
 Given a causal system
y(n) = 0.9y(n-1) + x(n)
 Find H(z) and sketch its pole-zero plot
 Plot |H(ejw)| and <H(ejw).
 Determine the impulse response h(n)
Systems in The z-Domain
Solution using Matlab:
>> b = [1,0]; a = [1,-0.9];
a. use “zplane” function - >> zplane(b,a);
>>title(‘Pole-Zero Plot’)

 We specified b=[1,0] instead of b=1 because the “zplane”


function assumes that scalars are zeros and poles.
Pole­Zero Plot

0.8

0.6

0.4
Imaginary Part

0.2

0
0  0.9 
­0.2

­0.4

­0.6

­0.8

­1

­1 ­0.5 0 0.5 1
Real Part
Systems in The z-Domain
B. To plot the magnitude and phase response, we
use “freqz” function:
>> [H,w] = freqz(b,a,100);
>> magH = abs(H); phaH = angle(H);
>>
>> subplot(2,1,1); plot(w/pi,magH); grid
>> xlabel('frequency in pi units'); ylabel('Magnitude');
>> title('Magnitude Response')
>> subplot(2,1,2); plot(w/pi,phaH/pi); grid
>> xlabel('Frequency in pi units'); ylabel('Phase in pi units');
>> title('Phase Response')
Systems in The z-Domain
B. The plots:
Magnitude Response
12

10
Magnitude

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
frequency in pi units
Phase Response
0
Phase in pi units

­0.1

­0.2

­0.3

­0.4
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Frequency in pi units
Systems in The z-Domain
B. Points to note:
 We see the plots, the points computed is between
0<w<0.99π
 Short at w = π.
 To overcome this, use the second form of “freqz”:
>> [H,w] = freqz(b,a,200,’whole’);
>> magH = abs(H(1:101)); phaH = angle(H(1:101));
Now the 101st element of the array H will correspond to w =
π.

Similar result can be obtained using the third


form:
 >> w = [0:1:100]*pi/100;
>> H = freqz(b,a,w);
>> magH = abs(H); phaH = angle(H);
Systems in The z-Domain
B. Points to note:
 Also, note that in the plots we divided the “w” and
“phaH” arrays by π so that the plot axes are in
the units of π and easier to read
This is always a recommended practice!

END!!!!

You might also like