spsga: Savitzky-Golay Smoothing Filter of a Mid-infrared Spectrum

Description Usage Arguments Value Author(s) Examples

Description

This function allows applying a Savitzky-Golay smoothing filter to the mid-infrared spectrum (N spectra= 1).

Usage

1
spsga(spectrum, p = 2, sw = 21)

Arguments

spectrum

matrix. The matrix of FTIR spectra. The first row corresponds to wavenumber; the second row corresponds to absorbances.

p

numeric. Filter order. Defaults to 2.

sw

numeric. Filter length (must be odd). Defaults to 21.

Value

A smoothed spectrum matrix by means of a Savitzky-Golay smoothing filter. The first row corresponds to wavenumber; the second row corresponds to absorbances.

Author(s)

Claudio Pozo Valenzuela [aut, cre] and Saddys Rodriguez-llamazares [aut]

Examples

1
2
3
4
5
data(spData)
# Convert data frame to matrix
spectrum <- as.matrix(t(spData[, c("Wavenumber","A")]))
# Smoothed spectrum
sga <- spsga(spectrum=spectrum, p=2, sw= 21)

spftir documentation built on May 2, 2019, 2:08 a.m.

Related to spsga in spftir...