{ } Raw JSON

bundles / scipy latest / scipy / signal / _peak_finding_utils / _peak_widths

cython_function_or_method

scipy.signal._peak_finding_utils:_peak_widths

Signature

def   _peak_widths ( x peaks rel_height prominences left_bases right_bases )

Summary

Calculate the width of each each peak in a signal.

Parameters

x : ndarray

A signal with peaks.

peaks : ndarray

Indices of peaks in x.

rel_height : np.float64

Chooses the relative height at which the peak width is measured as a percentage of its prominence (see peak_widths).

prominences : ndarray

Prominences of each peak in peaks as returned by peak_prominences.

left_bases, right_bases : ndarray

Left and right bases of each peak in peaks as returned by peak_prominences.

Returns

widths : ndarray

The widths for each peak in samples.

width_heights : ndarray

The height of the contour lines at which the widths where evaluated.

left_ips, right_ips : ndarray

Interpolated positions of left and right intersection points of a horizontal line at the respective evaluation height.

Raises

: ValueError

If the supplied prominence data doesn't satisfy the condition 0 <= left_base <= peak <= right_base < x.shape[0] for each peak or if peaks, left_bases and right_bases don't share the same shape. Or if rel_height is not at least 0.

Warnings

PeakPropertyWarning

If a width of 0 was calculated for any peak.

Notes

This is the inner function to peak_widths.

Aliases

  • scipy.signal._peak_finding._peak_widths