sgcm

Returns a vector with four values: combined metric, SG combined metric, magnitude, and phase difference.

Syntax

sgcm(xvect, yvect_1, yvect_2, debug)

Argument

xvect
X vector of the data to be analyzed.
yvect_1
First Y vector of the data to be analyzed.
yvect_2
Second Y vector of the data to be analyzed.
debug
Flag to turn on the debug mode (optional argument).
0
Off (default).
1
Prints the debug information into the message log.
2
Prints the debug information to debug.csv in the current working directory.

Example

retvec = sgcm (p1w1c1.x,p1w1c1.y, p1w1c2.y)
C = retvec[0]
SG = retvec[1]
mag = retvec[2]
phase = retvec[3]

Comments

Consider two signals a(xk) and b(xk), k=1...N. You are interested in computing a metric that shows how similar these signals are.
  1. Calculate the metric M for magnitude difference and P for phase difference as follows:


  2. Calculate the combined metric C as follows:
    C=1 is a perfect match, C=0 is not a match.
Note: is known as the Sprague-Geers Combined Metric.

The sgcm function returns a value of C.