Signal Processing Toolbox |
Basic Shapes
The basic window is the rectangular window, a vector of ones of the appropriate length. A rectangular window of length 50 is
This toolbox stores windows in column vectors by convention, so an equivalent expression is
To use the Window Design and Analysis Tool to create this window, type
wintool
opens with a default Hamming window. In the Current Window Information panel, set Type = Rectangular and Length = 50 and then press Apply.
The Bartlett (or triangular) window is the convolution of two rectangular windows. The functions bartlett
and triang
compute similar triangular windows, with three important differences. The bartlett
function always returns a window with two zeros on the ends of the sequence, so that for n
odd, the center section of bartlett(n+2)
is equivalent to triang(n)
:
bartlett(7) ans = 0 0.3333 0.6667 1.0000 0.6667 0.3333 0 triang(5) ans = 0.3333 0.6667 1.0000 0.6667 0.3333
For n
even, bartlett
is still the convolution of two rectangular sequences. There is no standard definition for the triangular window for n
even; the slopes of the line segments of the triang
result are slightly steeper than those of bartlett
in this case:
w = bartlett(8); [w(2:7) triang(6)] ans = 0.2857 0.1667 0.5714 0.5000 0.8571 0.8333 0.8571 0.8333 0.5714 0.5000 0.2857 0.1667
You can see the difference between odd and even Bartlett windows in WinTool.
The final difference between the Bartlett and triangular windows is evident in the Fourier transforms of these functions. The Fourier transform of a Bartlett window is negative for n
even. The Fourier transform of a triangular window, however, is always nonnegative. The following figure, which is a zoomed version of the Frequency domain plot of 8-point Bartlett and Triangular windows with the y-axis set to Zerophase, illustrates this difference.
This difference can be important when choosing a window for some spectral estimation techniques, such as the Blackman-Tukey method. Blackman-Tukey forms the spectral estimate by calculating the Fourier transform of the autocorrelation sequence. The resulting estimate might be negative at some frequencies if the window's Fourier transform is negative (see Kay [1], pg. 80).
Windows | Generalized Cosine Windows |
© 1994-2005 The MathWorks, Inc.