DSPRelated.com
Free Books

Matlab for the Bartlett Window:

In matlab, a length $ M$ Bartlett window is designed by the statement

w = bartlett(M);
This is equivalent, for odd $ M$ , to
w = 2*(0:(M-1)/2)/(M-1);
w = [w w((M-1)/2:-1:1)]';
Note that, in contrast to the hanning function, but like the hann function, bartlett explicitly includes zeros at its endpoints:
>> bartlett(3)
ans =
     0
     1
     0
The triang function in Matlab implements the triangular window corresponding to the hanning case:
>> triang(3)
ans =
     0.5000
     1.0000
     0.5000


Next Section:
Matlab for the Hann-Poisson Window
Previous Section:
Conclusions