LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i extract the time delay between my acoustic signals?

I am currently using the NI9233 to capture the analog signals from 4 acoustic sensors which distance and coordinates relative to each other have been predetermined. Using the standard deviation tool, I am able to differentiate the Gaussian White Noise from the sound source. The only problem I am facing currently is that I am unable to extract the time delay of the signals relative to one another to perform a mathemathical analysis on the direction of the sound source. Of course visually I can see the delays betwen the signals in the graph, but how do extract these delays in terms of numerical values (milisecs)?

 

Attached is an example of my signals.

 

 

0 Kudos
Message 1 of 16
(5,525 Views)

Where is the signal!?

 

There are a couple of methods for calculating delays.

 

For example, you can calculate distance between zero crossings. You could also calculate the cross correlation between the two signals and figure out the delay. In frequency domain, you can calculate the FFT of both signal and calculate the phase difference. Labview also has cross spectrum vi although I have not used them, but they can calculate phase delay directly.

 

Calculate time of flight might also help figure out the delay. Look at papers that talks about picker like AIC.

 

 

 

 

 

 

 

Message 2 of 16
(5,514 Views)
Sorry about that. Just realized the attachment seems to be missing.
0 Kudos
Message 3 of 16
(5,502 Views)

I would be attempted to try time domain cross correlation and time of flight method.

 

Any opinion from others?

0 Kudos
Message 4 of 16
(5,498 Views)

I have read an article somewhere about someone using the cross correlation function to calculate the time delay by taking a subset of the longer sample set which begins at '0' and is equal in length to the shorter sample set. He then calculates the correlation coefficent of the short set compared to the subset of the longer sample set and shifts the subset by one sample so that it now starts at index '1' but is till equal in length to shorter sample set.

 

This process of correlation and shifting is done continuously until the highest correlation coeeficient is found and thedifference between the starting index and the index at which the highest correlation coeeficient was found on the longer sample set is used to calculate the delay between the two sample sets.

 

To do the cross correlation can be done quite simply by using the cross correlation function but,

 

1) how do i take a subset of a sample set and index it?

2) shift the sample set?

 

Thank you.

0 Kudos
Message 5 of 16
(5,495 Views)

there is an example in the help entry of the cross correlation vi. That example shows how to calculate the delay between two signals. Note that after cross correlation, the length of the result becomes the total of the two input minus one. The peak corresponds to position when the two signals have the max likelihoold.

 

Yeah, you may need to chop the signals somehow so both only contains one echo but I don't think one must be the same length (like the example shows one has 100 points, the other has 200 points)

0 Kudos
Message 6 of 16
(5,493 Views)

First of all thanks for the quick response bo200008, i really appreciate your help and input.

 

Hmm, but i can't seem to locate the cross correlation vi to calculate the time delay between two signals as you mentioned.

 

Sorry to trouble you but do you think you can post the link here.

 

Thank you.

0 Kudos
Message 7 of 16
(5,487 Views)

I don't know what version you are using and if you need to install some toolkit but this appears in both 7.1 and 8.6 on my computer.

 

http://zone.ni.com/reference/en-XX/help/371361E-01/lvanls/crosscorrelation/

Message 8 of 16
(5,462 Views)

As recommended by bo200008, i have constructed and tested the cross corrrelation vi suggested by the link above. I can easily read the delays between 2 signals when the two signals are nice and very similiar to each other. However when i tried to implement it into my system, i am baffled and confused by the data that i get (possibly i could have done it wrongly). I have attached 3 samples of my readings of the cross correlation of my 3 other sensors to my north sensor, one taken with 100 samples, another at 200 samples and the third at 500 samples.

 

The cross correlation graph's x-axis definitely cannot be seconds here because it is too large a time delay. Anyone able to help me out here?

0 Kudos
Message 9 of 16
(5,426 Views)

I will also attach a print scrint of the correlation part of my vi as well as my vi itself.

Please let me know if I have done any mistakes and any advice on how to procedd from here will be most welcomed.

 

Thank you

0 Kudos
Message 10 of 16
(5,425 Views)