Hi,everyone, I got a very strange issue.
b is a signal of 251 samples. c is got by shifting b by 5 sample. (b and c are attached).
But when I do xcorr on b and c, the max correlation always occurs at 0 lag. which I do not understand. Can someone help?
Below is my code. Thank you.
load b.matload c.matfigure;plot(b);hold on;plot(c);[r,lag] = xcorr(b,c,'coeff');[m, i_max]=max(r);shift=lag(i_max);% plot(lag,r);
display(shift);
Best Answer