Type: | Package |
Title: | Efficient Savitzky-Golay Filtering |
Version: | 1.0.3 |
Date: | 2023-03-30 |
URL: | https://github.com/zeehio/sgolay |
BugReports: | https://github.com/zeehio/sgolay/issues |
Description: | Smoothing signals and computing their derivatives is a common requirement in signal processing workflows. Savitzky-Golay filters are a established method able to do both (Savitzky and Golay, 1964 <doi:10.1021/ac60214a047>). This package implements one dimensional Savitzky-Golay filters that can be applied to vectors and matrices (either row-wise or column-wise). Vectorization and memory allocations have been profiled to reduce computational fingerprint. Short filter lengths are implemented in the direct space, while longer filters are implemented in frequency space, using a Fast Fourier Transform (FFT). |
Imports: | signal |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Encoding: | UTF-8 |
RoxygenNote: | 7.2.3 |
Suggests: | covr, RUnit |
NeedsCompilation: | yes |
Packaged: | 2023-03-30 12:59:44 UTC; sergio |
Author: | Sergio Oller Moreno
|
Maintainer: | Sergio Oller Moreno <sergioller@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2023-04-05 20:20:02 UTC |
Objects exported from other packages
Description
These objects are imported from other packages. Follow the links below to see their documentation.
- signal
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)