Y·B← All projects
Acoustics · signal processing

Laptop sonar

Bats and submarines find things by listening to echoes. Your laptop can too. It plays a 4-millisecond chirp twelve times a second, near the top of human hearing, and records it with the mic. A matched filter then turns each echo's delay into a distance. Move your hand slowly toward and away from the screen to see it.

Volume. It starts quiet, at 15%. The chirps sit near the top of human hearing: some people (and most pets) can hear them, and they get unpleasant at high volume. Turn it up slowly.

Use the laptop speakers, not headphones. Sonar needs the sound to leave the speaker and bounce back, and near-ultrasonic chirps straight into your ears aren't pleasant.

Needs microphone access and your laptop speakers.
Best in a quiet room, sitting about an arm's length away.
--cm · moving object
Off
sample rate–
band in use–
own chirp heard–
strongest static echo–
speaker → mic responsenot calibrated
echo profile now0 → 150 cm
signal
volume15%
See how it worksFour steps, one at a time

The waterfall is a range-time plot: time scrolls left, distance goes up, and brightness is echo strength.

Tested so far: on a 13-inch MacBook Pro (M1) in Chrome, the built-in microphone runs at 48 kHz with echo cancellation, noise suppression and auto-gain all off. In simulation, a hand from 20 to 140 cm comes back within 2 cm. Real-hand range on hardware hasn't been measured yet.