do_sgolay: Perform Smoothing and / or m-th Derivative

View source: R/gen_coreDataManip.r

do_sgolayR Documentation

Perform Smoothing and / or m-th Derivative

Description

Performs a smoothing and / or the calculation of the m-th derivative on the given dataset using the Savitzky-Golay filter.

Usage

do_sgolay(dataset, p = 2, n = 21, m = 0, exportModel = FALSE)

Arguments

dataset

An object of class 'aquap_data" as produced by gfd or as can be extracted from a 'cube' via getcd.

p

Numeric length one, the order of the filter. Default = 2.

n

Numeric length one, the filter length, must be odd. Default = 21.

m

Numeric length one, Return the m-th derivative of the filter coefficients. Default = 0.

exportModel

Logical. If a possible model should be stored in the set, (leave at FALSE).

Details

The underlying function is sgolayfilt.

Value

Returns the dataset with the NIR-data smoothed or transformed.

See Also

Other Data pre-treatment functions: [,aquap_data-method, do_addNoise(), do_avg(), do_blowup(), do_detrend(), do_emsc(), do_gapDer(), do_msc(), do_resampleNIR(), dpt_modules, selectWls(), ssc()

Other dpt modules documentation: do_detrend(), do_emsc(), do_gapDer(), do_msc(), do_snv(), dpt_modules

Examples

## Not run: 
fd <- gfd() # get the full dataset
fd <- selectWls(fd, 1100, 1800)
fd_avg <- do_avg(fd, n=71) # apply strong smoothing
plot(fd - fd_avg, pg.where="", pg.main="| smoothed subtracted")

## End(Not run)

bpollner/aquap2 documentation built on March 29, 2024, 7:33 a.m.