Please bear with me, as I'm only a programmer, and have no knowledge of signal processing as a discipline.

I have an application which generates a short pulse of 12 kHz frequency sound from a single central source, then captures any reflected sound with a pair of stereo microphones a few cm apart.

I want to be able to, effectively, scan across a range of angles, and extract the reflected sound at each angle, in order to build a picture of what is reflecting the sound. Essentially, sonar.

I've tried extracting the signal at different angles by sampling the incoming waveforms at different points corresponding to the time difference each angle would represent; but I'm not sure how to get something sensible from that. (I've tried calculating what I'm calling the correlation by dividing the absolute difference between the left and right signals and dividing by the maximum possible to normalise it; but all I seem to get, if I plot it, is noise).

I've spent a couple of days trying to find it online; but I'm hampered by my utter lack of knowledge of what even the most basic terms mean, and it's also a long time since I studied maths.

  • $\begingroup$ Beamforming with only 2 microphones will probably not give you enough directivity for your application. The main reflection will probably flood al other values. Can you share any of your results so far? $\endgroup$
    – Juancho
    Jul 6, 2017 at 13:33

1 Answer 1


Cross correlation is most suitable for low SNR long term observation of continuous signals.

I recommend you try to identify the leading edges of your short duration received Signals. Leading edges are usually direct paths. The classic text book solution is to use a matched filter, but often a high Signal level is enough. With the speed of sound and time difference of leading edges, simple geometry should give you an estimate of the direction of arrival.

In actual SONAR a single multi mode ring hydrophone produces an arrival direction. I don't know if there is a comparable sensor in air acoustics.

You should also try to see if there are built in offsets in your collections. Not all audio cards have actual multichannel sampling.

Good luck

  • $\begingroup$ to add to what Stanley says: To have a ring of microphones makes the math easier, but it's not strictly necessary. However, having microphones in an array at a constant distance is the optimum solution for most problems, so yeah, you get ambiguities in any case with only two mics, you get a theoretical solution with three, and you get better resolution the more receivers you have $\endgroup$ Jul 6, 2017 at 19:08
  • $\begingroup$ Thank you for this. I did look at cross-correlation; but I couldn't see how to apply it when there are multiple incoming signals as is the case here - the output signal is spherical, and there are multiple objects at different angles and distances reflecting back. $\endgroup$ Jul 7, 2017 at 4:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.