FindPeakPoints - Maple Help

SignalProcessing

 FindPeakPoints
 find peak and valley points of one-dimensional data sets

 Calling Sequence FindPeakPoints( X, Y, options ) FindPeakPoints( XY, options ) FindPeakPoints( Y, options )

Parameters

 X - One-dimensional rtable or list of independent data values. Y - One-dimensional rtable or list of dependent data values. XY - Two-dimensional rtable or list of independent and dependent data values, with each row representing a single point.

Options

 • sortdata - Either true or false, this specifies whether to sort the data when both independent and dependent values are provided. The default is true.
 • tolerance - Threshold used to detect a peak or a valley. See the precise definition of "peaks" and "valleys" in terms of tolerance below. Typically, a peak must be higher by more than tolerance than the closest valleys on the left and right. The default is 0.0.
 • breadthtype - The definition used to determine the breadth of a peak or valley. There are three options:
 baseradius: The smaller of the positive horizontal distances from the peak (valley) to the valleys (peaks) on either side which determine the prominence. This is the default.
 basewidth: The horizontal distance between the valleys (peaks) on either side of the peak (valley) which determine the prominence.
 halfprominence: The horizontal distance between the intersection points of the (imaginary) lines from the peak (valley) to the valleys (peaks) which determine the prominence, and the (imaginary) horizontal line that is halfway between the peak (valley) and the valley (peak) which determines the prominence.
 • includeendpoints - Specifies if the endpoints of the data should be kept or filtered out if they're found to be peaks or valleys. The default is true.
 • minimumprominence - Specifies the smallest allowed prominence to filter the peaks/valleys. The default is 0.0.
 • minimumbreadth - Specifies the smallest allowed breadth to filter the peaks/valleys. The default is 0.0.
 • minimumheight - Specifies the smallest allowed height to filter the peaks and valleys. The default is -infinity.
 • maximumheight - Specifies the largest allowed height to filter the peaks and valleys. The default is infinity.
 • minimumseparation - Specifies the smallest horizontal distance of a candidate extremum from the previous extremum of the same variety (peak or valley) to be included. for a successive point (of the same variety) to count. The default is 0.0.
 • output - The type of output. The supported options are:
 peaks: For a Matrix of the peak points. This is the default.
 valleys: Similar to peaks, but for valleys.
 peakbreadths: For a column Vector of the breadths of the peak points.
 peakprominences: For a column Vector of the prominences of the peak points.
 valleybreadths: For a column Vector of the breadths of the valley points.
 valleyprominences: For a column Vector of the prominences of the valley points.
 plot: Returns a plot of all the points, using the plot options below or any options which can be passed to plots:-display.
 record: Returns a record with the previous options.
 list of any of the above options (excluding record): Returns an expression sequence with the corresponding outputs, in the same order.
 • plotincludepoints - A list of point types (chosen from peaks, regular, and valleys) to include in the plot. The default is [peaks].
 • curveplotoptions - A list of options to be passed to the internal call to plot when generating the curve through all the points. The default is [connect=true,thickness=1,color=black]. Note: Any passed options will not overwrite the remaining default ones.
 • peakpointplotoptions - A list of options to be passed to plots[pointplot] when generating the point plot for peaks. The default is [color=blue,symbol=solidcircle,symbolsize=15]. Note: Any passed options will not overwrite the remaining default ones.
 • valleypointplotoptions - A list of options to be passed to plots[pointplot] when generating the point plot for valleys. The default is [color=green,symbol=solidcircle,symbolsize=15]. Note: Any passed options will not overwrite the remaining default ones.
 • regularpointplotoptions - A list of options to be passed to plots[pointplot] when generating the point plot for regular points. The default is [color=black,symbol=solidcircle,symbolsize=10]. Note: Any passed options will not overwrite the remaining default ones.

