Find peaks🔗

Finds peaks in a one-dimensional signal. This tool locates and measures positive peaks in a sequence of measurements by looking for sign changes in the first derivative of the input signal (such as a @ref “gray-level profile” GrayLevelProfileTool).


  • signal: A row vector (1-by-N matrix) containing the measurements.

  • maximumPeakCount: The maximum number of peaks to find. If set to a non-zero value, at most this many highest peaks will be returned.

  • minimumHeight: The mimimum value to be regarded as a peak. This threshold cuts off peaks that are not high enough.

  • minimumSharpness: The minimum relative value of the second derivative that will trigger peak detection. The relative derivative is calculated by dividing the second derivative by the corresponding measurement. This value cuts off peaks that are not sharp enough.

  • minimumPeakDistance: The minimum difference between the indices of successive peaks. If two peak positions are closer than this, the weaker one will be pruned.


  • peakCount: The number of detected peaks. At most maximumPeakCount.

  • index: Indexes of the measurements in signal that triggered peak detection as an M-by-1 matrix. (M is the number of peaks found.)

  • height: Heights of the peaks as an M-by-1 matrix.

The values in the outputs are in the same order they appear in the input signal. To sort based on height, use SortRowsTool.