Skip to content
Plot motion in realtime webapp using ultrasonic doppler sensing via microphone and speakers
JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
index.html
plotter.js
smoothie.js
ultrasound_doppler.js

README.md

Ultrasound Motion Detector

Plays ultrasonic (>20k Hz sinusoid) from computer or phone speakers and measures Doppler shift response via microphone. See ultrasound_doppler.js for algorithm details, and plotter.js for plot configuration.

Webapp Options

  • toggle doppler: Toggle the algorithm.
  • toggle synth: Toggle and audible synth to play tones proportional to the motion. Like a theramin!
  • toggle gate: Clamps motion to 0 if its magnitude is below a threshold
  • toggle fullscreen: Entry or exit fullscreen browser.

Theory

doppler shift equation

Motion near (within a few meters) the microphone/speaker will induce a measurable Doppler shift to the emitted source sinusoid. The received sinusoid's change in frequency is proportional to the magnitude of motion. Information about the direction of the motion relative to the speaker/microphone pair can also be extracted based on the sign of the change in frequency. More info in the linked paper.

Ultrasound Doppler Algorithm

A sinusoid of ultrasonic frequency is emitted via the speakers and received via the microphone. The change in frequency between the emitted sinusoid frequency and the perceived sinusoid is computed in realtime and converted to a unitless motion magnitude using Doppler shift principles

Ultrasound Frequency Initialization

The ultrasound sinusoid is initialized by sweeping 19 kHz to 22 kHz and choosing a frequency that has low ambient noise.

Credits

Algorithm based on doppler which is pasted on the research from the Ubicomp lab. The plotting display uses the smoothie.js charting javascript library. Doppler equation image from hyperphysics.

You can’t perform that action at this time.