Learn R Programming

OpenSpecy (version 1.2.0)

subtr_baseline: Automated background subtraction for spectral data

Description

This baseline correction routine iteratively finds the baseline of a spectrum using a polynomial fitting or accepts a manual baseline.

Usage

subtr_baseline(x, ...)

# S3 method for default subtr_baseline(x, ...)

# S3 method for OpenSpecy subtr_baseline( x, type = "polynomial", degree = 8, raw = FALSE, baseline, make_rel = TRUE, ... )

Value

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

Arguments

x

a list object of class OpenSpecy.

type

one of "polynomial" or "manual" depending on whether you want spectra to be corrected with a manual baseline or with polynomial baseline fitting.

degree

the degree of the polynomial. Must be less than the number of unique points when raw is FALSE. Typically a good fit can be found with a 8th order polynomial.

raw

if TRUE, use raw and not orthogonal polynomials.

baseline

an OpenSpecy object containing the baseline data to be subtracted.

make_rel

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

...

further arguments passed to poly().

Author

Win Cowger, Zacharias Steinmetz

Details

This is a translation of Michael Stephen Chen's MATLAB code written for the imodpolyfit routine from Zhao et al. 2007.

References

Chen MS (2020). Michaelstchen/ModPolyFit. MATLAB. Retrieved from https://github.com/michaelstchen/modPolyFit (Original work published July 28, 2015)

Zhao J, Lui H, McLean DI, Zeng H (2007). “Automated Autofluorescence Background Subtraction Algorithm for Biomedical Raman Spectroscopy.” Applied Spectroscopy, 61(11), 1225–1232. tools:::Rd_expr_doi("10.1366/000370207782597003").

See Also

poly(); smooth_intens()

Examples

Run this code
data("raman_hdpe")

subtr_baseline(raman_hdpe)

Run the code above in your browser using DataLab