Variations on Cross Correlations

8 views (last 30 days)
Tim
Tim on 11 Jul 2013
I need a way to cross-correlate two signals which are not simply lagged copies of each other. The amplitudes are different (even when normalized) and one signal may show peaks where another does not. However, the overall geometry of the two signals should be the same (or rather, I'd like to find the lag(s) at which they overlap the 'best'). I also need to test if the lag changes through time.
For these two reasons, simple cross correlation (xcorr or in time series toolbox) will not work. To address the problem of changing lag, I have used timewindow_corr.m which searches for lags within time windows, as opposed to across the whole series. This seems to work well. I am, however, skeptical of the results because I am ignorant of what the cross correlation is doing to measure the similarity of the signals, which, as described above, have very different forms. I also get different results when using xcorr vs. time-window corr -- xcorr indicates a shift across the entire series; timewindow_corr indicates zero lag for all time windows considered.
Can anyone suggest a method for doing this in MatLab, or even what avenue is worth pursuing? Any help will be greatly appreciated.
Cheers,
T

Answers (1)

Image Analyst
Image Analyst on 11 Jul 2013
Do you want to try normalized cross correlation? It's in the Image Processing Toolbox.
  1 Comment
Tim
Tim on 11 Jul 2013
Thanks for replying! It sounds like a good idea, but I can't find anything for using it to compare two time series, over the same time interval. Can you suggest an approach? Also, would there be a way to make rolling or windowed calculations of correlation?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!