find_peaks_binary#

ethograph.features.changepoints.find_peaks_binary(x, prominence=None, distance=None, height=None, width=None, **kwargs)[source]#

Local maxima + NaN boundaries -> binary mask.

Parameters:
  • x – Input 1-D signal.

  • prominence (float | None) – Minimum peak prominence (how far a peak stands out from its surroundings). Raise it to keep only the clearest peaks.

  • distance (int | None) – Minimum number of samples between neighbouring peaks.

  • height (float | None) – Minimum absolute value of a peak.

  • width (float | None) – Minimum peak width in samples.

  • **kwargs – Any further scipy.signal.find_peaks keyword.

Returns:

Binary array of the same length as x, 1 at peaks and NaN boundaries.