The JavaScript blog.


experiments motion

Motion Sensing with the Doppler Effect

Posted on .

If you try out the following project, be aware that it emits a high frequency sound! Daniel Rapp, who previously sent in Spectroface, has been working on motion sensing using the Doppler effect (GitHub: DanielRapp/doppler, License: MIT). It's based on a paper (PDF: guptasoundwavechi2012.pdf) that explores the concept in more detail. From the abstract:

We present SoundWave, a technique that leverages the speaker and microphone already embedded in most commodity devices to sense in-air gestures around the device. To do this, we generate an inaudible tone, which gets frequency-shifted when it reflects off moving objects like the hand. We measure this shift with the microphone to infer various gestures. In this note, we describe the phenomena and detection algorithm, demonstrate a variety of gestures, and present an informal evaluation on the robustness of this approach across different devices and people.

Daniel's version uses HTML5 and includes several examples, including page scrolling and a theremin. The source uses the audio API and typed arrays. I haven't fully figured out the source, but I think it emits tones from the left and right speakers and then compares the result from the mic to figure out movement.

This is one of the best hacks I've seen for a while, and although the tone makes the applications limited the fact it works at all is fascinating!