Learn R Programming

soil.spec (version 2.1.3)

trans: 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)

## 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.
x
an object of class "trans".
...
additional arguments.

Value

  • trans returns a list with class "trans" containing the following components:
  • rawa matrix containing the raw spectra.
  • transa matrix containing the transformed spectra.
  • transformationa character naming the transformation method.

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