EMG Cross Correlation Temporal Relationship

Hi all,

I am having a problem and will try to explain it as best I can.

I am trying to cross correlate EMG waves to determine the temporal relationship between two waves. While I know Igor is able to perform cross correlation I am unsure how to get the temporal relationship from this. So assume I am starting with two filtered waves that need to be cross correlated and the temporal relationship from the first peak of wave one needs to be determined from the first peak of wave two and so on for the rest of the wave. Does anyone know how I would do this and be able to interpret the results? Any help would be greatly appreciated, and the more step by step it is the better.

Thanks,
Ian
Hello Ian,

Just in case you did not receive my response from support@wavemetrics.com, here are some pointers:

Let us start with simple example of two waves that have no relation to each other:
make ddd=enoise(1),eee=enoise(1)


Now compute and display acausal correlation:
Matrixop/o aa=correlate(ddd,eee,4)
Display aa


As you can see — this is just a bunch of noise without apparent correlation peak.

Next create somewhat correlated signal:

Duplicate ddd,fff
fff+=enoise(0.05)


Recompute the correlation:
Matrixop/o bb=correlate(ddd,fff,4)
Display bb


As you can see, a sharp peak at 0 indicates that the two signals have correlation over a very short distance.

You can simulate a correlation over longer offsets using, for example, the smoothing operation:
Duplicate/O ddd,W_Smooth
Smooth/EVEN/B 4, W_Smooth
Matrixop/o cc=correlate(ddd,w_smooth,4)
Display cc


If you intend to try to relate the correlation width to real world numbers you should use wave scaling in your signal waves and use the Correlate operation instead of MatrixOP. If you are trying to determine temporal offsets consider the following example:
Duplicate/O W_Smooth,W_Correlation
Correlate ddd, W_Correlation
Display W_Correlation


As you can see, the peak correlation is at zero offset. Next, create a relative shift between the two waves and repeat the correlation:
Rotate 5, w_smooth  // shift w_smooth by 5 deltaX (from your wave scaling)
Duplicate/O W_Smooth,W_Correlation
Correlate ddd, W_Correlation


You can now check the position of the new correlation peak and you will see that the offset matches the offset which you introduced in the Rotate operation.

I hope this helps,

A.G.
WaveMetrics, Inc.