Skip to content

sig.peaks

Olivier Lartillot edited this page Nov 6, 2018 · 10 revisions

Automatically detects peaks (i.e, important local maxima) from any data x produced in MiningSuite using the command:

sig.peaks(x)

If x is a curve, peaks are represented by red circles:

https://miningsuite.googlecode.com/svn/wiki/SigPeaks_ex1.png

If x is a frame-decomposed matrix, peaks are represented by crosses:

https://miningsuite.googlecode.com/svn/wiki/SigPeaks_ex2.png


Parameters specification

  • sig.peaks(…,'Total',m): only the m highest peaks are selected. If m = Inf, no limitation of number of peaks. Default value: m = Inf

  • Border effects can be specified:
    • sig.peaks(…,'NoBegin') does not consider the first sample as a possible peak candidate. If a 'Contrast' parameter cthr is specified (cf. below), we will not consider either the first local maximum if the difference of amplitude with the beginning of the curve is below cthr.
    • sig.peaks(…,'NoEnd') does not consider the last sample as a possible peak candidate. If a 'Contrast' parameter cthr is specified (cf. below), we will not consider either the last local maximum if the difference of amplitude with the end of the curve is below cthr.

  • sig.peaks(…,'Order',o) specifies the ordering of the peaks.
    • o = 'Amplitude' orders the peaks from highest to lowest (Default choice.)
    • o = 'Abscissa' orders the peaks along the abscissa axis.

  • sig.peaks(…,'Valleys') detects valleys (local minima) instead of peaks.

  • sig.peaks(…,'Contrast',cthr): A given local maximum will be considered as a peak if the difference of amplitude with respect to both the previous and successive local minima (when they exist) is higher than the threshold cthr. This distance is expressed with respect to the total amplitude of the input signal: a distance of 1, for instance, is equivalent to the distance between the maximum and the minimum of the input signal. Default value: cthr = 0.1

  • sig.peaks(…,'SelectFirst',fthr): If the 'Contrast' selection has been chosen, this additional option specifies that when one peak has to be chosen out of two candidates, and if the difference of their amplitude is below the threshold thr, then the most ancien one is selected. Option toggled off by default. Default value if toggled on: fthr = cthr/2

  • sig.peaks(…,'Threshold',thr): A given local maximum will be considered as a peak if its normalized amplitude is higher than this threshold thr. A given local minimum will be considered as a valley if its normalized amplitude is lower than this threshold. The normalized amplitude can have value between 0 (the minimum of the signal in each frame) and 1 (the maximum in each frame). Default value: thr = 0 for peaks, thr = 1 for valleys.

  • sig.peaks(…,'Interpol',i) estimates more precisely the peak position and amplitude using interpolation. Performed only on data with numerical abscissae axis.
    • i = '', 'no', 'off', 0: no interpolation
    • i = 'Quadratic': quadratic interpolation. (default value).

  • sig.peaks(…,'Reso',r) removes peaks whose abscissa distance to one or several higher peaks is lower than the threshold r. By default, out of two conflicting peaks, the higher peak remains. If the keyword 'First' is added, the peak with lower abscissa value remains instead.

  • sig.peaks(…,'Normalize',n) specifies whether frames are normalized globally or individually.
    • n = 'Global' normalizes across the whole frames (as well as across the whole segments) of each audio file from 0 to 1 (default choice).
    • n = 'Local': normalizes each segment, each frame, from 0 to 1 separately.
    • n = 'No' or 0: no normalisation. (in MiningSuite 0.11 and higher)

Accessible Output

Accessible using the get method.

  • 'PeakIndex': the abscissae position of the detected peaks, in sample index
  • 'PeakPos': the abscissae position of the detected peaks, in the default abscissae representation
  • 'PeakPrecisePos': a more precise estimation of the abscissae position of the detected peaks computed through interpolation, in the default abscissae representation
  • 'PeakVal': the ordinate values associated to the detected peaks
  • 'PeakPreciseVal': a more precise estimation of the ordinate values associated to the detected peaks, computed through interpolation

Clone this wiki locally