PeakDetect

PeakDetect[data]

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

PeakDetect[data,σ]

detects peaks that survive Gaussian blurring up to scale σ.

PeakDetect[data,σ,s]

detects peaks with minimum sharpness s.

PeakDetect[data,σ,s,t]

detects only peaks with values greater than t.

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

uses different scales for thresholding sharpness and value.

Details and Options

  • PeakDetect finds local maxima using the given constraints.
  • PeakDetect[data] automatically chooses constraints to return a set of peaks.
  • Input data 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[data,0,0,-] returns all the peaks.
  • PeakDetect[data,σ,s,t] is equivalent to PeakDetect[data,σ,{s,σ},{t,0}].
  • PeakDetect takes a Padding option. By default, Padding->"Reversed" 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->"Reversed" is used:

Specify the 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:

Introduced in 2014
 (10.0)