SpectralSimilarity

Declaration: SpectralSimilarity (Spec1, Spec2: TDoubleArray; SimOp: TSpecSimi; var Similarity: double): integer;
The function SpectralSimilarity calculates one of several spectral similarity measures. The parameters Spec1 and Spec2 contain the spectra to be compared, the parameter SimOp defines the type of similarity measure to be calculated. Currently the following similarity measures are supported:
  • spsEuclidean ... Euclidean distance in the p-dimensional space (p = length of the spectra)
  • spsCorr ... Pearson's correlation coefficient of the two spectra
  • spsSigCorr ... significant correlation only - a correlation is returned only if the correlation is significant, otherwise a zero value is returned
  • spsSpecAngle ... angle between the two spectral vectors
On return, the variable parameter Similarity contains the calculated similarity measure.

The function result delivers on of the following error codes:

 0 ... everything is OK
-1 ... length of Spec1 and Spec2 do not match


Last Update: 2018-Mai-02