trans {soil.spec}R Documentation

Spectral transformation

Description

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.

Usage

trans(raw, tr = "derivative", order = 1, gap = 21, 
   plot.spectrogram = FALSE)

## S3 method for class 'trans'
plot(x,...)

Arguments

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

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 "trans"

...

additional arguments

Details

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".

Value

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.

Author(s)

Thomas Terhoeven-Urselmans


[Package soil.spec version 0.2.0 Index]