sig_noise: Calculate signal and noise metrics for OpenSpecy objects

View source: R/sig_noise.R

sig_noiseR Documentation

Calculate signal and noise metrics for OpenSpecy objects

Description

This function calculates common signal and noise metrics for OpenSpecy objects.

Usage

sig_noise(x, ...)

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

## S3 method for class 'OpenSpecy'
sig_noise(
  x,
  metric = "run_sig_over_noise",
  na.rm = TRUE,
  step = 20,
  sig_min = NULL,
  sig_max = NULL,
  noise_min = NULL,
  noise_max = NULL,
  abs = T,
  ...
)

Arguments

x

an OpenSpecy object.

metric

character; specifying the desired metric to calculate.

na.rm

logical; indicating whether missing values should be removed when calculating signal and noise. Default is TRUE.

step

numeric; the step size of the region to look for the run_sig_over_noise option.

sig_min

numeric; the minimum wavenumber value for the signal region.

sig_max

numeric; the maximum wavenumber value for the signal region.

noise_min

numeric; the minimum wavenumber value for the noise region.

noise_max

numeric; the maximum wavenumber value for the noise region.

abs

logical; whether to return the absolute value of the result Options include "sig" (mean intensity), "noise" (standard deviation of intensity), "sig_times_noise" (absolute value of signal times noise), "sig_over_noise" (absolute value of signal / noise), "run_sig_over_noise" (absolute value of signal / noise where signal is estimated as the max intensity and noise is estimated as the height of a low intensity region.), "log_tot_sig" (sum of the inverse log intensities, useful for spectra in log units), or "tot_sig" (sum of intensities).

...

further arguments passed to subfunctions; currently not used.

Value

A numeric vector containing the calculated metric for each spectrum in the OpenSpecy object.

See Also

restrict_range()

Examples

data("raman_hdpe")

sig_noise(raman_hdpe, metric = "sig")
sig_noise(raman_hdpe, metric = "noise")
sig_noise(raman_hdpe, metric = "sig_times_noise")


OpenSpecy documentation built on Nov. 26, 2023, 1:09 a.m.