Description

 • The FindPeakPoints command is used to find the "peak" and "valley" points of one-dimensional data sets.
 • The command can be accessed by using either the long form or the short form of the command name in the calling sequence.
 • The long form, SignalProcessing:-FindPeakPoints, is always available.  The short form can be used after loading the package.
 • For the FindPeakPoints(X,Y) calling sequence, X and Y must be of the same size.
 • The FindPeakPoints(XY) calling sequence is reduced to the FindPeakPoints(X,Y) calling sequence by taking X and Y to be, respectively, the first and second columns of XY. Similarly, the FindPeakPoints(Y) calling sequence is reduced to the FindPeakPoints(X,Y) calling sequence by taking X to be a Vector of the positive integers from 1 to numelems(Y).
 • Any input rtable/list is converted to an rtable of float[8] datatype, and an error will be thrown if this is not possible. For this reason, it is most efficient for any input to already be an rtable having the appropriate datatype. Note: The rtables cannot have an indexing function, and they need to have rectangular storage.
 • When both independent and dependent data are passed, if sortdata=true then the independent values are sorted in increasing order, and the dependent values are sorted in tandem. If sortdata=false, on the other hand, the onus is on the user to ensure that the data is sorted.
 • Prior to filtering based on breadth, height, prominence, and separation, the command determines a "peak" ("valley") to be a point which satisfies the following recursive conditions:
 1 The closest "extremum" on the left of the point, if it exists, is a "valley" ("peak") which is lower (higher) by more than tolerance.
 2 When moving to the right of the point, before a point that is of greater (lower) height is encountered, one reaches either an endpoint in the situation where a point to the left has already been determined to be a "valley" ("peak"), or a point lower (higher) in height by more than tolerance.
 • Note: Points passed over between the starting and final points during this sweep to the right are "regular".
 • Note: Peaks and valleys are found by considering the entire neighborhood of the candidate points, not just the closest points on the left and right.
 • The "left-prominence" of a peak is defined as the height difference between the peak and the lowest valley between it and the closest peak (or endpoint) on the left of equal or greater height. Note: In the event of a tie, the lowest valley furthest from the peak is taken. The "right-prominence" is similarly defined, and the overall "prominence" is taken to be the smaller of the positive one-sided prominences. The prominence of a valley is defined in the same manner. Note: The missing one-sided prominences for the endpoints are taken to be zero.

Examples

 > $\mathrm{with}\left(\mathrm{SignalProcessing}\right):$

Simple Examples

 • For a simple example, consider:
 > $X≔\left[1,5,8,10\right]$
 ${X}{≔}\left[{1}{,}{5}{,}{8}{,}{10}\right]$ (1)
 > $Y≔\left[5,10,1,4\right]$
 ${Y}{≔}\left[{5}{,}{10}{,}{1}{,}{4}\right]$ (2)
 > $P,V≔\mathrm{FindPeakPoints}\left(X,Y,\mathrm{includeendpoints}=\mathrm{false},\mathrm{output}=\left[\mathrm{peaks},\mathrm{valleys}\right]\right)$
 ${P}{,}{V}{≔}\left[\begin{array}{cc}{5.}& {10.}\end{array}\right]{,}\left[\begin{array}{cc}{8.}& {1.}\end{array}\right]$ (3)
 > $\mathrm{FindPeakPoints}\left(X,Y,\mathrm{includeendpoints}=\mathrm{false},\mathrm{output}=\mathrm{plot},\mathrm{plotincludepoints}=\left[\mathrm{peaks},\mathrm{regular},\mathrm{valleys}\right]\right)$
 • Saw:
 > $\mathrm{FindPeakPoints}\left(\left[1,2,1,2,1,2,1\right],\mathrm{output}=\mathrm{plot},\mathrm{plotincludepoints}=\left[\mathrm{peaks},\mathrm{regular},\mathrm{valleys}\right]\right)$
 • Plateau:
 > $\mathrm{FindPeakPoints}\left(\left[1,2,2,2,1\right],\mathrm{output}=\mathrm{plot},\mathrm{plotincludepoints}=\left[\mathrm{peaks},\mathrm{regular},\mathrm{valleys}\right]\right)$
 • Step:
 > $\mathrm{FindPeakPoints}\left(\left[1,2,2,2,3\right],\mathrm{output}=\mathrm{plot},\mathrm{plotincludepoints}=\left[\mathrm{peaks},\mathrm{regular},\mathrm{valleys}\right]\right)$
 • Hat:
 > $\mathrm{FindPeakPoints}\left(\left[1,1,2,1,1\right],\mathrm{output}=\mathrm{plot},\mathrm{plotincludepoints}=\left[\mathrm{peaks},\mathrm{regular},\mathrm{valleys}\right]\right)$
 • Plain:
 > $\mathrm{FindPeakPoints}\left(\left[2,2,2,2\right],\mathrm{output}=\mathrm{plot},\mathrm{plotincludepoints}=\left[\mathrm{peaks},\mathrm{regular},\mathrm{valleys}\right]\right)$

