Matlab xcorr: What is the interval of the delay?

799 views Asked by At

I want to find a cross correlation between to signals both with size 1000. When I use the Matlab function xcorr() I get a vector back with length 1999. What does this length mean? Does it mean that the delay is from 0 to 1999 or something else?

Thank you very much.

1

There are 1 answers

0
Kostya On

As explained on xcorr webpage http://www.mathworks.nl/help/signal/ref/xcorr.html?searchHighlight=xcorr,

If x is an M × N signal matrix representing N channels in its columns, then xcorr(x) returns a (2M – 1) × N^2 matrix with the autocorrelations and mutual cross-correlations of the channels of x. If you specify maxlag, then r has size (2 × maxlag – 1) × N^2.

In your dataset, maxlag=1000. You can output the lag values using

[r,lags] = xcorr(x,y)