PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

92 Practical MATLAB® Applications for Engineers


axis([-15 15 -1.2 1.2]);
subplot(3,1,2);
plot(t, Hanwin);
axis([-15 15 -1.2 1.2]);
ylabel(‘Amplitude’);title(‘ [f(t)*Hanning widow] vs. t’);
subplot(3,1,3);
plot(t, Blackwin);
axis([-15 15 -1.2 1.2]);xlabel(‘t’);title(‘[f(t)*Blackman widow] vs.t’)
ylabel(‘Amplitude’)
figure(2)
subplot(2,2,1)
plot(t, Kaiwin);ylabel(‘Amplitude’)
title(‘[f(t)*Kaiser window] vs. t’)
axis([-10 10 -1.2 1.2]);
subplot(2,2,2)
plot(t,Triwin );ylabel(‘Amplitude’);
title(‘[f(t)*Triang. window] vs. t’);axis([-11 11 -1.2 1.2]);
subplot(2,2,3)
plot(t,Boxwin );
ylabel(‘Amplitude’);title(‘[f(t)*Boxcar window] vs. t’);
axis([-11 11 -1.2 1.2]);xlabel(‘t’)
subplot(2,2,4)
plot(t,Barwin );
ylabel(‘Amplitude’)
title(‘[f(t)*Barlett window] vs. t’)
axis([-11 11 -1.2 1.2]);xlabel(‘t’)
Back in the command window, the script fi le explore_window is executed and the results
are shown in Figures 1.77 and 1.78.

1

0

− 1
− 15 − 10 − 5 0 5 10 15

t

1

0

− 1
− 15 − 10 − 5 0 5 10 15

t

1

0

− 1
− 15 − 10 − 5 0 5 10 15

t

[f(t)*Hamming window] versus t

[f(t)*Hanning window] versus t

[f(t)*Blackman window] versus t

Amplitude

Amplitude

Amplitude

FIGURE 1.77
Plots of the windowed function f(t) using the Hamming, Hanning, and Blackman windows of Example 1.20.

Free download pdf