hamming: Hamming window

View source: R/hamming.R

hammingR Documentation

Hamming window

Description

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

Usage

hamming(n, method = c("symmetric", "periodic"))

Arguments

n

Window length, specified as a positive integer.

method

Character string. Window sampling method, specified as:

"symmetric"

(Default). Use this option when using windows for filter design.

"periodic"

This option is useful for spectral analysis because it enables a windowed signal to have the perfect periodic extension implicit in the discrete Fourier transform. When "periodic" is specified, the function computes a window of length n + 1 and returns the first n points.

Details

The Hamming window is a member of the family of cosine sum windows.

Value

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

Author(s)

Andreas Weingessel, Andreas.Weingessel@ci.tuwien.ac.at.
Conversion to R by Geert van Boxtel G.J.M.vanBoxtel@gmail.com.

Examples


h <- hamming(64)
plot (h, type = "l", xlab = "Samples", ylab =" Amplitude")

hs = hamming(64,'symmetric')
hp = hamming(63,'periodic')
plot (hs, type = "l", xlab = "Samples", ylab =" Amplitude")
lines(hp, col="red")


gsignal documentation built on Sept. 12, 2024, 6:27 a.m.