Sonic head tracking

Here's an interesting idea I had a while ago. It involves using the microphone in a headset like this, a fixed set of speakers and a high-resolution sound card (like almost any modern sound card) to track the position of the head of the person wearing the headset.

The software works by sending sounds through the speakers and trying to pick them up through the microphone. Once it manages to synchronize the sent pulses with the received pulses it can calculate the exact delay from sending a pulse to receiving it. Part of this delay will be due to the hardware involved or the latencies in the operating system, but these delays should be fixed. The remainder of the time is caused by the finite speed of sound in the medium between the speaker and the microphone. To a fairly good approximation this speed will be constant (about 300m/s) so using the delay one can work out the distance between the microphone and the speaker. Do this for two speakers and you can triangulate the position to a circle in the plane normal to the line between the speakers. Two more speakers and you can determine the position of the user's head quite precisely, up to the resolution limit of the soundcard (most modern soundcards can do 192k samples/second, giving a positioning accuracy of about 1.6mm).

Why would you want to do this? Well, the position of the user's head is a particularly interesting datum because it can be used to move windows around giving a pseudo-3D view. Suppose you have two windows on the screen and one is partially covering another. Normally to see the hidden part of the lower window you have to use the mouse (or worse, the keyboard) to move the upper window or bring the lower window to the foreground. But with a pseudo-3D view each window has a "Z-position" in front of or behind the plane of the monitor. If the user's head moves left then the closer windows move right and the further windows move left, allowing you to "see around" the upper window by moving your head, just as you would do with real objects. I haven't tried it yet, but I think it would be quite effective, and a cheap way to make a user interface much more immersive. I thought of doing this years ago but with an infra-red gadget strapped to the forehead - it only recently occurred to me that this could be done less intrusively with the microphone that many people wear anyway for telephony purposes.

Leave a Reply