smooth_intens: Smooth spectral intensities

View source: R/smooth_intens.R

smooth_intensR Documentation

Smooth spectral intensities

Description

This smoother can enhance the signal to noise ratio of the data and uses a Savitzky-Golay filter with a running window of data points and the polynomial specified.

Usage

smooth_intens(x, ...)

## S3 method for class 'formula'
smooth_intens(formula, data = NULL, ...)

## S3 method for class 'data.frame'
smooth_intens(x, ...)

## Default S3 method:
smooth_intens(x, y, p = 3, n = 11, make_rel = TRUE, ...)

Arguments

x

a numeric vector containing the spectral wavenumbers; alternatively a data frame containing spectral data as "wavenumber" and "intensity" can be supplied.

formula

an object of class 'formula' of the form intensity ~ wavenumber.

data

a data frame containing the variables in formula.

y

a numeric vector containing the spectral intensities.

p

polynomial order for the filter

n

number of data points in the window, filter length (must be odd).

make_rel

logical; if TRUE spectra are automatically normalized with make_rel().

...

further arguments passed to sgolay().

Details

This is a wrapper around the filter function in the signal package to improve integration with other Open Specy functions. A typical good smooth can be achieved with 11 data point window and a 3rd or 4th order polynomial.

Value

smooth_intens() returns a data frame containing two columns named "wavenumber" and "intensity".

Author(s)

Win Cowger, Zacharias Steinmetz

References

Savitzky A, Golay MJ (1964). “Smoothing and Differentiation of Data by Simplified Least Squares Procedures.” Analytical Chemistry, 36(8), 1627–1639.

See Also

sgolay()

Examples

data("raman_hdpe")

smooth_intens(raman_hdpe)


OpenSpecy documentation built on July 6, 2022, 5:07 p.m.