Signal Processing Toolbox Previous page   Next Page

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):

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:

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).


Previous page  Windows Generalized Cosine Windows Next page

© 1994-2005 The MathWorks, Inc.