savgol | R Documentation |
Smoothing by derivation, with a Savitzky-Golay filter, of the row observations (usually spectra) of a data set .
The function uses function sgolayfilt
.
savgol(X, m, n, p, ts = 1)
X |
A matrix or data frame. The column names of |
m |
A derivation order. |
n |
A filter length (must be odd), i.e. number of colums in matrix |
p |
A polynomial order. |
ts |
A scaling factor (e.g. the step between two wavelengths in matrix |
savgol
uses functions sgolayfilt
and sgolay
of package signal
.
A matrix of the transformed data.
X <- datcass$Xu
m <- 1 ; n <- 11 ; p <- 3
z <- savgol(X, m, n, p)
headm(X)
headm(z)
oldpar <- par(mfrow = c(1, 1))
par(mfrow = c(1, 2))
plotsp(X, main = "Signal")
plotsp(z, zeroes = TRUE, main = "Corrected signal")
par(oldpar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.