Learn R Programming

specmine (version 4.0.0)

airPLS_fast_dataset: Baseline correction of Raman and SERS spectra using airPLS

Description

Applies adaptive iteratively reweighted penalized least squares (airPLS) baseline correction to Raman or surface-enhanced Raman spectroscopy (SERS) spectra.

Usage

airPLS_fast_dataset(dataset, lambda = 1e+05, max_iter = 50)

Value

A dataset equivalent to dataset, with baseline-corrected values stored in dataset$data. Details of the correction are stored in dataset$baseline.

Arguments

dataset

A dataset list containing a numeric matrix in dataset$data, with wavenumbers in rows and samples in columns.

lambda

Positive numeric smoothing parameter. Larger values produce a smoother estimated baseline.

max_iter

Positive integer giving the maximum number of airPLS iterations.

Details

The dataset is expected to contain spectral variables or wavenumbers in rows and samples in columns. Each sample is baseline-corrected independently. Corrected spectra are shifted so that their minimum intensity is zero.

References

Zhang, Z.-M., Chen, S., and Liang, Y.-Z. (2010). Baseline correction using adaptive iteratively reweighted penalized least squares. Analyst, 135(5), 1138-1146. tools:::Rd_expr_doi("10.1039/B922045C").

Examples

Run this code
set.seed(123)

dataset = list(
  data = matrix(
    rnorm(100, mean = 10, sd = 2),
    nrow = 10,
    dimnames = list(
      paste0("wavenumber", 1:10),
      paste0("sample", 1:10)
    )
  )
)

corrected = airPLS_fast_dataset(
  dataset,
  lambda = 1e4,
  max_iter = 5
)

range(corrected$data)

Run the code above in your browser using DataLab