50 Practical MATLAB® Applications for Engineers
wham = hamming(31);
whan = hanning(31);
wblac = blackman(31);
plot(n,wham,’*’,n,whan,’d’,n,wblac,’o’);
hold
plot(n,wham,n,whan,n,wblac);
title(‘HAMMING,HANNING and BLACKMAN windows ‘);
xlabel(‘points n’);
ylabel(‘Amplitude’)
legend(‘HAMM’,’HANN’,’BLAC’);R.1.158 The Kaiser window is a controllable window (controlled by β), and is presented as
follows, by the script fi le Kaisers for the following values of β: 3 , 7 , and 10 , using an
N = 31-point approximation.
MATLAB Solution
% Script file: Kaisers
% This file returns the plots
% KAISER window for betas: 3,7,10.
% using a 31 point approximation
%*******************************
clc;clf;
n = -15:1:15;
wk3 = kaiser(31,3);wk7=kaiser(31,7);HAMMING, HANNING, and BLACKMAN windows
10.90.80.70.60.50.40.30.20.10
− 15 − 10 − 5 0 5 10 15
points nHamm
Hann
BlacAmplitudennFIGURE 1.40
Plots of Hamm, Hann, and Blackman windows of R.1.157.