Cross Correlation and time lag

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 commentaires

dpb
dpb le 19 Avr 2015
" Or am i doing something wrong?"
Probably, but we can't tell. Possibly the resolution of the data acq at the sampling rate and with whatever filtering your using combined with the size and design of the structure is such that there is no discernible time lag between the two locations. 3 msec dt--> only 333 Hz which ain't much bandwidth--would have to be a very large structure it would seem.
Jade Sen
Jade Sen le 19 Avr 2015
oh thanks, ill try increasing the sampling rate then. Im using a simple second order butterworth bandpass, btw.
dpb
dpb le 20 Avr 2015
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...

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Audio I/O and Waveform Generation dans Centre d'aide et File Exchange

Question posée :

le 19 Avr 2015

Commenté :

dpb
le 20 Avr 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by