systole.utils.to_neighbour#
- systole.utils.to_neighbour(signal: ndarray, peaks: ndarray, kind: str = 'max', size: int = 50) ndarray [source]#
Replace peaks with max/min neighbour in a given window.
- Parameters:
- signal
Signal used to maximize/minimize peaks values.
- peaks:
Boolean vector of peaks position.
- kind
Can be ‘max’ or ‘min’.
- size
Size of the time window used to find max/min (samples). Defaults to 50.
- Returns:
- new_peaks:
Boolean vector of peaks position.
- Raises:
- ValueError
If kind is not “max” or “min”.