Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

1.

Q3_49
% Program Q3_49
% Given the poles and zeros of G(z), compute and
display the rational
% z-transform.
clf;
% initialize
z = [0.3 2.5 -0.2+i*0.4 -0.2-i*0.4]';
p = [0.5 -0.75 0.6+i*0.7 0.6-i*0.7]';
k = 3.9;
% find numerator and denominator polynomial
coefficients
[num den] = zp2tf(z,p,k)
Command window
num =

3.9000 -9.3600 -0.6630 -1.0140 0.5850

den =

1.0000 -0.9500 0.1750 0.6625 -0.3187

Ham truyen
−0 −1 −2 −3 −4
3.9 z −9.3 z −0.663 z −1.014 z +0.585 z
G(z)= −0 −1 −2 −3 −4
1 z −0.95 z + 0.17 z + 0.6625 z −0.3187 z
2.Q3_50
% Program Q3_50
% Given numerator and denominator coefficient vectors for G(z),
% find and plot the first L samples of the impulse response, where
% the parameter L is input by the user.
%
clf;
% initialize
num = [2 5 9 5 3];
den = [5 45 2 1 1];
% Query user for parameter L
L = input('Enter the number of samples L: ');
% find impulse response
[g t] = impz(num,den,L);
%plot the impulse response
stem(t,g);
title(['First ',num2str(L),' samples of impulse response']);
xlabel('Time Index n');
ylabel('h[n]');

L=50

3.Q3_51
% Program Q3_51
% Given numerator and denominator coefficient vectors for G(z),
% find and plot the first L samples of the impulse response, where
% the parameter L is input by the user.
%
clf;
% initialize
num = [2 5 9 5 3];
den = [5 45 2 1 1];
% partial fraction expansion
[r p k] = residuez(num,den)

Command window
r=

0.3109 + 0.0000i
-1.0254 - 0.3547i
-1.0254 + 0.3547i
-0.8601 + 0.0000i

p=

-8.9576 + 0.0000i
0.1147 + 0.2627i
0.1147 - 0.2627i
-0.2718 + 0.0000i

k=

3.0000
0.3109 −1.0254−0.3547 j −1.0254+ 0.3547 j −0.8601
−1 +3
G(z)= −1
+ −1
+ −1
+
1+ 8.9576 z 1−(0.1147+ 0.2627 j)z 1−(0.1147 +0.2627 j) z 1+0.2718 z

4.Q4_2

You might also like