Learn R Programming

gsignal (version 0.3-1)

triang: Triangular window

Description

Return the filter coefficients of a triangular window of length n.

Usage

triang(n)

Arguments

n

Window length, specified as a positive integer.

Value

triangular window, returned as a vector. If you specify a one-point window (n = 1), the value 1 is returned.

Details

Unlike the Bartlett window, triang does not go to zero at the edges of the window. For odd n, triang(n) is equal to bartlett(m + 2) except for the zeros at the edges of the window.

See Also

bartlett

Examples

Run this code
# NOT RUN {
t <- triang(64)
plot (t, type = "l", xlab = "Samples", ylab =" Amplitude")

# }

Run the code above in your browser using DataLab