Learn R Programming

gsignal (version 0.3-1)

bartlett: Bartlett window

Description

Return the filter coefficients of a Bartlett (triangular) window.

Usage

bartlett(n)

Arguments

n

Window length, specified as a positive integer.

Value

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

Details

The Bartlett window is very similar to a triangular window as returned by the triang function. However, the Bartlett window always has zeros at the first and last samples, while the triangular window is nonzero at those points.

See Also

triang

Examples

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

# }

Run the code above in your browser using DataLab