PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

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
1

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0
− 15 − 10 − 5 0 5 10 15
points n

Hamm
Hann
Blac

Amplitude

n

n

FIGURE 1.40
Plots of Hamm, Hann, and Blackman windows of R.1.157.

Free download pdf