Why does the XCORR function in Signal Processing Toolbox 6.0 (R13) produce incorrect results when using sampled data? XCORR appears to produce incorrect results according to autocorrelation. If the data is sampled and has a non-zero mean, then the result of XCORR is significantly slow in its dropoff factor.
Kshitij Singh answered .
2025-11-20
Cxx(t,u)=Rxx(t,u)+E[x(t)]E[x(u)],
x=rand(1,1000); % Some signal without zero mean x=x-mean(x);% Make 'x' have zero mean [Rx, lags]=xcorr(x,'coeff'); % Calculate autocorrelation of 'x' and normalize zero lag to unity plot(lags,Rx); % Plot the autocorrelation vs. the lag