1
votes

I have two (or more) time series that I would like to correlate with one another to look for common changes e.g. both rising or both falling etc.

The problem is that the time series are all fairly noisy with relatively high standard deviations meaning it is difficult to see common features. The signals are sampled at a fairly low frequency (one point every 30s) but cover reasonable time periods 2hours +. It is often the case that the two signs are not the same length, for example 1x1hour & 1x1.5 hours.

Can anyone suggest some good correlation techniques, ideally using built in or bespoke matlab routines? I've tried auto correlation just to compare lags within a single signal but all I got back is a triangular shape with the max at 0 lag (I assume this means there is no obvious correlation except with itself?) . Cross correlation isn't much better.

Any thoughts would be greatly appreciated.

2
Did you demean the signals before cross-correlating? - Kyler Brown
Good question, will have to check but I don't think I did. Will have another look today. When comparing a signal with itself I tried de - meaning it but it didn't seem to make any difference. - Mark
"comparing a signal with itself" ie autocorrelation (forgot to say that :-)). Thinking about it though, I guess de - meaning the signal before autocorrelation will make little difference. I will check whether I de - meaned before cross correlation later today. Are there any other mathematical techniques to correlate signals? - Mark
I tried using xcov instead of xcorr in matlab (the difference essentially de - meaning before cross correlation) and the correlation results look a lot more sensible - Mark

2 Answers

2
votes

Start with a cross-covariance (xcov) instead of the cross-correlation. xcov removes the DC component (subtracts off the mean) of each data set and then does the cross-correlation. When you cross-correlate two square waves, you get a triangle wave. If you have small signals riding on a large offset, you get a triangle wave with small variations in it.

0
votes

If you think there is a delay between the two signals, then I would use xcorr to calculate the delay. Since xcorr is doing an FFT of the signal, you should remove the means before calling xcorr, you may also want to consider adding a window (e.g. hanning) to reduce leakage if the data is not self-windowing.

If there is no delay between the signals or you have found and removed the delay, you could just average the two (or more) signals. The random noise should tend to average to zero and the common features will approach the true value.