sgolayfilt {sgolay} | R Documentation |
Apply a Savitzky-Golay smoothing filter
Description
Smooth data or compute its derivatives with a Savitzky-Golay smoothing filter.
Usage
sgolayfilt(
x,
p = 3,
n = p + 3 - p%%2,
m = 0,
ts = 1,
rowwise = FALSE,
engine = c("auto", "fft", "filter")
)
Arguments
x |
A numeric matrix or vector |
p |
filter order. |
n |
filter length (must be odd). |
m |
return the m-th derivative of the filter coefficients. |
ts |
time scaling factor. |
rowwise |
If |
engine |
How is the filter applied. This parameter impacts the performance, but not the results.
"auto" will select automatically an efficient engine. |
Value
A matrix or vector of the same dimensions or length as x
, with the result of the filter
Examples
x <- runif(300)
y <- sgolayfilt(x, p=2, n = 21)
[Package sgolay version 1.0.3 Index]