trans: Spectral transformation

Description Usage Arguments Details Value Author(s)

View source: R/trans.R

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

1
2
3
4
5
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


soil.spec documentation built on May 30, 2017, 2:19 a.m.

Related to trans in soil.spec...