smooth: generic smoothing function

Description Usage Arguments Note Examples

Description

generic smoothing function

smoothing is applied in the wavelength domain, not in the time domain

Usage

1
2
3
4
5
smooth(object, ...)

## S4 method for signature 'SpectraInTime'
smooth(object, method = "sg", order = 3,
  window = order + 3 - order%%2, derivative = 0)

Arguments

object

a S4 class object

...

additional parameters

method

character vector smoothing method, default = 'sg', i.e Savitsky-Golay filter. currently only implemented smoothing method

order

numeric value, order of the polynomial used to interpolate, should be larger than derivative order, defaults to 3 + derivative

window

width of the smoothing

derivative

derivative to be taken, defaults to 0

Note

equal distances between wavelenght intervals are assumed

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
     spectralEx     <-  getSpectraInTimeExample()
    smoothDefault   <-  smooth( spectralEx )
    timeRange       <-  range( getTimePoints( spectralEx ))
    timesToSelect   <-  e( seq( timeRange[1] , timeRange[2] , length.out = 5  )  )
    # plot( smoothDefault  )
    # plot( smoothDefault[ timesToSelect , ] , type = "time")
    smoothALot      <-  smooth( spectralEx ,  order = 2 , window = 301  ) 
    # plot( smoothALot )
    # plot( smoothALot[  timesToSelect , ] , type = "time" )
    derivative1     <-  smooth( spectralEx , derivative = 1 )
    # plot( derivative1 )
    # plot( derivative1[  timesToSelect ,] , type = "time" )
    
    derivative2     <-  smooth( spectralEx , derivative = 2 )
    # plot(  derivative2 )
    # plot( derivative2[  timesToSelect , ] , type = "time" )
    

spectralAnalysis documentation built on June 12, 2018, 5:04 p.m.