Description
Find a filtered subset of local maxima in 1D slice of data.
The functionality implemented here is might be familiar to anyone using MATLAB's findpeaks
, or Python's scipy.signal.find_peaks
.
Arguably, the most useful feature in this package is filtering peaks through prominence. This parameter allows you to get the subset of local maxima that optically look like peaks even in noisy data.
Filtering conditions that can be set are:
- prominence,
- height,
- the absolute value of the difference between neighboring data points,
- number of plateau points a peak can have,
All parameters can be specified by minimum and maximum bound.
Elements of the data slice need not be of a specific type, as long as they implement a few traits (for cloning, subtraction, comparison).
Example
Copied from examples/spectrum.rs.
use PeakFinder;
use File;
use *;
The result visualized: