View source: R/generic_filters.R
movAv | R Documentation |
Moving average filter
movAv(x, winSec, incSec = NA, remove = FALSE, SR = frequency(x))
x |
A time-series or numeric vector |
winSec |
Size of the moving window, in seconds |
incSec |
Size of each window increment, in seconds. If NA a new window is calculated for every sample. |
remove |
If true, the function subtracts the rolling average from the the original signal, acting as a high-pass filter. |
SR |
The frequency of x, i.e. samples per second |
The burn-in sequence has length of winSec/2 while the burn-out sequence might be longer as not all combinations of winSec and incSec may perfectly cover any arbitrary x size. The burn-in and burn-out sequences are obtained through linear interpolation from their average value to the first or last values of the moving average series. The exact number of windows is given by ceiling((length(x)-win+1)/inc) where win and inc are respectively the window and increment sizes in samples.
A time-series or numeric vector of the same length of x.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.