Expand description
Peak finding in one-dimensional signals: local maxima selected by height, threshold, distance,
prominence and width, following SciPy’s find_peaks, peak_prominences and peak_widths.
A peak is a sample (or a flat run of samples, a plateau) larger than its neighbours on both sides. Real signals have many such points, most of them noise, so peaks are filtered by properties that describe how much they stand out:
- height: the value itself;
- threshold: the drop to the immediate neighbours;
- distance: the gap to a taller peak (the shorter of two close peaks is removed);
- prominence: how far the peak rises above the higher of the two lowest points that separate it from taller terrain on each side (the topographic prominence of a mountain);
- width: the peak’s width at a given fraction of its prominence below the summit.
See the book entry Peak finding.
Structs§
- Bounds
- An inclusive range
[min, max]; either end may be open. - Peak
Options - The selection criteria of
find_peaks;Nonedisables a criterion. The defaults select every local maximum. - Peaks
- The result of
find_peaks: the indices of the peaks, and the properties computed while selecting them (only those the options required, as in SciPy). - Prominences
- Prominences of peaks and the bases they were measured from.
- Widths
- Widths of peaks: the width, the height at which it was measured, and the interpolated positions of its left and right ends.
Functions§
- find_
peaks - The peaks of
xthat satisfy the criteria inoptions(SciPy’sfind_peaks). - local_
maxima - Local maxima of
x, with the left and right edges of each plateau. A flat run counts once, at its middle sample (rounded down), when the samples on both sides of it are lower. The end samples are never peaks. - peak_
prominences - The prominence of each peak (SciPy’s
peak_prominences). - peak_
widths - The width of each peak at
rel_heightof its prominence below the summit (SciPy’speak_widths): from the peak, walk outwards until the signal drops below that height (or a base is reached), and interpolate linearly between the two samples that straddle it.rel_height = 0.5gives the full width at half prominence;1.0the width at the key col.