PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

48 Practical MATLAB® Applications for Engineers


R.1.150 The MATLAB function boxcar(N) returns the N points of a rectangular window
defi ned by


wn

nM
nM

()


||


||





1


0











R.1.151 The MATLAB function Bartlett(N) returns the N points of the Bartlett window
based on the equation


wn
Mn
M

()





R.1.152 There are other popular window models such as Parabolic, Cauchy, and Gaussian
defi ned below. The Parabolic or Parzen window is based on the equation given by


wn
nM
M

() 1


2


 









R.1.153 The Cauchy window is defi ned by the equation given by


wn

M


MnM

()


()








2

(^22)   2
where α is an optional control character.
R.1.154 The Gaussian window is defi ned by the following equation:
wn
nM
M
() exp


1 


2


2

2
 














where α is an optional control character.


R.1.155 All the proposed window models share the characteristic that the peak occurs in
the middle (midpoint) of the window sequence, whereas at its edges (end points)
the behavior tends to be smooth.
The behavior of some of the window models may present side lobes or undesir-
able shapes over some regions. In any case, an attempt is made to present only the
most important and the widely accepted window models without exploring their
behaviors.


R.1.156 For example, create the script fi le windows that returns the plots of the following
windows:
a. Hamming
b. Hanning
c. Blackman


shown in Figure 1.39, using N = 31.


MATLAB Solution
>> n = -15:1:15;
>> WHAM = Hamming(31);
>> WHAN = Hanning(31);
>> WBLAC = Blackman(31);
Free download pdf