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.
FindPeaks
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 Automatic spline 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 all close allBasic Examples (1)
Find position and height of dominant peaks in a list:
values = {1, 3, 5, 6, 6, 4, 3, 2, 4, 7, 3, 2, 4, 2, 2, 1};peaks = FindPeaks[values]Visualize list and the detected peaks:
ListLinePlot[
{values, peaks},
Joined -> {True, False},
PlotStyle -> {Automatic, PointSize[.03]}
]Scope (12)
Data (4)
list = {1, 3, 5, 6, 6, 4, 3, 2, 4, 7, 3, 2, 4, 2, 2, 1};ListLinePlot[
{list, FindPeaks[list]},
Joined -> {True, False},
PlotStyle -> {Automatic, PointSize[.03]}
]Peaks of a TimeSeries object:
ts = TemporalData[TimeSeries, {{{54.75, 54.09, 53.89, 55.86, 55.9, 55.63, 53.63, 53.46, 54.15, 57.9,
56.9, 56.63, 56.2, 57.04, 58.32, 57.63, 59.21, 61.06, 62.48, 63.5, 62.74, 62.52, 64.4, 64.96,
64.06, 64.87, 67.06, 69.04, 68.12, 72.64, 73.5, ... 75.04,
75.59, 76.79, 76.86, 77.28, 78.76, 79.4, 79.81, 80.63, 80.88, 81.04, 81.15}},
{TemporalData`DateSpecification[{2013, 1, 2, 0, 0, 0.}, {2013, 11, 27, 0, 0, 0}, {1, "Week"}]},
1, {"Discrete", 1}, {"Discrete", 1}, 1, {}}, True, 10.];peaks = FindPeaks[ts, 0, 0, 0]DateListPlot[
{ts, peaks},
Joined -> {True, False},
PlotStyle -> {Automatic, PointSize[.03]}
]Peaks of an EventSeries object:
v = RandomInteger[{-10, 10}, n = 50];
t = N@Range[0, 1, 1 / (n - 1)];es = EventSeries[v, {t}]peaks = FindPeaks[es, 1, 0, 0]DateListPlot[
{es, peaks["Path"]},
Joined -> {False, False},
Filling -> Axis,
PlotStyle -> {Automatic, PointSize[.03]}
]Peaks of a list of Quantity objects:
data = {Quantity[9, "Feet"], Quantity[86, "Inches"], Quantity[27, "Meters"], Quantity[79, "Feet"], Quantity[90, "Feet"], Quantity[41, "Inches"], Quantity[99, "Inches"], Quantity[6, "Feet"], Quantity[38, "Feet"], Quantity[89, "Feet"], Quantity[53, "Feet"], Quantity[85, "Meters"], Quantity[92, "Meters"], Quantity[95, "Meters"], Quantity[49, "Feet"]};peaks = FindPeaks[data]ListPlot[{data, peaks}, Joined -> {True, False}, PlotStyle -> {Automatic, PointSize[.03]}]Threshold for values greater than 30 meters:
peaks30 = FindPeaks[data, Automatic, Automatic, Quantity[30, "Meters"]]ListPlot[
{data, peaks30},
Joined -> {True, False},
PlotStyle -> {Automatic, PointSize[.03]},
AxesLabel -> {None, "height [ft]"}
]Parameters (8)
By default, an automatic scale is used:
v = {2, 1, 6, 5, 7, 4};
FindPeaks[v]v = {2, 1, 6, 5, 7, 4};
FindPeaks[v, 0]Compute peaks at different scales:
list = Table[ Sin[x] + RandomReal[.5{-1, 1}], {x, 0, 3 Pi, 0.1}];
ListLinePlot[list]Table[ListPlot[{list, FindPeaks[list, σ]}, Joined -> {True, False}, PlotStyle -> {Automatic, PointSize[.04]}], {σ, {1, 2, 4}}]When finding peaks at scale
, only peaks that sustain a blur up to scale
are returned:
values = {2, 1, 3, 5, 6, 6, 4, 3, 2, 4, 7, 3, 4, 2, 2, 1};peaks = FindPeaks[values, 1]Signal and its blurred version at scale
:
ListLinePlot[
{values, GaussianFilter[values, {3, 1}], peaks},
Joined -> {True, True, False},
PlotStyle -> {Automatic, Dashed, {Red, PointSize[0.03]}}, PlotLegends -> {"original", "smoothed", "peaks"},
ImageSize -> 240
]By default, peaks are not filtered based on their sharpness, equivalent to
:
values = {2, 1, 3, 5, 6, 6, 4, 3, 2, 4, 7, 2, 3, 4, 3, 2};FindPeaks[values, 0, 0]Specify minimum sharpness value
:
values = {2, 1, 3, 5, 6, 6, 4, 3, 2, 4, 7, 2, 3, 4, 3, 2};peaks = FindPeaks[values, 0, 3]Sharpness, defined by the negative second derivative, should be greater than the specified s:
ListLinePlot[
{values,
ListConvolve[{1, -2, 1}, ArrayPad[values, 1, "Reversed"]],
peaks},
...
]Specify a minimum height value
:
list = {2, 1, 3, 5, 6, 6, 4, 3, 2, 4, 7, 1, 4, 2, 2, 1};peaks = FindPeaks[list, 0, 0, 5.1]ListLinePlot[{list, peaks}, ...]Apply the value threshold after smoothing the data using a scale
:
list = {2, 1, 3, 5, 6, 6, 4, 3, 2, 4, 7, 1, 4, 2, 2, 1};peaks = FindPeaks[list, 2, 0, {5.1, 1}]ListPlot[{list, GaussianFilter[list, 1{3, 1}], peaks}, ...]Options (3)
InterpolationOrder (1)
By default, InterpolationOrder1 is used:
values = {2, 1, 3, 5, 6, 6, 4, 3, 2, 4, 7, 3};peaks = FindPeaks[values, 0]ListPlot[{values, peaks}, ...]Find peaks of the cubic interpolation:
peaks = FindPeaks[values, 0, InterpolationOrder -> 3]Note that the number and position of peaks may vary depending on the interpolation order:
ListPlot[{values, peaks}, InterpolationOrder -> 3, ...]Padding (2)
By default, Padding"Reflected" is used:
values = {2, 1, 3, 5, 6, 6, 4, 3, 2, 4, 7, 3, 4, 2, 2, 1};peaks = FindPeaks[values, 0]ListPlot[{values, peaks}, Joined -> {True, False}, PlotStyle -> {Automatic, {PointSize[.03], Red}}]peaks = FindPeaks[values, 0, Padding -> 4]ListPlot[{values, peaks}, Joined -> {True, False}, PlotStyle -> {Automatic, {PointSize[.03], Red}}]Padding influences the occurrence and position of peaks at the boundary:
values = {2, 1, 3, 5, 6, 7, 3, 2, 1};By default, "Reflected" padding causes a peak at position 1:
peaks = FindPeaks[values, 0, Padding -> "Reflected"];
ListLinePlot[{values, peaks}, ...]"Reversed" padding induces a peak at position 1/2:
values = {2, 1, 3, 5, 6, 7, 3, 2, 1};peaks = FindPeaks[values, 0, Padding -> "Reversed"];
ListLinePlot[{values, peaks}, ...]"Fixed" padding results in no peak at the boundary:
peaks = FindPeaks[values, 0, Padding -> "Fixed"];
ListLinePlot[{values, peaks}, ...]Applications (6)
Find peaks in the stock price of Apple in the year 2013:
data = FinancialData["AAPL", {{2013, 1, 1}, {2014, 1, 1}, "Day"}]resampled = TimeSeriesResample[data, "Day"]peaks = FindPeaks[resampled, 3]Highlight peaks on the plot of the data:
DateListPlot[resampled, Epilog -> {Orange, PointSize[0.03], Point[QuantityMagnitude@peaks["Path"]]}]list = QuantityMagnitude[GeoElevationData[{GeoPosition[{0, 0}], GeoPosition[{.2, 180}]}]][[1]];peaks = FindPeaks[list, 3];ListPlot[{list, peaks}, ...]Mean daily temperatures for Chicago during a period of two months:
temp = WeatherData["Chicago", "MeanTemperature", {{2014, 11, 1}, {2014, 12, 31}, "Day"}]DateListPlot[temp]Find peaks in the temperature:
peaks = FindPeaks[temp, 0, Automatic, Quantity[0, "DegreesCelsius"]];DateListPlot[{temp, peaks}, ...]ecg = {...};peaks = FindPeaks[ecg, 8, {0.01, 0}, InterpolationOrder -> 2]ListPlot[{ecg, peaks}, Joined -> {True, False}, PlotStyle -> {Automatic, {Orange, PointSize[.03]}},
InterpolationOrder -> 2, PlotRange -> All, Axes -> None]Detect the mode of a distribution using the peak of its histogram. Sample a Fréchet distribution:
samples = RandomReal[FrechetDistribution[2.5, 16.0], {1000000}];histogram = Last@HistogramList[samples, {0.5, 50.5, 1}]Find the mode of the distribution:
mode = FindPeaks[histogram, InterpolationOrder -> 2][[1, 1]]Histogram[samples, {0.5, 50.5, 1}, Epilog -> {Line[{{mode, 0}, {mode, 1000000}}]},
Axes -> {True, False}
]Compare the mode with the theoretical value of the Fréchet distribution:
x /. FindRoot[Subscript[∂, x]PDF[FrechetDistribution[2.5, 16.0], x], {x, 14}]Use peaks of an audio power spectrum to detect pitches of the sound:
flute = ExampleData[{"Audio", "Flute"}]Compute the power periodogram:
spectrum = Take[PeriodogramArray[flute], 10000];Find peaks of the power spectrum:
peaks = FindPeaks[spectrum, 8, Automatic, 1, InterpolationOrder -> 2]ListLinePlot[spectrum, PlotRange -> All, Epilog -> {Red, Point[peaks]}]Converting peak locations into corresponding frequencies:
min = UnitConvert[Information[flute, "SampleRate"] / Information[flute, "Length"], "Hertz"]min peaks[[All, 1]]Text
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.
APA
Wolfram Language. (2014). FindPeaks. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FindPeaks.html
BibTeX
@misc{reference.wolfram_2026_findpeaks, author="Wolfram Research", title="{FindPeaks}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/FindPeaks.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_findpeaks, organization={Wolfram Research}, title={FindPeaks}, year={2021}, url={https://reference.wolfram.com/language/ref/FindPeaks.html}, note=[Accessed: 13-June-2026]}