Illustrative Example

 • Consider now a more illustrative example:
 > $\mathrm{data}≔\mathrm{Vector}\left[\mathrm{row}\right]\left(\left[5,10,8,9,8,10,10,10,7,7.1,7.2,7.3,7.4,7.5,2,12,12,12,15.1,14.9,15.2,10,20.1,20.2,20.1,25,15\right]\right)$
 $\left[\begin{array}{ccccccccccccccccccccccccccc}5& 10& 8& 9& 8& 10& 10& 10& 7& 7.1& 7.2& 7.3& 7.4& 7.5& 2& 12& 12& 12& 15.1& 14.9& 15.2& 10& 20.1& 20.2& 20.1& 25& 15\end{array}\right]$ (4)
 • Options:
 > $\mathrm{opts}≔\mathrm{output}=\mathrm{record},\mathrm{plotincludepoints}=\left[\mathrm{peaks},\mathrm{regular},\mathrm{valleys}\right],\mathrm{curveplotoptions}=\left[\mathrm{connect}=\mathrm{true},\mathrm{color}=\mathrm{red},\mathrm{thickness}=2\right],\mathrm{peakpointplotoptions}=\left[\mathrm{symbolsize}=20,\mathrm{color}=\mathrm{blue}\right],\mathrm{valleypointplotoptions}=\left[\mathrm{symbolsize}=20,\mathrm{color}=\mathrm{green}\right],\mathrm{regularpointplotoptions}=\left[\mathrm{symbolsize}=15,\mathrm{color}=\mathrm{black}\right],\mathrm{title}="Peaks and Valleys":$
 > $L≔\mathrm{FindPeakPoints}\left(\mathrm{data},\mathrm{opts}\right)$
 ${L}{≔}{\mathrm{Record}}{}\left({\mathrm{peaks}}{=}\left[\begin{array}{cc}{2.}& {10.}\\ {4.}& {9.}\\ {6.}& {10.}\\ {14.}& {7.50000000000000}\\ {19.}& {15.1000000000000}\\ {21.}& {15.2000000000000}\\ {24.}& {20.2000000000000}\\ {26.}& {25.}\end{array}\right]{,}{\mathrm{valleys}}{=}\left[\begin{array}{cc}{1.}& {5.}\\ {3.}& {8.}\\ {5.}& {8.}\\ {9.}& {7.}\\ {15.}& {2.}\\ {20.}& {14.9000000000000}\\ {22.}& {10.}\\ {25.}& {20.1000000000000}\\ {27.}& {15.}\end{array}\right]{,}{\mathrm{peakbreadths}}{=}\left[\begin{array}{c}{1.}\\ {1.}\\ {3.}\\ {1.}\\ {1.}\\ {1.}\\ {1.}\\ {1.}\end{array}\right]{,}{\mathrm{peakprominences}}{=}\left[\begin{array}{c}{2.}\\ {1.}\\ {2.}\\ {0.500000000000000}\\ {0.199999999999999}\\ {5.20000000000000}\\ {0.0999999999999979}\\ {10.}\end{array}\right]{,}{\mathrm{valleybreadths}}{=}\left[\begin{array}{c}{7.}\\ {1.}\\ {1.}\\ {5.}\\ {11.}\\ {1.}\\ {1.}\\ {1.}\\ {1.}\end{array}\right]{,}{\mathrm{valleyprominences}}{=}\left[\begin{array}{c}{5.}\\ {1.}\\ {1.}\\ {0.500000000000000}\\ {8.}\\ {0.199999999999999}\\ {5.20000000000000}\\ {0.0999999999999979}\\ {10.}\end{array}\right]{,}{\mathrm{plot}}{=}{\mathrm{PLOT}}{}\left({\mathrm{...}}\right)\right)$ (5)
 • The peaks and valleys:
 > $P,V≔L\left[\mathrm{peaks}\right],L\left[\mathrm{valleys}\right]$
 ${P}{,}{V}{≔}\left[\begin{array}{cc}{2.}& {10.}\\ {4.}& {9.}\\ {6.}& {10.}\\ {14.}& {7.50000000000000}\\ {19.}& {15.1000000000000}\\ {21.}& {15.2000000000000}\\ {24.}& {20.2000000000000}\\ {26.}& {25.}\end{array}\right]{,}\left[\begin{array}{cc}{1.}& {5.}\\ {3.}& {8.}\\ {5.}& {8.}\\ {9.}& {7.}\\ {15.}& {2.}\\ {20.}& {14.9000000000000}\\ {22.}& {10.}\\ {25.}& {20.1000000000000}\\ {27.}& {15.}\end{array}\right]$ (6)
 • The plot:
 > $L\left[\mathrm{plot}\right]$
 • If we increase the tolerance, some extrema are excluded:
 > $L≔\mathrm{FindPeakPoints}\left(\mathrm{data},\mathrm{tolerance}=0.2,\mathrm{opts}\right):$
 • The remaining peaks and valleys:
 > $P,V≔L\left[\mathrm{peaks}\right],L\left[\mathrm{valleys}\right]$
 ${P}{,}{V}{≔}\left[\begin{array}{cc}{2.}& {10.}\\ {4.}& {9.}\\ {6.}& {10.}\\ {14.}& {7.50000000000000}\\ {21.}& {15.2000000000000}\\ {26.}& {25.}\end{array}\right]{,}\left[\begin{array}{cc}{1.}& {5.}\\ {3.}& {8.}\\ {5.}& {8.}\\ {9.}& {7.}\\ {15.}& {2.}\\ {22.}& {10.}\\ {27.}& {15.}\end{array}\right]$ (7)
 • The plot:
 > $L\left[\mathrm{plot}\right]$

