spmws: Moving-average Smoothing Filter of a Mid-infrared Spectrum

Description Usage Arguments Value Author(s) Examples

Description

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

Usage

1
spmws(spectrum, N = 21)

Arguments

spectrum

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

N

numeric. Length of the smoothing window. Defaults to 21.

Value

A smoothed spectrum matrix by means of a Moving-average 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
mws <- spmws(spectrum = spectrum, N = 21)

Example output

Loading required package: pracma

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

Related to spmws in spftir...