There is an audio recording on VKontakte called a 3D hairdresser or something like that. So, if you listen to it with good headphones, then you really have a beautiful picture in your head of how you sit in a hairdresser, how a person plays the guitar, how then the barber comes running and starts to cut you, and all this is super-realistic, you are straight you feel at what point in space this person is. So, in parallel, he talks about how our brain is an amazing thing, and he manages to calculate the difference in the time of arrival of sound in the left and right ears and thus "draws" a picture of finding one or another sound source for us, orientates us according to them. And in general, I think it's not a secret for anyone that some animals, for example, the same bats, practically do not see anything, but orient themselves in space in this way.
We have two ears, and the sound source relative to them is never exactly on the front-back axis.
In addition, our head and body are constantly in motion, albeit imperceptibly.
In addition, the auricles have an irregular shape, due to which sounds from the front and from behind come and are heard differently.
However, if you put a person in an ideal sound studio in which there is no echo, turn off the lights, then it is shown that determining the source of the sound in front or behind (and above or below) is already difficult.
According to the wiki:
1 Difference in mean amplitude (historically the first principle discovered): for frequencies above 1 kHz, that is, such that the sound wavelength is less than the size of the listener's head, the sound reaching the near ear has higher intensity.
2 Phase difference: branched neurons are able to distinguish a phase shift of up to 10-15 degrees between the arrival of sound waves in the right and left ear for frequencies in the approximate range from 1 to 4 kHz (which corresponds to an accuracy of determining the arrival time in 10 μs).
3 Difference in the spectrum: folds of the auricle, head and even shoulders introduce small frequency distortions into the perceived sound, absorbing different harmonics in different ways, which is interpreted by the brain as additional information about the horizontal and vertical localization of sound. wikipedia.org