FindAllPeaks: Find All Peaks in a Signal

FindAllPeaksR Documentation

Find All Peaks in a Signal

Description

This function finds the indices of all peaks in the given signal vector. A peak is taken to occur whenever a rising part in the signal is followed by a falling part.

Usage

FindAllPeaks(inSignal, inFlatPreference = "center")

Arguments

inSignal

the signal that is scanned for peaks (a numeric vector).

inFlatPreference

preference for choosing exact position in case of flat peaks:

  • if "left", the leftmost point of a flat peak is chosen

  • if "center", the center of a flat peak is chosen

  • if "right", the rightmost point of a flat peak is chosen.

If empty or not specified, "center" is used by default.

Value

A numeric vector with the indices of the peaks (could be empty!).

Author(s)

Marc Vidal (R version). Based on the original code from IPEM Toolbox.

Examples

data(SchumannKurioseGeschichte)
Ps <- FindAllPeaks(SchumannKurioseGeschichte)

m-vidal/eaR documentation built on Nov. 18, 2022, 3:55 p.m.