548 Practical MATLAB® Applications for Engineers
Error = [part(b)-part(c) versus n68× 10 −^16420− 2− 4− 6
− 5 051015 20 25 30 35
time index nAmplitudeFIGURE 5.62
Time-domain error given by error = part b − part c of Example 5.14.
Example 5.15Create the script fi le analys that analyzes the discrete system transfer function given byHe Ge
Feee
eejW jW
jWjW jW
() jW j W
()
().
..
509
107 032
2and returns the following:
a. The pole/zero plot of H(ejW) (evaluates the system stability) (Figure 5.63)
b. The plot of abs{H(ejW)} versus W (Figure 5.64)
c. The plot of angle {H(ejW)} versus W
d. List all the poles, zeros, and stand alone term of the transfer function H(z=ejW) and
compare the results obtained with the results of part a
e. Determine the ROC of H(z = ejW)
f. The magnitude of the system poles (length from origin)
g. The partial fraction expansion of H(z)
h. h(n) by using the symbolic MATLAB inverse ZT of H(z)MATLAB Solution
%Script file = analys
num = [5 0.9 1];
den = [1 -0.7 0.3];
figure(1)
zplane(num,den); title(‘Pole and zero plot of H(z)’)
figure(2)
W = -pi:pi/99:pi;
[H,W] = freqz(num,den,W);