savgol {rchemo} | R Documentation |
Savitzky-Golay smoothing
Description
Smoothing by derivation, with a Savitzky-Golay filter, of the row observations (e.g. spectra) of a data set .
The function uses function sgolayfilt
of package signal
available on the CRAN.
Usage
savgol(X, m, n, p, ts = 1)
Arguments
X |
X-data). |
m |
Derivation order. |
n |
Filter length (must be odd), i.e. the number of colums in |
p |
Polynomial order. |
ts |
Scaling factor (e.g. the absolute step between two columns in matrix |
Value
A matrix of the transformed data.
Examples
X <- cassav$Xtest
m <- 1 ; n <- 11 ; p <- 2
Xp <- savgol(X, m, n, p)
oldpar <- par(mfrow = c(1, 1))
par(mfrow = c(1, 2))
plotsp(X, main = "Signal")
plotsp(Xp, main = "Corrected signal")
abline(h = 0, lty = 2, col = "grey")
par(oldpar)
[Package rchemo version 0.1-2 Index]