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.
Returns
Hann window, returned as a vector.
Details
The Hann window is a member of the family of cosine sum windows. It was named after Julius von Hann, and is sometimes referred to as Hanning, presumably due to its linguistic and formulaic similarities to Hamming window.
Examples
h <- hann(64)plot (h, type ="l", xlab ="Samples", ylab =" Amplitude")hs = hann(64,'symmetric')hp = hann(63,'periodic')plot (hs, type ="l", xlab ="Samples", ylab =" Amplitude")lines(hp, col="red")