3D soundPosted: January 18, 2011
I’m currently working on three dimensional sound.
Have you ever noticed that we can figure out where sound comes from, even though we only have two ears? Sorting out left vs right is pretty easy, but how do we determine front/back and up/down? It turns out that the sound entering our ear canals follows multiple paths, bouncing off the structure of our ear and causing interference patterns. Sounds coming from different directions have different patterns and our brain picks up on that.
In 1994 a team from MIT set out to record these interference patterns, using a dummy head with dummy ears and two microphones. They placed the head in a recording studio and played audio samples from 710 different positions. The resulting recordings, when combined with some DSP magic, can be used to simulate sound coming from anywhere. This technique is known as Head-Related Transfer Function, or HRTF.
I’m trying to get this working on my Android through stereo headphones, but performance is a problem. The MIT data set was sampled at 44.1kHz, so it can only be used to transform audio sampled at that rate. Unfortunately my HTC Tattoo can’t do that in real-time. The current version of the software takes 5.9 seconds to transform a 1.1 second clip.
The bottleneck seems to be my Fast Fourier Transform code. After digging deeper I found that the Tattoo doesn’t have hardware floating point! Sheesh, it’s like living in 1995. Anyway, I’ll see if I can get it working with integer arithmetic and whether it’ll speed things up significantly.