PeakDetect

PeakDetect[list]

gives a binary list in which 1s correspond to peak positions in list.

PeakDetect[list,σ]

detects peaks that survive Gaussian blurring up to scale σ.

PeakDetect[list,σ,s]

detects peaks with minimum sharpness s.

PeakDetect[list,σ,s,t]

detects only peaks with values greater than t.

PeakDetect[list,σ,{s,σs},{t,σt}]

uses different scales for thresholding sharpness and value.

Details and Options

  • PeakDetect finds local maxima using the given constraints.
  • PeakDetect[list] automatically chooses constraints to return a set of peaks.
  • Input list can be of one of the following forms:
  • {y1,y2,}a list of values
    TimeSeries[]regularly sampled time series object
    EventSeries[]regularly sampled event series object
  • PeakDetect[list,0,0,-] returns all the peaks.
  • PeakDetect[list,σ,s,t] is equivalent to PeakDetect[list,σ,{s,σ},{t,0}].
  • PeakDetect takes a Padding option. By default, Padding->"Reflected" is used.

Examples

open allclose all

Basic Examples  (1)

Find dominant peaks in a list:

Visualize detected peaks:

Scope  (12)

Data  (4)

Peaks of a 1D list:

Peaks of a TimeSeries object:

Peaks of an EventSeries object:

Find peaks:

Peaks of a list of Quantity objects:

Threshold for values greater than 30 meters:

Parameters  (8)

By default, an automatic scale is used:

Find all peaks at scale :

Compute peaks at different scales:

When finding peaks at scale , only peaks that sustain a blur up to scale are returned:

Signal and its blurred version at scale :

By default, peaks are not filtered based on their sharpness, equivalent to :

Specify minimum sharpness value :

Sharpness, defined by the negative second derivative, should be greater than the specified :

Specify a minimum height value :

Apply the value threshold after smoothing the data using a scale :

Options  (1)

Padding  (1)

By default, Padding->"Reflected" is used:

Specify a different padding:

Applications  (3)

Find peaks of the recent sunspot activity:

Peaks in a discrete-time Fourier transform:

Mean daily temperatures for Chicago during a period of two months:

Find peaks in the temperature:

Create a new time series with peaks stored using MetaInformation:

Plot the mean temperatures with warmer days marked:

Possible Issues  (1)

Symmetric twin peaks that merge under Gaussian blurring may survive as peaks:

Wolfram Research (2014), PeakDetect, Wolfram Language function, https://reference.wolfram.com/language/ref/PeakDetect.html (updated 2021).

Text

Wolfram Research (2014), PeakDetect, Wolfram Language function, https://reference.wolfram.com/language/ref/PeakDetect.html (updated 2021).

BibTeX

@misc{reference.wolfram_2021_peakdetect, author="Wolfram Research", title="{PeakDetect}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/PeakDetect.html}", note=[Accessed: 17-October-2021 ]}

BibLaTeX

@online{reference.wolfram_2021_peakdetect, organization={Wolfram Research}, title={PeakDetect}, year={2021}, url={https://reference.wolfram.com/language/ref/PeakDetect.html}, note=[Accessed: 17-October-2021 ]}

CMS

Wolfram Language. 2014. "PeakDetect." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/PeakDetect.html.

APA

Wolfram Language. (2014). PeakDetect. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PeakDetect.html