spectralAnalysis (version 4.3.3)

smooth: generic smoothing function

Description

smoothing is applied along the spectral axis, not the time axis

Usage

smooth(object, ...)

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

# S4 method for SpectraInTimeComp smooth(object, ...)

Value

SpectraInTime-class

Arguments

object

a S4 class object

...

additional parameters

method

character vector smoothing method, options are 'sg' (= default, Savitsky-Golay filter) or 'mean'.

order

numeric value, order of the polynomial used to interpolate (only used when method = 'sg'), should be larger than derivative order, defaults to 3 + derivative

window

width of the smoothing default value slightly higher than in the signal package, the user might consider a large value, otherwise smoothing has little effect

derivative

derivative to be taken (only used when method = 'sg'), defaults to 0

dim

character string, specifying along which dimension smoothing should be applied. Options are "spectralAxis" (= default) or "time"

Examples

Run this code
# \donttest{
    spectralEx     <-  getSpectraInTimeExample()
    smoothDefault   <-  smooth( spectralEx )
    timeRange       <-  range( getTimePoints( spectralEx ))
    timesToSelect   <-  e( seq( timeRange[1] , timeRange[2] , length.out = 5  )  )
    smoothALot      <-  smooth( spectralEx ,  order = 2 , window = 301  ) 
    derivative1     <-  smooth( spectralEx , derivative = 1 )   
    derivative2     <-  smooth( spectralEx , derivative = 2 )
    # }

Run the code above in your browser using DataLab