find_peaks: Find peaks in chromatographic profile

View source: R/fit_peaks.R

find_peaksR Documentation

Find peaks in chromatographic profile

Description

Find peaks in chromatographic profile.

Usage

find_peaks(
  y,
  smooth_type = "gaussian",
  smooth_window = 1,
  smooth_width = 0.1,
  slope_thresh = 0,
  amp_thresh = 0,
  bounds = TRUE
)

Arguments

y

response (numerical vector)

smooth_type

Type of smoothing. (Defaults to "gaussian").

smooth_window

Window for smoothing. (Defaults to 1).

smooth_width

Width for smoothing. (Defaults to 0.1).

slope_thresh

Minimum threshold for peak slope. (Defaults to 0).

amp_thresh

Minimum threshold for peak amplitude. (Defaults to 0).

bounds

Logical. If TRUE, includes peak boundaries in data.frame. (Defaults to TRUE).

Details

Find peaks with function find_peaks by looking for zero-crossings in the smoothed first derivative of a signal that exceed a given slope threshold.

Value

If bounds == TRUE, returns a data.frame containing the center, start, and end of each identified peak. Otherwise, returns a numeric vector of peak centers. All locations are expressed as indices.

Note

The find_peaks function is adapted from matlab code in Prof. Tom O'Haver's Pragmatic Introduction to Signal Processing.

Author(s)

Ethan Bass

References

O'Haver, Tom. Pragmatic Introduction to Signal Processing: Applications in scientific measurement. /hrefhttps://terpconnect.umd.edu/~toh/spectrum/ (Accessed January, 2022).

See Also

fit_peaks, get_peaks

Examples

data(Sa_pr)
find_peaks(Sa_pr[[1]][,"220"])

chromatographR documentation built on Aug. 24, 2022, 9:06 a.m.