I have 2 acceleration vectors, each represented by a matrix with its first column corresponding to the magnitude of acceleration and second column corresponding to the time (in ms) They both represent the same data, but one sensor is started a little later than the other, so I'm trying to remove the time lag using correlation.
How do I find the correlation between these 2 matrices? I tried to do xcorr2
but it doesn't seem right and doing xcorr
would probably calculate correlation with only the values into consideration, but I also want to account for the time. The idea is that I should finally get a correlation vector wrt time and then when I calculate the peak of the correlation vector, its index would correspond to the time lag.
I'm really confused here, will an FFT help? How would you suggest I go about it?