PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

DTFT, DFT, ZT, and FFT 541


Example 5.13

The system difference equation of an LTI system is given by

g(n) = 0.7g(n − 1) − 0.3g(n − 2) + f(n) + 0.9f(n − 1)

a. Determine by hand the discrete-transfer function H(z) = G(z)/F(z).
b. Determine by hand H(ejW).
c. Obtain the plots of the input f(n) versus n and output gf (n) versus n at steady
state (Figure 5.56), over the range 1 ≤ n ≤ 50, assuming that the input is f(n) =
(0.5)nsin(0.033πn)u(n), using the MATLAB command fi lter.
d. Obtain the plot of the impulse response h(n) by using the MATLAB command impz
and g(n) by using convolution (Figure 5.57), over the range 1 ≤ n ≤ 50. Let gc(n)
denote the convolution of h(n) with f(n) (time domain) and gf (n) be the system out-
put obtained by the fi lter command (frequency domain).
e. Evaluate and plot the magnitude and phase of fft[gf (n)] and fft[gc(n)], over the range
1 ≤ k ≤ 50 (Figure 5.58).
f. Estimate and plot (Figure 5.59) the error of the above two methods (gf (n) and gc (n))
in the time domain defi ned by the following relation:

error(n) = gf (n) – gc(n), over 1 ≤ n ≤ 50

− 2000 − 1500

0

0.2

0.4

Magnitude

0.6

0.8

− 1000 − (^5000)
Index n
500 1000 1500 2000
2
1
Phase
0
− 1
− 2
− 3 − 2 − 10
frequency w
12 3
× 104
error mag.=abs[FT[f(t)]]-abs[DFT[f(n)]] versus w
error phase=angle[FT[f(t)]]-angle[DFT[f(n)]] versus w
FIGURE 5.55
Error plot of FT[f(n)] with respect to DFT[f(n)] of Example 5.12.

Free download pdf