| Signal Processing Toolbox™ | ![]() |
triang(L)
triang(L) returns an L-point triangular window in the column vector w. The coefficients of a triangular window are:
For L odd:

For L even:

The triangular window is very similar to a Bartlett window. The Bartlett window always ends with zeros at samples 1 and L, while the triangular window is nonzero at those points. For L odd, the center L-2 points of triang(L-2) are equivalent to bartlett(L).
Create a 200-point triangular window and plot the result using WVTool.
L=200; wvtool(triang(L))

[1] Oppenheim, A.V., and R.W. Schafer, Discrete-Time Signal Processing, Prentice-Hall, Englewood Cliffs, NJ, 1989, pp. 447-448.
barthannwin, bartlett, blackmanharris, bohmanwin, nuttallwin, parzenwin, rectwin, window, wintool, wvtool
![]() | tfestimate | tripuls | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |