A question about sound localization

I sucssess to calculate delay time between two mics, now i want to know how i could convert delay time to sound source direction?
What is formula ?

Do you know if the sound came from in front of a microphone or from behind the microphone?

Yes the sine wave sound is on fornt of microphone always

Have you actually tested this? Pretty unique microphone.

Google "sound source localization" for lots of informative books and articles.

This thread begins to feel like a homework assignment.

I haven't studied this in detail, but...

With two mics you can find the angle (in two dimensions), not the exact location. I believe triangulation requires 3 mics, maybe more.

With our ears we move our head (sometimes subconsciously) to get a 2nd or 3rd "reading". Sometimes we "look" to see where the sound is coming from and that gives another reading, or maybe we see what's making the sound. This is why surround sound doesn't work in headphones... You move your head and the sound source moves with you.

And if you've ever tried to find the source of a squeak or rattle in your car, you know your ear's location abilities are "limited".

As you know, sine waves are repetitive so you can't tell a 180 degree shift from a 540 degree shift. And of course, you have to know (or analyze/calculate) the frequency if you want to calculate wave length and distance.

Yes.i calculate delay time and phase diffrence by fft

For a sound source at sufficient distance the angle of arrival is approximately given by

angle = arccos(deltaT * c / b)

Where deltaT is the time offset, "c" is the velocity of the wavefront (speed of sound), and b is the baseline between receivers. If the wavelength of the sound is smaller than the baseline there will be ambiguities.

This formula is useable for how much distance between sound source and recivers?

The sound source actually lies on a hyperbola described by deltaT = (r0 - r1)/c where r0 is the range from the emitter to microphone 0 and r1 is emitter to microphone 1.

The cosine formula describes a cone which the hyperbola asymptotically approaches with increasing range. Thus the cosine formula is strictly correct only at infinite distance, but it's an increasingly reasonable approximation beyond about 5x the microphone baseline distance.

To solve the hyperbola formulation, you need to know the range to the emitter which requires a third microphone at a minimum.

It should be possible to present the correct signals nowadays,
especially if the generating entity (let's say a VR game)
is aware of the head position and movement.

3d or 2d?

I calculate phase diffrence in 800 Hz and then convert it to time_delay, when calculate angle and direction by it ,but it is not correcte. When mics against to speaker it show 80 degree and when base mics rotate to the left , the angle decrase to 60 deg but when rotate to right it decrse until 78 degree,i think it have some problem.
I substract 0.00004 us but angle is not true yet
Do you know what is problem?

Did you calibrate the two microphones so you know the gain and phase characteristics of each mike?

Is is a side address unidirectional or bidirectional mike, like a Rohde? In any case, for phase measurements you must not use such a mike, you need an omnidirectional mike.

Such directional mikes either use phase shift to achieve directionality, or exhibit an ambiguous phase because it's picking up from both sides.

Well, sound doesn't go very far in 40 picoseconds.

I didnt calibrated gain and phase of mics

I use max4466 module preamplifire

How can i calibrated phase in two mics?