This post is the second in a series of posts exploring 3D Audio. It is a continuation of Investigating 3D Audio: Motivation
Something moves.  This object’s motion gets transmitted through a medium, such as air. The vibration caused by the motion travels through the medium in the form of a wave. The wave hits my body, my body processes information from it, and, if the original wave meets the correct conditions, I hear a sound.
What exactly happened so that I heard a sound? What do I subconsciously understand about a sound’s origin from what I have heard?
How We Process Sounds
For humans to hear an externally produced sound, the information from a sound wave needs to make its way inside the body to be processed. Here’s how the sound makes its way through the body.
Sounds are funneled into the body after hitting the outer ear.  The waves pass through the ear canal and vibrate the eardrum, which sets off a Rube-Goldberg Machine like set of reactions inside the ear. In this way, vibrations pass into the inner reaches of the inner ear’s cochlea. While there, they trigger an electrical signal that is carried to the brain, where it is processed as a sound we understand.
For a more in depth description of the process, check out How We Hear.
Two Ears, And Beyond
What happens in one ear is mostly mirrored in the other, if you, like me, are fortunate enough to have relatively well functioning hearing.
Next, I read about how our brain tells where sound is coming from. My most comprehensive source was NYU Professor David Heeger’s lecture on Auditory Pathways and Sound Localization, which is recapped below.
Some Ways to Analyze Sound, A La Dr. Heeger
Sounds are the products of vibrations that start from a motion. Each individual sound wave starts at a single point, and spreads out through a medium, such as air, in all directions.
Suppose you have heard a sound. There are multiple paths that sound could have taken to reach your ear. Some parts of the sound will travel directly from the source to your ear, but others will bounce off of surrounding objects, and only reach your ear as an echo. This often happens almost instantaneously. Therefore, you usually do not notice this in real time. This means that when you hear a sound, you are not only gaining a clue about where the originating sound came from, but also learning about its surroundings!
Spatial localization is how to tell where a sound is coming from based off of its location of origin in space with respect to the ear of interest.  This is done by assuming the ear of interest is at the center of a sphere, and that the sound originates on the surface of the sphere. You can describe the sound’s point of origin with respect to the sphere’s origin (your ear) using angles and distance.
You have two ears. Therefore, there are two different spheres from which your brain can glean information about the sound’s origin. Some ways to gain information are through analyzing the inter-aural intensity difference (IID) and inter-aural timing difference (ITD) between the ears.  Basically, given the intensity (loudness) of a sound at ear A and the intensity of the sound at ear B, along with the timing of the sound at ear A and the timing of the sound at ear B, you can tell a lot about where the sound originates from. The possible origins of the sound narrow down from an entire sphere to only a few possible points.
Tricking Your Ear
Lots of factors go into telling where sounds originate from. So far, all of the possible equations that I have found to help with sound localization are only found on Wikipedia’s Sound Localization page. While I would learn lots by trying to implement my own sound localization scheme, my friends are right. I should use a pre-built solution if I ever want to get around to music making. Now that I understand what sorts of concepts come into play when your ear tries to determine where sound comes from, I will be more comfortable looking into existing sound localization tools and packages and using their pre-made solutions.
One day, I hope to trick your ears.
Exploration of concepts will be continued on another day, in future posts.
 G. Elert. The Physics Hypertextbook: The Nature of Sound. (accessed January 13, 2018).
 D. Heeger. Perception Lecture Notes: Auditory Pathways and Sound Localization. (updated 2006).
 How Do We Hear. National Institute on Deafness and Other Communication Disorders (NIDCD). (updated January 3, 2018).