PEAKS

From STX Wiki
Jump to navigationJump to search

PEAKS - spectral peak picking

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:

XMIN £ Xi £ XMAXYi > THiYi-1 < Yi and Yi+1 < YiYi-j-1 £ Yi-j and Yi+j+1 £ Yi+j for j=1..W-1If 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.

Navigation menu

Personal tools