Next  |  Prev  |  Up  |  Top  |  Index  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

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  |  Prev  |  Up  |  Top  |  Index  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

[How to cite this work]  [Order a printed hardcopy]  [Comment on this page via email]

``Spectral Audio Signal Processing'', by Julius O. Smith III, W3K Publishing, 2011, ISBN 978-0-9745607-3-1.
Copyright © 2022-02-28 by Julius O. Smith III
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University
CCRMA