Learn R Programming

specmine (version 4.0.0)

raman_transform_fourier: Extract Fourier power features from Raman or SERS spectra

Description

Computes one-sided Fourier power spectra for each Raman or surface-enhanced Raman spectroscopy (SERS) sample.

Usage

raman_transform_fourier(dataset, remove_dc = FALSE)

Value

The input dataset, with a fourier element containing:

data

Matrix of one-sided Fourier power features, with frequencies in rows and samples in columns.

frequencies

Numeric vector of normalized frequencies.

remove_dc

Logical value indicating whether the DC component was removed.

n_wavenumbers

Number of original spectral variables.

Arguments

dataset

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

remove_dc

Logical value indicating whether the zero-frequency direct-current component should be excluded from the stored output.

Details

This function follows the specmine Raman workflow by preserving the original spectrum in dataset$data. Fourier features are stored in dataset$fourier$data; their normalized frequencies are stored in dataset$fourier$frequencies.

The input data matrix must have wavenumbers in rows and samples in columns. Each sample is transformed independently.

Examples

Run this code
wavenumbers = seq(400, 1000, length.out = 16)

dataset = list(
  data = cbind(
    sample1 = sin(seq(0, 2 * pi, length.out = 16)),
    sample2 = cos(seq(0, 2 * pi, length.out = 16))
  ),
  wavenumbers = wavenumbers
)

transformed = raman_transform_fourier(dataset)

dim(transformed$fourier$data)

Run the code above in your browser using DataLab