# How to detect direction of sound using four microphones?

I have a box with four microphones on its sides: one on top, one on front and two on left and right sides.

Is it possible to calculate a vector from the center of the box to the source of sound in real time?

• i might suggest arranging the 4 microphones at vertices of an equilateral tetrahedron. that is also the same as picking 4 corners out of 8 of a cube, where none of the microphone corners are directly adjacent to each other. Aug 15, 2022 at 15:32
• with even three microphones that are not colinear, it is possible. the 4th microphone helps with some redundancy. assuming a single point source of sound, what you need to do is measure the difference in arrival time of the sound at the different microphones. from the arrival times you can do some vector geometry to point in a direction. the way to measure this difference in arrival time is with an operation known as cross-correlation. Aug 15, 2022 at 15:36

Is it possible to calculate vector from center of box to the source of sound realtime?

Theoretically yes. As long as the microphones are no co-planar or co-linear, 4 is fine.

You can use cross correlation to determine the time of arrival difference between any two microphones. Using a proper geometric transform you can calculate the direction of arrival estimate.

The easiest 4-microphone configuration has the shape of coordinate system: one microphone at the origin and one each one unit distance away on the X, Y, and Z directions respectively.

The devil is in the details though. Things to tackle are

• Environmental noise, signal to noise ratio, diffuse noise, directional noise sources, concurrent sources, etc.
• Strong individual reflections (which correlate highly with original signal)
• Acoustic shading of the box
• Temporal and spectral properties of the source signal
• Reverb & acoustic environment
• Is there any example how to do it (in simple conditions: no environmental noise, reflections, etc) Aug 15, 2022 at 17:17
• "concurrent sources" - is it possible to split sources and find direction for each? Aug 16, 2022 at 13:34