Professional Documents
Culture Documents
1
6 y(n ) 5 y ( n 1) + y ( n 2) = n , n 0
4
and
y (n 1) = 1, y (n 2) = 0
Z-Transform in Matlab
Z-transform is defined as
X ( z ) = x( n) z n
Taking z-transform
6Y ( z ) 5 {z 1Y ( z ) + y ( 1)} + { z 2Y ( z ) + z 1 y ( 1) + y ( 2)} =
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
+ z 2 ) Y ( z ) =
Y ( z) =
1
2
6 5z + z
4z
z 1 + 5 z 1
4z 1
4 z
1
1
4 z 1 z + 5 z
>> syms z n
>> iztrans((4*z/(4*z-1)-z^-1+5)/(6-5*z^-1+z^-2))
Example:
1
u (n )
4n
>> syms z n
>> ztrans(1/4^n)
2z
2z 1
>> syms z n
>> iztrans(2*z/(2*z-1))
ans =
ans =
4*z/(4*z-1)
(1/2)^n
x( n ) =
( 6 5z
4z
4 z 1
X ( z) =
ece308-19- 1
ans =
1/2*(1/4)^n+5/2*(1/2)^n-2*(1/3)^n
Therefore
n
n
n
11 51
1
y(n ) = + 2
2 4 22
3
ece308-19- 2
Therefore
Syntax
[q,r] = deconv(x,h)
Description
[q,r] = deconv(x,h) deconvolves vector x out of vector h, using long division. The
quotient is returned in vector q and the remainder in vector r such that v =
conv(u,q)+r.
If x and h are vectors of polynomial coefficients, convolving them is equivalent to
multiplying the two polynomials, and deconvolution is polynomial division. The result of
dividing h by x is quotient q and remainder r.
Examples
If
x = [1 2 3 4]
h = [10 20 30]
the convolution is
c = conv(x,h)
c=
10 40 100 160 170
Use deconvolution to recover h:
120
[q,r] = deconv(c,x)
q=
10 20 30
r=
0
0
0
0
0
0
This gives a quotient equal to v and a zero remainder.
Example:
Find the first five term of the inverse z-transform of
1 + 2z 1 + z 2
X (z) =
1 2 z 1 + 4 z 2
>> [r,p,k]=residuez([1,2,1],[1,-2,4])
p=
1.0000 + 1.7321i
1.0000 - 1.7321i
r=
0.3750 - 0.9382i
0.3750 + 0.9382i
k =
0.2500
ece308-19- 3
ece308-19- 4
Pole-zero Diagram
The MatLab function zplane can display the pole-zero
diagram
Example:
1
z 1 + z 2
2
H ( z) =
3 1 2 2
1+ z + z
5
25
>> b=[0 1 1/2];
>> a=[1 3/5 2/25];
>> zplane(b,a)
ece308-19- 5