convnwb.timestamps.peaks.detect_peaks

convnwb.timestamps.peaks.detect_peaks(data, fs, height, distance=None, thresh=None)[source]

Process peaks from a time series.

Parameters:
data1d array

Data to detect peaks from.

fsint

Sampling rate of the time series.

heightfloat

Required minimum height of peaks.

distancefloat, optional

Required minimal number of samples between neighbouring peaks.

threshfloat, optional

A maximum height of peaks. If provided, peaks above this threshold are dropped.

Returns:
peak_inds1d array

Indices of the detected peaks.

peak_times1d array

Timestamps of the detected peaks, in seconds.

peak_heights1d array

Heights of the detected peaks, in units of the original data.