The Triangular window

The Triangular window, also known as the Bartlett–Fejér window, is a window function that linearly tapers the signal toward the ends but, unlike the Bartlett window, does not reach zero at the boundaries. This subtle difference gives it slightly better frequency resolution while maintaining computational simplicity.

The Triangular window is often confused with the Bartlett window. In the Bartlett window, the endpoints are forced to zero. In the Triangular window, the endpoints are non-zero, equal to 1/(M+1) for odd length N = 2M + 1.

\[ w(n) = 1 - \frac{\left| n - \frac{N-1}{2} \right|}{\frac{N-1}{2}}, \quad 0 \le n \le N-1 \]

For odd N, the endpoints evaluate to 1/(N-1) rather than zero. For even N, the formula requires special handling to maintain symmetry.

Time-Domain Effect: The original signal (gray) continues with full amplitude to the edges, while the Triangular-windowed signal (orange) is linearly tapered, but the endpoints are not zero – note the small but non-zero values at both ends.
Frequency-Domain Comparison: The rectangular window (red) shows strong spectral leakage, with side lobes only 15–30 dB below the main peak. The Triangular window (orange) provides moderate side lobe suppression similar to Bartlett, with first side lobes at approximately -26 dB.

The Triangular window reduces edge discontinuities by linearly tapering the signal toward the ends, but unlike the Bartlett window, it does not force the endpoints to zero. This subtle difference gives the Triangular window a slightly narrower main lobe compared to Bartlett, at the cost of slightly higher near side lobes.

The first side lobe of the Triangular window is attenuated to approximately -26 dB, with a roll-off rate of -12 dB per octave. In comparison, the Hann window achieves -31 dB with -18 dB per octave roll-off, while the Hamming window reaches -41 dB with -6 dB per octave roll-off.

Key Difference: Triangular vs Bartlett

The Triangular window is often confused with the Bartlett window. The table below clarifies the distinction:

Property              Bartlett              Triangular
Endpoints             Exactly zero          Non-zero (1/(M+1) for odd N)
Peak value            1.0                   1.0
Formula               1 - 2|n|/(N-1)        1 - |n|/m where m = (N-1)/2
Main lobe width       ~0.07                 ~0.08
First sidelobe        -26 dB                -26 dB
Roll-off              -12 dB/oct            -12 dB/oct

For most DSP applications, the difference is negligible. However, the Triangular window (with non-zero endpoints) has slightly better frequency resolution due to its narrower main lobe, while the Bartlett window has slightly lower near side lobes due to the forced zero endpoints.

Use Case: Low-Cost Embedded Systems and Real-Time Processing

Like the Bartlett window, the Triangular window's main advantage is computational simplicity. It requires only subtraction, absolute value, and division – no trigonometric functions. This makes it attractive for:

  • Low-cost microcontrollers without FPU (floating-point unit)
  • Real-time applications on limited hardware
  • FPGA implementations with minimal logic elements
  • Low-power IoT sensors performing vibration monitoring
  • Educational demonstrations of windowing concepts

Trade-offs and Limitations

The Triangular window provides a compromise between the rectangular window (no leakage reduction) and smoother cosine-based windows. Its main limitations are:

  • Moderate side lobe suppression – First side lobe at only -26 dB, compared to -31 dB for Hann and -41 dB for Hamming
  • Slower roll-off – Side lobes fall off at -12 dB per octave, compared to -18 dB per octave for Hann and Blackman
  • Linear rather than smooth tapering – The discontinuity in the first derivative at the center creates higher far side lobes
  • Non-zero endpoints – Unlike Bartlett, the endpoints are not zero, creating a small but non-zero discontinuity at the segment boundaries

When applied to a signal, the Triangular window reduces discontinuities at the boundaries, similar to other window functions. However, because the endpoints are non-zero, there is still a small jump when the signal is repeated periodically, which contributes to spectral leakage.

Triangular vs Bartlett: Which to Choose?

  • Choose Bartlett – If zero endpoints are required (e.g., for convolution or when periodic extension is critical)
  • Choose Triangular – If slightly better frequency resolution is desired and non-zero endpoints are acceptable
  • Choose Hann – If better spectral performance is needed regardless of computational cost

Conclusion

The Triangular window is best suited for applications where computational efficiency is the primary concern and spectral performance requirements are modest. Its first side lobe is attenuated to approximately -26 dB, with a roll-off of -12 dB per octave. While it improves over the rectangular window by reducing edge discontinuities, it is outperformed by cosine-based windows like Hann, Hamming, and Blackman in terms of spectral purity. For low-cost embedded systems, real-time processing on limited hardware, or educational demonstrations of windowing concepts, the Triangular window remains a useful and practical choice.

The key distinction from the Bartlett window is the non-zero endpoints, which give the Triangular window slightly better frequency resolution at the cost of slightly higher near side lobes.

See also: The Triangular Window implementation | Bartlett Window | Bartlett Window Implementation