find_peaks | R Documentation |
Detects peaks in chromatographic profile.
find_peaks(
y,
smooth_type = c("gaussian", "box", "savgol", "mva", "tmva", "none"),
smooth_window = 0.001,
slope_thresh = 0,
amp_thresh = 0,
bounds = TRUE
)
y |
Signal (as a numerical vector). |
smooth_type |
Type of smoothing. Either gaussian kernel ( |
smooth_window |
Smoothing window. Larger values of this parameter will
exclude sharp, narrow features. If the supplied value is between 0 and
1, window will be interpreted as a proportion of points to include. Otherwise,
the window will be the absolute number of points to include in the window.
(Defaults to |
slope_thresh |
Minimum threshold for slope of the smoothed first
derivative. This parameter filters on the basis of peak width, such that
larger values will exclude broad peaks from the peak list. (Defaults to
|
amp_thresh |
Minimum threshold for peak amplitude. This parameter
filters on the basis of peak height, such that larger values will
exclude small peaks from the peak list. (Defaults to |
bounds |
Logical. If TRUE, includes peak boundaries in data.frame.
(Defaults to |
Detects peaks by looking for zero-crossings in the smoothed first derivative of
the signal (y
) that exceed the specified slope threshold
(slope_thresh
). Additionally, peaks can be filtered by supplying a minimal
amplitude threshold (amp_thresh
), filtering out peaks below the
specified height. Smoothing is intended to prevent the algorithm from
getting caught up on local minima and maxima that do not represent true
features. Several smoothing options are available, including "gaussian"
,
box kernel ("box"
), savitzky-golay smoothing ("savgol"
),
moving average ("mva"
), triangular moving average ("tmva"
), or
no smoothing ("none"
).
It is recommended to do pre-processing using the preprocess
function before peak detection. Overly high chromatographic resolution can
sometimes cause peaks to be split into multiple segments. In this case,
it is recommended to increase the smooth_window
or reduce the
resolution along the time axis by adjusting the dim1
argument during
preprocessing.
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.
The find_peaks
function is adapted from MATLAB code included in
Prof. Tom O'Haver's
Pragmatic Introduction to Signal Processing.
Ethan Bass
O'Haver, Tom. Pragmatic Introduction to Signal Processing: Applications in scientific measurement. https://terpconnect.umd.edu/~toh/spectrum/ (Accessed January, 2022).
fit_peaks
, get_peaks
data(Sa_pr)
find_peaks(Sa_pr[[1]][,"220"])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.