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, ...)

## Default S3 method:
smooth_intens(x, ...)

## S3 method for class 'OpenSpecy'
smooth_intens(
  x,
  polynomial = 3,
  window = 11,
  derivative = 1,
  abs = TRUE,
  make_rel = TRUE,
  ...
)

Arguments

x

an object of class OpenSpecy.

polynomial

polynomial order for the filter

window

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

derivative

the derivative order if you want to calculate the derivative. Zero (default) is no derivative.

abs

logical; whether you want to calculate the absolute value of the resulting output.

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 an OpenSpecy object.

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 Nov. 26, 2023, 1:09 a.m.