Calculating time of flight from a series of acoustic waveforms

조회 수: 4 (최근 30일)
Lorenzo Metilli
Lorenzo Metilli 2020년 2월 4일
편집: Pranav Murali 2020년 3월 19일
Hello all,
I am trying to calculate the time of flight (in milliseconds) from a set of acoustic signals. The data I have looks like this:
voltage 500x8000 double
time 500x8000 double
I've tried playing around with the xcorr function but I'm not sure of how I can actually measure the time of flight. I notice the xcorr function produces a 2M-1 long vector for each correlation, how can I use these values to extract the position of the peak in relation to the time vector? Many thanks.

채택된 답변

Pranav Murali
Pranav Murali 2020년 3월 19일
Hi Lorenzo,
You are trying to calculate the time of flight from the dataset you have. The transmitted and received signal (Voltage in your case) are correlated and the time at which the correlation reaches maximum is the Time of Flight.
The xcorr function can be used to find the correlation between the transmitted and received signals. Then determine the maximum value(s) and the corresponding index in the matrix. You can then determine the time of flight by subtracting the values stored in the corresponding index of the time matrix and the time at start of transmission.
  댓글 수: 2
Lorenzo Metilli
Lorenzo Metilli 2020년 3월 19일
Hello Pranav,
thank you for your reply. I guess what I haven't mentioned is that, in the amplitude signal, the excitation pulse is present and centered at 0 microseconds (the time vector starts from -100 microseconds as well). Therefore I guess that I could "separate" the excitation pulse (transmitted) into a different matrix and make it correlate with the received pulse matrix? And check the index as you are suggesting? I will try this later and get back to you.
Kind regards,
Lorenzo
Pranav Murali
Pranav Murali 2020년 3월 19일
편집: Pranav Murali 2020년 3월 19일
Yes Lorenzo, the approach you are suggesting seems to be good. Since excitation starts at t=0us, the element in the time vector corresponding to the maxima after correlation will be the TOF.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by