Usage:
PEAKS X Y TH XMIN XMAX M W I SORT
Inputs:
X,Y |
vector of x/y-value pairs |
TH |
threshold value or vector |
XMIN,XMAX |
lower and upper boundary of peak search interval |
M |
maximum number of peaks |
W, I |
peak detection (ħM pts., W>0) and interpolation (ħI, 0£I£W) width |
SORT |
sort option for output values |
Outputs:
X,Y |
x/y-values of peaks (vectors of length M) |
M |
actual number of detected peaks (0..M) |
Function:
This atom searches the function given by the X/Y inputs for local maxima (peaks). For the peak detection, the following conditions are used:
point (Xi, Yi) is a peak if:
If the input TH is a number, all threshold values THi are set to this value. If the interpolation width I is a positive value (1..W), a parabolic interpolation is used to compute the x- and y-values of the local maxima. For the interpolation, the three points i-I, i and i+I are used. The x/y values and the number of detected peaks are stored in the outputs. If fewer than M peaks are found, the remaining values of the X/Y outputs are set to 0. E.g. this atom can be used for the peak detection for the F0HGRID and FORMANT atoms.