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

Z-Transform & Inverse Z-Transform Using Matlab

The document provides examples of using various MATLAB functions to work with z-transforms, including: - ztrans to compute the z-transform of a sequence - iztrans to compute the inverse z-transform and find the original sequence - residuez to find the partial fraction expansion coefficients and poles - zplane to plot the pole-zero diagram - deconv for long division in power series expansion - freqz to estimate the frequency response from a z-transform
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

Z-Transform & Inverse Z-Transform Using Matlab

The document provides examples of using various MATLAB functions to work with z-transforms, including: - ztrans to compute the z-transform of a sequence - iztrans to compute the inverse z-transform and find the original sequence - residuez to find the partial fraction expansion coefficients and poles - zplane to plot the pole-zero diagram - deconv for long division in power series expansion - freqz to estimate the frequency response from a z-transform
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Inverse z-Transform

Partial Fraction expansion


Examples: Using partial fraction methods, find the inverse z-transform

An example for Simple Real Poles


6 9z

X (z ) =

X (z) =

1 2.5z

+z

6 9z

A2 = (1 2z 1 ) X( z)

=2

z 1 =0.5

A1

(1 0.5 z )(1 2z )

A1 = (1 0.5 z 1) X (z)

X (z ) =

(1 0.5 z )

6 9z 1

(1 2z )

=2

A2
1

(1 2z )

6 9(2)
1 2(2)

6 9 z 1

(1 0.5 z )

4
2
+
1
(1 0.5z ) (1 2 z 1)

z 1 =0.5

4,

6 9(0.5)
1 0.5(0.5)

ROC z > 2

x(n) = 4(0.5)n + 2(2)n u(n )

An example for Multiple Real Poles


F (z ) =

F1 (z ) =

1 0.7z

+ 0.16 z

d
dz

z 1 =

1 0.6z 1

9
1

(1 0.3 z )

A1
A2
A3 z 1
+
+
(1 0.3z 1) (1 0.2z 1) (1 0.2z 1)2

1
(1 0.2z ) z =
1 2

z 1 = 5

(1 0.2z 1)2 zF (z)

(1 0.3z 1) 2 z 1 = 5

F (z ) =

(1 0.3 z 1 )(1 0.2z 1 )2

A3 = (1 0.2z 1) zF(z )

A2 =

0.012 z

A1 = (1 0.3z 1)F( z)

A2 =

1 0.6(5)

1
3

(1 0.2 ) 2
0.2

(1 0.3 z 1) z 1 = 5 1 0.3(5)

=5

(1 0.3(5)) 2

1 =

0.4 ,

z
(1 0.3z 1 ) z(0.3) z 2
=

1
dz (1 0.3 z ) z = 5
z 1 = 5
(1 0.3 z 1) 2

8
1

(1 0.2z )

0.4z

1
1 2

(1 0.2 z )

f (n) = 9(0.3)n 8(0.3)n + 2n (0.3)n u(n )

Z-Transform with MatLab-1

An example for Multiple Real Poles F (z) =

p1 =

b b 2 4ac
2a

1 + 2z 1 + z 2
1 z 1 + 0.3561z 2

o
1 12 4(0.3561)
= 0.5 + j 0.3257 = 0.5967e j 33.08
2

2
o
b + b 2 4ac 1 + 1 4(0.3561)
=
= 0.5 j 0.3257 = 0.5967e j 33.08
2a
2
1 + 2z 1 + z 2
F (z ) =
(1 p1z 1 )(1 p2 z 1 )

p2 =

F (z ) = 2.8082
F1 (z ) =

A1 =

1.8082 4.8082z 1
(1 p1z 1 )(1 p2 z 1)

1.8082 4.8082z 1
A1
A2
=
+
1
1
1
(1 p1z )(1 p2 z ) (1 p1z ) (1 p2 z 1)

1.8082 4.8082z
(1 (0.5 j 0.3257) z1)

1.8082 4.8082z 1
A2 =
(1 (0.5 + j0.3257)z 1)

z 1=

1
0.5 + j 0.3257

4.8082
o
0.5 j 0.3257
= 0.904 j5.993 = 6.06e j 98.58
(0.5 + j 0.3257)
1
(0.5 j 0.3257)

1.8082
z1=

1
0.5 j 0.3257

F (z ) = 2.8082 +

