trans {soil.spec} | R Documentation |
trans
transforms spectra either by calculation of (i) derivatives, (ii) continuum removal or (iii) wavelet transform. The used functions are (i) locpoly
function in "KernSmooth"
package, (ii) chull
and approx
functions in "KernSmooth"
package and (iii) dwt
function in "wavelets"
package , respectively.
trans(raw, tr = "derivative", order = 1, gap = 21, plot.spectrogram = FALSE) ## S3 method for class 'trans' plot(x,...)
raw |
a matrix containing the raw spectra |
tr |
a character naming the transformation method; see details |
order |
an integer between 0 and 3 giving the order of derivative; the value 0 performs smoothing based on the |
gap |
an integer between 1 and 30 defining the smoothing interval in wavebands |
plot.spectrogram |
specifies whether to plot the spectrogram by default |
x |
an object of class |
... |
additional arguments |
spec.type
uses for spectral transformation (i) the locpoly
function in KernSmooth
package for derivative calculation, (ii) the chull
and approx
functions in "KernSmooth"
package for continuum removal and (iii) the dwt
function in wavelets
package for extraction of wavelet coefficients. Experiences showed for wavelet decomposition that the best ratio of prediction performance and sparse spectral representation is reached when all 128 wavelet coefficients from decomposition level three are taken.
Possible options for tr
are "derivative"
, "continuum removed"
or "wavelet transformed"
.
trans
returns a list with class "trans"
containing the following components:
raw |
a matrix containing the raw spectra. |
trans |
a matrix containing the transformed spectra. |
transformation |
a character naming the transformation method. |
Thomas Terhoeven-Urselmans