Problem #1: Verification of Z-Transform Expression of A Causal Sequence
Problem #1: Verification of Z-Transform Expression of A Causal Sequence
Problem #1: Verification of Z-Transform Expression of A Causal Sequence
Problem #1:
Verification of Z-transform expression of a causal sequence ( ) using filter()
The filter() function in Matlab can be used to verify the z-transform expression of a causal sequence. Let ( ) be a causal sequence with a rational ( ) = ( )/ ( ) expression.
a) Show that the snippet y = filter(b,a,[1,zeros(1,N)]); will generate the first + 1 samples of ( ) where b and a contain polynomial coefficients of ( ) and ( ),
respectively.
1 (1/2) 1 1 (1/3) 1
By simplifying.
()=
12 1 6 1 2
c) Verify your expression in part (b) using Matlab by comparing the output of the
filter() function with the given sequence.
n=-10:20;
imp=[zeros(1,10) 1 zeros(1,20)];
x=filter([12 -1],[6 -1 -1],imp);
stem(n,x)
The output using filter() is the same as that of the initial sequence as we plot the sequence by:
n=-10:20;
imp=[zeros(1,10) 1 zeros(1,20)];
unt=[zeros(1,10) ones(1,21)];
x=[(1/2).^n].*unt+[(-1/3).^n].*unt
stem(n,x)
Copyrights Jalal Saqib
Problem# 2:
b) Compute and plot the impulse response using the functions filter() and stem().
Compare with the plot obtained using the function impz().
n=-10:20;
num=[1 0 -1];
den=[1 0.9 0.6 0.05];
imp=[zeros(1,10) 1 zeros(1,20)];
h=filter(num,den,imp);
stem(n,h)
c) Use the function residuez() and the z-transform pairs in Table 3.3 of [Proakis-2007] to find an analytical expression for the impulse response [ ].
num=[1 0 -1];
den=[1 0.9 0.6 0.05];
[r,p,k]=residuez(num,den)
d) Compute the first ten samples of [ ] using the formula obtained in Part (c) and compare with the values obtained from the difference equation.
n=-10:20;
unt=[zeros(1,10) ones(1,21)];
x=(-2.176.*(-0.0956.^n) + 3.176.*cos(2.1605*n).*(0.7233.^n) +
0.2818.*sin(2.1605*n).*(0.7233.^n)).*unt
stem(n,x)
Copyrights Jalal Saqib
Problem# 3:
()= 1( ()=
1
1
)
5 1(34) 1
1
20 5
()=
1
43
[ ] = 5(n) + 2.5( ) 1
1
b) Find the output [ ] for the input ( ) = ( ) ( )
1
Here ( ) =
1
1( )
1
As ( ) = ( ) ( )
So =
(43
1
)(3
1
)
=> ( ) =
1(
3
)
1
+
1(
1
)
1
3
4
3 ) ( ) + 3.8(1 ) ( )
[ ] = 2.7(
4 3
Copyrights Jalal Saqib
c) Check the results in (a) and (b) using the function filter().