How to determine time lag by using xcorr ?
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Correlation and Convolution dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!