4.8082
o
0.5 + j 0.3257
= + 0.904 + j 5.993 = 6.06e+ j 98.58
(0.5 j 0.3257)
1
(0.5 + j 0.3257)

1.8082

6.06e j 98.58

6.06e j 98.58

o
o

1 0.5967e j 33.08 z 1 1 0.5967e j33.08 z 1


o

f (n) = 2.8082 (n ) + 6.06e j 98.58 (0.5967)n e j 33.08n + 6.06e j 98.58 (0.5967)n e j 33.08n u(n )

f (n) = 2.8082 (n ) + (6.06)(0.5967)n e j 33.08n 98.58 + 6.06(0.5967)n e j (33.08n98.58 ) u (n )

f (n) = 2.8082 (n ) + 12.12(0.5967)n cos(33.08 n 98.58o ) u (n)

Z-Transform with MatLab-2

Z-Transform in Matlab
Z-transform is defined as

X ( z ) = x( n) z n
n =0

or

X ( z ) = Z [ x( n) ]

The inverse z-transform is denoted by


x(n ) = Z 1 [ X (z )]
MatLab Symbolic Toolbox gives the z-transform of a function
Example:

1
u (n )
4n

x (n ) =

X ( z) =

2z
2z 1

>> syms z n
>> ztrans(1/4^n)

>> syms z n
>> iztrans(2*z/(2*z-1))

ans =

ans =

4*z/(4*z-1)

(1/2)^n

Example:
X (z ) =

6 9z
1 2.5z

+z

>> syms z n
>> iztrans((6-9*z^-1)/(1-2.5*z^-1+z^-2))

>> syms z n
>> ztrans (2*2^n+4*(1/2)^n)

ns =

ans =

2*2^n+4*(1/2)^n

z/(1/2*z-1)+8*z/(2*z-1)

Z-Transform with MatLab-3

Power series expansion with the MatLab


The deconv function is used to perform the long division required in power series method.
For given z-transform X(z)
X (z ) =

b0 + b1z
a +az
0

+ ... + b z

+ ... + a z

The matLab command is


>>[q,r]=deconv(b,a)
Example:
1 + 2z

X (z ) =

1 z

+z

+ 0.3561z

>> b=[1 2 1];


>> a=[1 1 0.356];
>> n=5;
>> b=[b zeros(1,n-1)];
>> [x,r]=deconv(b,a);
>> disp(x)
1.0000 3.000 3.6439 2.5756

1.2780

Partial fraction expansion with MatLab


The residuez function is used to find the partial fraction coefficients and poles of the z-transform
For given z-transform X(z)
X (z ) =

b0 + b1z
a +az
0

X (z ) =

r0

1 p1z 1

+ ... + b z

+ ... + a z

+ ... +

rn

1 pn z 1

+k +k z
1

+ ... + k

( m n)

m n 1

The matLab command is


>> [r,p,k]=residues(b,a)
Example:
X (z ) =

1 + 2z
1 z

+z

+ 0.3561z

>> [r,p,k]=residuez([1,2,1],[1, -1,0.3561])


r=
-0.9041 - 5.9928i
-0.9041 + 5.9928i
p=
-0.5000 0.3257i
-0.5000 + 0.3257i
k=2.8082

Z-Transform with MatLab-4

Pole-zero Diagram
zplane command compute and display of the pole-zero diagram of z-function
The command is
>> zplane(b,a)
To display the pole value, use root(a) command. To display the zero value root(b)
Example:
X (z ) =

1 1.6180 z
1 1.5161z

+z

+ 0.878 z

>> b=[1 1.6180 1];


>> a=[1 1.5161 0.878];
>> roots(a)
ans =
0.7581 + 0.5508i
0.7581 - 0.5508i
>> roots (b)
ans =
0.8090 + 0.5878i
0.8090 - 0.5878i
>> zplane(b,a)

Z-Transform with MatLab-5

Frequency Response estimation


The freqz function computes and display the frequency response of given z-transform of the
function.
The command is
>> freqz(b, a, npt, Fs)
where Fs is the sampling frequency, npt is the number of frequency points between 0 and Fs/2.
Example:
X (z ) =

1 1.6180 z
1 1.5161z

+z

+ 0.878 z

>> b=[1 1.6180 1];


>> a=[1 1.5161 0.878];
>>freqz(b,a)

Z-Transform with MatLab-6

You might also like