Minimum and Maximum Height

 • Peaks and valleys can be filtered based on the height:
 > $\mathrm{data}≔\left[-5,12,6,7,3,15,-10\right]$
 ${\mathrm{data}}{≔}\left[{-5}{,}{12}{,}{6}{,}{7}{,}{3}{,}{15}{,}{-10}\right]$ (8)
 > $\mathrm{FindPeakPoints}\left(\mathrm{data},\mathrm{output}=\mathrm{plot},\mathrm{plotincludepoints}=\left[\mathrm{peaks},\mathrm{regular},\mathrm{valleys}\right],\mathrm{gridlines}=\mathrm{true}\right)$
 > $\mathrm{FindPeakPoints}\left(\mathrm{data},\mathrm{minimumheight}=0,\mathrm{maximumheight}=10,\mathrm{output}=\mathrm{plot},\mathrm{plotincludepoints}=\left[\mathrm{peaks},\mathrm{regular},\mathrm{valleys}\right],\mathrm{gridlines}=\mathrm{true}\right)$

Prominence

 • The command can be used to isolate the most prominent peak. Consider:
 > $\mathrm{data}≔\mathrm{Vector}\left[\mathrm{row}\right]\left(\left[8,10,5,7,1,6,5,15,4,6,5,7,3,10,8\right]\right)$
 $\left[\begin{array}{rrrrrrrrrrrrrrr}8& 10& 5& 7& 1& 6& 5& 15& 4& 6& 5& 7& 3& 10& 8\end{array}\right]$ (9)
 > $L≔\mathrm{FindPeakPoints}\left(\mathrm{data},\mathrm{output}=\mathrm{record},\mathrm{plotincludepoints}=\left[\mathrm{peaks},\mathrm{regular},\mathrm{valleys}\right],\mathrm{gridlines}=\mathrm{true}\right)$
 ${L}{≔}{\mathrm{Record}}{}\left({\mathrm{peaks}}{=}\left[\begin{array}{cc}{2.}& {10.}\\ {4.}& {7.}\\ {6.}& {6.}\\ {8.}& {15.}\\ {10.}& {6.}\\ {12.}& {7.}\\ {14.}& {10.}\end{array}\right]{,}{\mathrm{valleys}}{=}\left[\begin{array}{cc}{1.}& {8.}\\ {3.}& {5.}\\ {5.}& {1.}\\ {7.}& {5.}\\ {9.}& {4.}\\ {11.}& {5.}\\ {13.}& {3.}\\ {15.}& {8.}\end{array}\right]{,}{\mathrm{peakbreadths}}{=}\left[\begin{array}{c}{1.}\\ {1.}\\ {1.}\\ {3.}\\ {1.}\\ {1.}\\ {1.}\end{array}\right]{,}{\mathrm{peakprominences}}{=}\left[\begin{array}{c}{2.}\\ {2.}\\ {1.}\\ {12.}\\ {1.}\\ {3.}\\ {2.}\end{array}\right]{,}{\mathrm{valleybreadths}}{=}\left[\begin{array}{c}{1.}\\ {1.}\\ {3.}\\ {1.}\\ {1.}\\ {1.}\\ {1.}\\ {1.}\end{array}\right]{,}{\mathrm{valleyprominences}}{=}\left[\begin{array}{c}{2.}\\ {2.}\\ {9.}\\ {1.}\\ {3.}\\ {1.}\\ {7.}\\ {2.}\end{array}\right]{,}{\mathrm{plot}}{=}{\mathrm{PLOT}}{}\left({\mathrm{...}}\right)\right)$ (10)
 • Isolating the peaks, along with the breadths and prominences:
 > $P,\mathrm{PB},\mathrm{PP}≔L\left[\mathrm{peaks}\right],L\left[\mathrm{peakbreadths}\right],L\left[\mathrm{peakprominences}\right]$
 ${P}{,}{\mathrm{PB}}{,}{\mathrm{PP}}{≔}\left[\begin{array}{cc}{2.}& {10.}\\ {4.}& {7.}\\ {6.}& {6.}\\ {8.}& {15.}\\ {10.}& {6.}\\ {12.}& {7.}\\ {14.}& {10.}\end{array}\right]{,}\left[\begin{array}{c}{1.}\\ {1.}\\ {1.}\\ {3.}\\ {1.}\\ {1.}\\ {1.}\end{array}\right]{,}\left[\begin{array}{c}{2.}\\ {2.}\\ {1.}\\ {12.}\\ {1.}\\ {3.}\\ {2.}\end{array}\right]$ (11)
 • Isolating the valleys, along with the breadths and prominences:
 > $V,\mathrm{VB},\mathrm{VP}≔L\left[\mathrm{valleys}\right],L\left[\mathrm{valleybreadths}\right],L\left[\mathrm{valleyprominences}\right]$
 ${V}{,}{\mathrm{VB}}{,}{\mathrm{VP}}{≔}\left[\begin{array}{cc}{1.}& {8.}\\ {3.}& {5.}\\ {5.}& {1.}\\ {7.}& {5.}\\ {9.}& {4.}\\ {11.}& {5.}\\ {13.}& {3.}\\ {15.}& {8.}\end{array}\right]{,}\left[\begin{array}{c}{1.}\\ {1.}\\ {3.}\\ {1.}\\ {1.}\\ {1.}\\ {1.}\\ {1.}\end{array}\right]{,}\left[\begin{array}{c}{2.}\\ {2.}\\ {9.}\\ {1.}\\ {3.}\\ {1.}\\ {7.}\\ {2.}\end{array}\right]$ (12)
 • Isolating the plot:
 > $L\left[\mathrm{plot}\right]$
 • One peak stands out with a prominence of 12, and can be singled out:
 > $\mathrm{FindPeakPoints}\left(\mathrm{data},\mathrm{minimumprominence}=10,\mathrm{output}=\mathrm{plot}\right)$

 • The breadth of a peak/valley can be measured in multiple ways:
 > $A≔\left[6,10,6,2,6,10,6\right]$
 ${A}{≔}\left[{6}{,}{10}{,}{6}{,}{2}{,}{6}{,}{10}{,}{6}\right]$ (13)
 > $\mathrm{FindPeakPoints}\left(A,\mathrm{output}=\mathrm{plot},\mathrm{plotincludepoints}=\left[\mathrm{peaks},\mathrm{regular},\mathrm{valleys}\right]\right)$
 > $\mathrm{PB1},\mathrm{VB1}≔\mathrm{FindPeakPoints}\left(A,\mathrm{output}=\left[\mathrm{peakbreadths},\mathrm{valleybreadths}\right],\mathrm{breadthtype}=\mathrm{baseradius}\right)$
 ${\mathrm{PB1}}{,}{\mathrm{VB1}}{≔}\left[\begin{array}{c}{1.}\\ {1.}\end{array}\right]{,}\left[\begin{array}{c}{1.}\\ {2.}\\ {1.}\end{array}\right]$ (14)
 > $\mathrm{PB2},\mathrm{VB2}≔\mathrm{FindPeakPoints}\left(A,\mathrm{output}=\left[\mathrm{peakbreadths},\mathrm{valleybreadths}\right],\mathrm{breadthtype}=\mathrm{basewidth}\right)$
 ${\mathrm{PB2}}{,}{\mathrm{VB2}}{≔}\left[\begin{array}{c}{3.}\\ {3.}\end{array}\right]{,}\left[\begin{array}{c}{1.}\\ {4.}\\ {1.}\end{array}\right]$ (15)
 > $\mathrm{PB3},\mathrm{VB3}≔\mathrm{FindPeakPoints}\left(A,\mathrm{output}=\left[\mathrm{peakbreadths},\mathrm{valleybreadths}\right],\mathrm{breadthtype}=\mathrm{halfprominence}\right)$
 ${\mathrm{PB3}}{,}{\mathrm{VB3}}{≔}\left[\begin{array}{c}{1.}\\ {1.}\end{array}\right]{,}\left[\begin{array}{c}{0.500000000000000}\\ {2.}\\ {0.500000000000000}\end{array}\right]$ (16)
 • An appropriate measure of breadth can also be used to retain specific peaks. For instance:
 > $B≔\mathrm{Vector}\left[\mathrm{column}\right]\left(\left[5,10,4,8,4,9,3,7,3,8,2,6,2,7,1\right]\right)$
 ${{\mathrm{_rtable}}}_{{36893628308344070260}}$ (17)
 > $\mathrm{FindPeakPoints}\left(B,\mathrm{breadthtype}=\mathrm{basewidth},\mathrm{minimumbreadth}=3,\mathrm{output}=\mathrm{plot}\right)$

