Learn R Programming

specmine (version 4.0.0)

raman_normalize: Normalize Raman or SERS spectra

Description

Normalizes Raman or surface-enhanced Raman spectroscopy (SERS) spectra using min-max normalization, L2 vector normalization, or normalization by the maximum intensity near a target silicon peak.

Usage

raman_normalize(
  dataset,
  method = "min-max",
  target_peak = 520,
  search_window = 20
)

Value

A dataset equivalent to dataset, with normalized spectra stored in dataset$data. Information about the selected normalization method and its parameters is stored in

dataset$normalization.

Arguments

dataset

A dataset list containing a numeric matrix in dataset$data, with wavenumbers in rows and samples in columns. For method = "silicon", the dataset must also contain a numeric vector in dataset$wavenumbers, with one value per row of dataset$data.

method

Character string specifying the normalization method. One of "min-max", "L2", or "silicon".

target_peak

Single finite numeric value specifying the target wavenumber of the silicon peak when method = "silicon".

search_window

Positive finite numeric value specifying the half-width of the wavenumber search interval around target_peak when method = "silicon".

Details

The dataset must contain wavenumbers in rows and samples in columns. Each sample spectrum is normalized independently.

Examples

Run this code
dataset = list(
  data = matrix(
    c(
      1, 2, 3, 4, 5,
      2, 4, 6, 8, 10
    ),
    nrow = 5,
    ncol = 2,
    dimnames = list(
      as.character(seq(500, 900, by = 100)),
      paste0("sample", 1:2)
    )
  ),
  wavenumbers = seq(500, 900, by = 100)
)

normalized = raman_normalize(
  dataset,
  method = "min-max"
)

range(normalized$data[, 1])

Run the code above in your browser using DataLab