Table of Contents
An introduction to the Bartlett window: the impulse response is defined and a brief analysis of the frequency response as compared against the rectangular window. The Bartlett may also be referred to as the “triangular” window due to the shape in the time domain.
Bartlett (Triangular) Window Design Equation
The Bartlett window, or triangular window, is a useful tool in spectral analysis. Applying a window function reduces the sidelobes of the spectral response, reducing the energy from higher frequencies that is aliased into the lower frequencies.
The Bartlett window has two forms, both of which produce the equivalent window. The first is [Oppenheim1999, p.468],
where is the window length. The second form of the Bartlett window is from NumPy’s function,
where . The weights can also be generated using the following python code:
import numpy as np
def createBartlett ( N ):
n = np.arange(0,(N/2))
leftSide = n/((N-1)/2)
if (np.mod(N,2) == 0):
rightSide = leftSide[::-1]
rightSide = leftSide[0:-1][::-1]
window = np.concatenate((leftSide,rightSide))
The impulse response for the Bartlett window with length N=31 is given in Figure 1 and length N=32 in Figure 2.
Frequency Domain Analysis
Figures 3 and 4 give the frequency response of the Bartlett window for lengths N=31 and N=32. The rectangular window is used as a comparison because it is the same as not using any windowing function.
The Bartlett window improves the sidelobes by more than 15 dB in Figure 3 and more than 20 dB in Figure 4.
The Bartlett window has two downsides:
- Additional computations to apply the window,
- Increases the bandwidth of the main lobe.
However the improvement in sidelobe attenuation is well worth the cost and produces an overall superior spectral response.
The Bartlett window improves upon the frequency response of the rectangular window by reducing the sidelobes at the cost of increasing the bandwidth of the main lobe and additional computations needed to apply the window. However, the Bartlett window creates a better spectral response than the rectangular window, which is equivalent to applying no window at all.