PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

522 Practical MATLAB® Applications for Engineers


20 30
time index n

(^010405060)
0
0.2
0.4
0.6
Amplitude
0.8
1
f(n) versus t
FIGURE 5.34
Plot of f(n) of Example 5.7.
20
15
10
5
0
20
15
10
5
0
0 50 100 150 200 250
0 50 100 150 200 250
DTFT
DFT for k = 32
DFT for k = 64
DTFT
Amplitude
Amplitude
Index k
Magnitudes of the DTFT and DFT
FIGURE 5.35
Magnitude plots of DTFT and DFT of f(n) of Example 5.7.
subplot(2,1,2)
plot(W,angle(DFT fn))
hold on
plot(WWW,angle(DFT
fn64),‘o’,WWW,angle(DFT _ fn64));
ylabel(‘Phase angle’)
xlabel(‘Index k’)
The script fi le rectang is executed and the results are indicated in Figures 5.34 through
5.36.

Free download pdf