{ } Raw JSON

bundles / scipy 1.17.1 / scipy / signal / _peak_finding_utils / _local_maxima_1d

cython_function_or_method

scipy.signal._peak_finding_utils:_local_maxima_1d

Signature

def   _local_maxima_1d ( x )

Summary

Find local maxima in a 1D array.

Extended Summary

This function finds all local maxima in a 1D array and returns the indices for their edges and midpoints (rounded down for even plateau sizes).

Parameters

x : ndarray

The array to search for local maxima.

Returns

midpoints : ndarray

Indices of midpoints of local maxima in x.

left_edges : ndarray

Indices of edges to the left of local maxima in x.

right_edges : ndarray

Indices of edges to the right of local maxima in x.

Notes

  • Compared to argrelmax this function is significantly faster and can detect maxima that are more than one sample wide. However this comes at the cost of being only applicable to 1D arrays.

  • A maxima is defined as one or more samples of equal value that are surrounded on both sides by at least one smaller sample.

Aliases

  • scipy.signal._peak_finding._local_maxima_1d