[chbot] Determining delay between two similar signals

Mark Atherton markaren1 at xtra.co.nz
Sun Jul 5 07:17:21 BST 2020


http://www.dspguide.com/ch7.htm specifically convolution

http://www.dspguide.com/ch7/3.htm has some basic drawings

The latter may have a pictorial example of what you are trying to do

DSPguide is a brilliant book.

HTH

-Mark




On 5/07/2020 5:27 PM, Robin Gilks wrote:

> Me again!
>
> I'm still getting nowhere with my project that will use ultrasonic
> transducers to measure wind speed.
>
> I understand that I need to run a cross correlation between the original
> transmitted signal and the delayed received one in order to work out the
> delay and hence (with a fixed distance between transducers) the speed of
> the wind.
>
> Trouble is, when I try to find basic information I end up in a cloud of
> matlab and scipy mazes that don't help me at all. I just don't seem to be
> able to make the leap from basic idea to usable code on an embedded
> system. It really doesn't help me to read that I need to an FFT when I
> wouldn't know an FFT from a dead elephant!
>
> A typical example of what I find is thus (from
> https://www.dsprelated.com/showarticle/26.php):
>
> "A well-known solution to estimate delay is to calculate the
> cross-correlation between the two signals. An efficient implementation
> calculates |ifft(fft(a) .* fft(b)|, using FFT for cyclic convolution.
> A peak in the result indicates the integer-sample delay with best alignment."
>
> warblefarblegarble :(
>
> Thought a couple of times that I'd found a code snippet that delivered the
> goods but on trying them out they don't actually work. e.g.
> https://bitbucket.org/GreyCat/calc-sound-delay/src/default/
> I feed in 2 audio files, one of which I have trimmed a 150ms from the
> front of with Audacity and it tells me the delay is 3-4 times what I'd
> actually created.
>
> Confused...
>




More information about the Chchrobotics mailing list