Calculating time of flight from a series of acoustic waveforms
1 回表示 (過去 30 日間)
古いコメントを表示
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.
0 件のコメント
採用された回答
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 件のコメント
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 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!