How to determine time lag by using xcorr ?
Mostrar comentarios más antiguos
Hello everyone,
I am trying to determine the time lag between two signals delayed with the function xcorr but I'm not sure I'm doing it the right way.
Here's the code that i am using:
[cor,lag]=xcorr(SIGNAL,SIGNAL2);
[~,I]=max(abs(cor));
lagDiff=lag(I);
Time_Diff=lagDiff*DT;
Where DT is the sampling time in sec,
I am not sure si Time_Diff is giving the real time Lag between the two signals.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Correlation and Convolution en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!