R/hanning.R

`hanning` <-
    function (x, n=7)
{
    j <- 0:(n - 1)
    win <- 1 - cos(2 * pi / (n - 1) * j)
    win <- win / sum(win)
    as.vector(filter(x, win))
}

Try the dplR package in your browser

Any scripts or data that you put into this service are public.

dplR documentation built on Aug. 30, 2023, 9:08 a.m.