0% found this document useful (0 votes)
33 views9 pages

Problem #1: Verification of Z-Transform Expression of A Causal Sequence

Download as doc, pdf, or txt
Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1/ 9

Copyrights Jalal Saqib

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.

b) Let ( ) = [(1/2) + (1/3) ] ( ). Compute its z-transform, ( ).


1 1
()= +

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:

Impulse Response of a causal and stable system


Consider a third-order causal and stable system given by:
1 2 ( ) = 1 + 0.9 1 + 0.6 2 + 0.05 3
a) Plot the pole-zero pattern using zplane().
num=[1 0 -1];
den=[1 0.9 0.6 0.05];
zplane(num,den)
Copyrights Jalal Saqib

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)

Now the plot using impz()


num=[1 0 -1];
den=[1 0.9 0.6 0.05];
impz(num,den)
Copyrights Jalal Saqib

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)

So the expression derived from this above result is

2.176 1.5880.1409 1.588+0.1409


()= + +
1(0.0956) 1
1(0.4022+0.6011 ) 1
1(0.40220.6011 ) 1

By solving and simplifying the sequence obtained is


[ ] = 2.176(0.0956) ( ) + 3.176(0.7233) cos(2.1605 ) ( )
+ 0.2818(0.7233) sin(2.1605 ) ( )

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:

Response of an LTI system


The response of an LTI system to the input ( ) = (14) ( ) is ( )= 5(34) ( ).
a) Find the impulse response [ ] of the system. 4

()= 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 ( ) = ( ) ( )

( ) 3(205 1) 2.7 3.8

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().

For the impulse response in part (a)


n=-10:20;
imp=[zeros(1,10) 1 zeros(1,20)];
h=filter([20 -5],[4 -3],imp);
stem(n,h)

For the output y(n) in part (b).


n=-10:20;
x1=(1/3).^n .*unt;
y1=filter([20 -5],[4 -3],x1);
stem(n,y1)

You might also like