WOLFRAM

FindPeaks[list]

gives positions and values of the detected peaks in list.

FindPeaks[list,σ]

finds peaks that survive Gaussian blurring up to scale σ.

FindPeaks[list,σ,s]

finds peaks with minimum sharpness s.

FindPeaks[list,σ,s,t]

finds only peaks with values greater than t.

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

uses different scales for thresholding sharpness and value.

Details and Options

  • FindPeaks finds local maxima using the given constraints, returning the result as {{x1,y1},{x2,y2},}.
  • 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
  • FindPeaks[list] automatically chooses scale, sharpness and threshold parameters.
  • To avoid the detection of noise-related peaks, the input is regularized by performing a Gaussian filtering using the standard deviation σ.
  • The value of σ defaults to , with n being the number of data points in list. Larger values for σ reduce the number of peaks.
  • Peaks detected in the regularized data are traced back to the corresponding peaks in the original data.
  • By default, peaks are not filtered based on their sharpness (). The sharpness s is computed as the second derivative of the data with a Gaussian filter at scale σ. Specify a smaller scale using {s,σs}.
  • By default, peaks of any height are returned. Use a threshold t to dismiss peaks with smaller values. To apply the threshold at a scale other than 0, use {t,σt}.
  • FindPeaks[list,σ,s,t] is equivalent to FindPeaks[list,σ,{s,σ},{t,0}].
  • The following options can be given:
  • InterpolationOrder Automaticspline interpolation order of up to order 3
    Padding "Reflected"padding scheme to use
  • By default, InterpolationOrder1 is assumed for lists of data. For TimeSeries objects, the interpolation order is inherited.
  • The interpolation order is used when computing peak positions. Peaks may be located in between and possibly above {x,y} samples interpolation orders.
  • For interpolation orders 0 or 1, a plateau of two or more data samples is assigned a single peak at its center location.
  • For possible settings for Padding, see the reference page for ArrayPad.

Examples

open allclose all

Basic Examples  (1)Summary of the most common use cases

Find position and height of dominant peaks in a list:

Out[9]=9

Visualize list and the detected peaks:

Out[10]=10

Scope  (12)Survey of the scope of standard use cases

Data  (4)

Peaks of a 1D list:

Out[3]=3

Peaks of a TimeSeries object:

Out[2]=2
Out[3]=3

Peaks of an EventSeries object:

Out[2]=2

Find peaks:

Out[3]=3
Out[4]=4

Peaks of a list of Quantity objects:

Out[2]=2
Out[3]=3

Threshold for values greater than 30 meters:

Out[4]=4
Out[5]=5

Parameters  (8)

By default, an automatic scale is used:

Out[2]=2

Find all peaks at scale :

Out[1]=1

Compute peaks at different scales:

Out[1]=1
Out[2]=2

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

Out[2]=2

Signal and its blurred version at scale :

Out[3]=3

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

Out[2]=2

Specify minimum sharpness value :

Out[2]=2

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

Out[3]=3

Specify a minimum height value :

Out[2]=2
Out[3]=3

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

Out[2]=2
Out[3]=3

Options  (3)Common values & functionality for each option

InterpolationOrder  (1)

By default, InterpolationOrder1 is used:

Out[13]=13
Out[14]=14

Find peaks of the cubic interpolation:

Out[9]=9

Note that the number and position of peaks may vary depending on the interpolation order:

Out[11]=11

Padding  (2)

By default, Padding"Reflected" is used:

Out[2]=2
Out[3]=3

Specify a constant padding:

Out[4]=4
Out[5]=5

Padding influences the occurrence and position of peaks at the boundary:

By default, "Reflected" padding causes a peak at position 1:

Out[2]=2

"Reversed" padding induces a peak at position 1/2:

Out[3]=3

"Fixed" padding results in no peak at the boundary:

Out[4]=4

Applications  (6)Sample problems that can be solved with this function

Find peaks in the stock price of Apple in the year 2013:

Out[1]=1
Out[2]=2
Out[3]=3

Highlight peaks on the plot of the data:

Out[4]=4

Find peaks in elevation data:

Out[3]=3

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

Out[1]=1
Out[2]=2

Find peaks in the temperature:

Out[4]=4

Find peaks in an ECG signal:

Out[2]=2
Out[3]=3

Detect the mode of a distribution using the peak of its histogram. Sample a Fréchet distribution:

Out[2]=2

Find the mode of the distribution:

Out[3]=3
Out[4]=4

Compare the mode with the theoretical value of the Fréchet distribution:

Out[5]=5

Use peaks of an audio power spectrum to detect pitches of the sound:

Out[1]=1

Compute the power periodogram:

Find peaks of the power spectrum:

Out[3]=3
Out[4]=4

Converting peak locations into corresponding frequencies:

Out[5]=5
Out[6]=6
Wolfram Research (2014), FindPeaks, Wolfram Language function, https://reference.wolfram.com/language/ref/FindPeaks.html (updated 2021).
Wolfram Research (2014), FindPeaks, Wolfram Language function, https://reference.wolfram.com/language/ref/FindPeaks.html (updated 2021).

Text

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

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

CMS

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

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

APA

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

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

BibTeX

@misc{reference.wolfram_2025_findpeaks, author="Wolfram Research", title="{FindPeaks}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/FindPeaks.html}", note=[Accessed: 09-June-2025 ]}

@misc{reference.wolfram_2025_findpeaks, author="Wolfram Research", title="{FindPeaks}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/FindPeaks.html}", note=[Accessed: 09-June-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_findpeaks, organization={Wolfram Research}, title={FindPeaks}, year={2021}, url={https://reference.wolfram.com/language/ref/FindPeaks.html}, note=[Accessed: 09-June-2025 ]}

@online{reference.wolfram_2025_findpeaks, organization={Wolfram Research}, title={FindPeaks}, year={2021}, url={https://reference.wolfram.com/language/ref/FindPeaks.html}, note=[Accessed: 09-June-2025 ]}