triang

Triangular window

Syntax

w = triang(L)

Description

example

w = triang(L) returns an L-point triangular window.

Examples

collapse all

Create a 200-point triangular window. Display the result using wvtool.

L = 200;
w = triang(L);
wvtool(w)

Input Arguments

collapse all

Window length, specified as a positive integer.

Data Types: single | double

Output Arguments

collapse all

Triangular window, returned as a column vector.

Algorithms

The coefficients of a triangular window are:

For L odd:

w(n)={2nL+11nL+1222nL+1L+12+1nL

For L even:

w(n)={(2n1)L1nL22(2n1)LL2+1nL

References

[1] Oppenheim, Alan V., Ronald W. Schafer, and John R. Buck. Discrete-Time Signal Processing. Upper Saddle River, NJ: Prentice Hall, 1999.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

See Also

Apps

Functions

Introduced before R2006a