Cross Correlation and time lag
1 次查看(过去 30 天)
显示 更早的评论
So in my project work, i placed two accelerometers on a single vibrating body and i want to find the timelag between the signals at either end...
[Correlation,lag]=xcorr(voltage1,voltage2);
corrlength=numel(Correlation);
[mag,Index] = max(abs(Correlation));
sampletime=0.003 ;%data acquisition
timelag=lag(Index)*(sampletime);
------------------------------------- voltage1 and voltage2 are bandpassed signals from the accelerometers in a specific noise range
But everytime i run the function, the timelag and lag amounts to zero, no matter how much i adjust the accelerometer sensitivity and position. Is it supposed to be zero? Or am i doing something wrong?
3 个评论
dpb
2015-4-20
I'd start by looking at the two raw data signals with a scope triggered off the input first, then Accel A and see if the experimental setup is ok first...
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!