# Time delay estimation using ultrasound

I have a sound source that generates an ultrasonic pulse. I have two microphones seperated by a distance which are at a distance from the source. I want to find the time delay of arrival of the ultrasonic pulse at the mics. I am filtering out all the frequencies other than my source frequency from the outputs of the mics. Due to noise and other reasons, the shape of the pulse received at each mic is not same. I am using cross-correlation to find the time delay but the results are inconsistent. I observed that when I use low frequencies (100~300hz), results are consistent. But I want to find using ultrasonic sound. I am using the below code for finding time delay

[xc,lags]=xcorr(x1,x2);
[m,i]=max(xc);
timeDelay=lags(i);


Can anyone please tell me what is it that I am doing wrong and how to correct it? I posted a similar question here, but couldnt understand the provided answer. In some articles, it is mentioned that cross-correlation works only for cases when the signal shapes are identical. If so, how can I find the delay? I was also wondering if the voice tracking cameras used in video conferencing use some technique other than cross-correlation.

• How long a pulse? With what ruse/fall time? At what sample rate? Are there any potential audio reflections or reflectors in the environment? – hotpaw2 Mar 1 '14 at 16:02
• can you show your pulse in a figure? how different between the two pulses? do they have the same number of peaks? – lennon310 Mar 1 '14 at 16:54
• – endolith Mar 1 '14 at 19:52
• @hotpaw2, my pulse details are: total duration:0.5s, rise/fall time: 0.05s, sample rate: 44100 and audio reflections can be neglected. – BaluRaman Mar 3 '14 at 4:34