Minimum Separation

 • The FindPeakPoints command can filter out peaks and valleys that are too close:
 > $\mathrm{data}≔\mathrm{Matrix}\left(\left[\mathrm{seq}\left(\left[i,2+{\left(-1\right)}^{i}\right],i=1..11\right)\right]\right)$
 ${{\mathrm{_rtable}}}_{{36893628308344055316}}$ (18)
 > $\mathrm{FindPeakPoints}\left(\mathrm{data},\mathrm{output}=\mathrm{plot},\mathrm{plotincludepoints}=\left[\mathrm{peaks},\mathrm{regular},\mathrm{valleys}\right]\right)$
 > $\mathrm{FindPeakPoints}\left(\mathrm{data},\mathrm{minimumseparation}=4.0,\mathrm{output}=\mathrm{plot},\mathrm{plotincludepoints}=\left[\mathrm{peaks},\mathrm{regular},\mathrm{valleys}\right]\right)$
 > $\mathrm{FindPeakPoints}\left(\mathrm{data},\mathrm{minimumseparation}=5.0,\mathrm{output}=\mathrm{plot},\mathrm{plotincludepoints}=\left[\mathrm{peaks},\mathrm{regular},\mathrm{valleys}\right]\right)$

Sunspot Periodicity

 • For a real-world, so-to-speak, example, we can look to the sun (well, don't, that's dangerous), and find the period of the number of sunspots. First, obtain the data:
 > $\mathrm{DataReference}≔\mathrm{DataSets}:-\mathrm{Reference}\left("quandl","SIDC/SUNSPOTS_A"\right):$
 > $\mathrm{data}≔\mathrm{convert}\left(\mathrm{DataReference},\mathrm{Matrix}\right):$
 > $\mathrm{SunspotNumber}≔\mathrm{data}\left[..,2\right]:$
 > ParseYear := proc(x) return StringTools:-ParseTime( "%Y-%m-%d", x ):-year; end proc:
 > $\mathrm{Year}≔\mathrm{map}\left(\mathrm{ParseYear},\mathrm{data}\left[..,1\right]\right):$
 • Now, plot the data:
 > $P≔\mathrm{plots}:-\mathrm{pointplot}\left(\left[\mathrm{seq}\left(\left[\mathrm{Year}\left[i\right],\mathrm{SunspotNumber}\left[i\right]\right],i=1..\mathrm{upperbound}\left(\mathrm{data},1\right)\right)\right],\mathrm{labels}=\left["Year","Wolf Number"\right],\mathrm{labeldirections}=\left[\mathrm{horizontal},\mathrm{vertical}\right],\mathrm{connect}=\mathrm{true},\mathrm{title}="Sunspot Data",\mathrm{font}=\left[\mathrm{Verdana},15\right],\mathrm{labelfont}=\left[\mathrm{Verdana},15\right],\mathrm{thickness}=0,\mathrm{gridlines},\mathrm{size}=\left[800,"golden"\right]\right)$
 • Extract the points:
 > $A≔\mathrm{plottools}:-\mathrm{getdata}\left(P,\mathrm{element}="curve"\right)\left[3\right]:$
 • Find the peaks:
 > $B≔\mathrm{FindPeakPoints}\left(A,\mathrm{output}=\mathrm{record},\mathrm{plotincludepoints}=\left[\mathrm{peaks}\right],\mathrm{peakpointplotoptions}=\left[\mathrm{symbolsize}=10\right],\mathrm{minimumprominence}=25,\mathrm{labels}=\left["Year","Wolf Number"\right],\mathrm{labeldirections}=\left[\mathrm{horizontal},\mathrm{vertical}\right],\mathrm{size}=\left[1000,500\right],\mathrm{view}=\left[1650..2050,0..300\right],\mathrm{xtickmarks}=\left[\mathrm{seq}\left(1700..2050,50\right)\right]\right):$
 • We choose a minimum prominence here to be 25 in order to filter out the spurious peaks. The option, say, tolerance=15 would achieve this as well.
 • Display the plot:
 > $B\left[\mathrm{plot}\right]$
 • Finally, find determine the period:
 > $Q≔B\left[\mathrm{peaks}\right]\left[..,1\right]$
 ${{\mathrm{_rtable}}}_{{36893628308344087964}}$ (19)
 > $\mathrm{\alpha }≔\mathrm{Mean}\left(Q\left[2..\right]-Q\left[..-2\right]\right)$
 ${\mathrm{\alpha }}{≔}{11.0357142857142865}$ (20)
 > 

Compatibility

 • The SignalProcessing[FindPeakPoints] command was introduced in Maple 2019.