This function calculates a similarity matrix and returns
the sample number that is most similar to all other samples. This is
possibly preferable as a reference sample since warping then may be
kept to a minimum. Either RMS or WCC may be used as similarity
functions.
data matrix or array of signals, specified row-wise. In case of an array, the third dimension should differentiate between the different samples
optim.crit
either "WCC" or "RMS"
trwdth
the width of the triangle in the WCC criterion, given as
a number of data points. Default: 20
wghts
Optional weights vector in the WCC criterion; will be
calculated from the triangle width if necessary. Sometimes it is
more efficient to pre-calculate it and give it as an argument
smooth.param
smoothing parameter for smoothing the signal when
optim.crit equals "RMS". If no smoothing is required,
set this to 0