This is probably the most useless-but-still-cool program I've written. It uses only my stock MacBook Pro (no external hardware) to measure the distance to the ceiling. It seems to be accurate to within about 1-2 inches. Currently I'm not making the program available to the world because it's a dirty hack, but it's only about 200 lines of code.
thats pretty cool but its hard to believe. So it sends a sound off, and all within a milisecond stops listening, then listens again before the sound bounces off the cealing and returns ? I mean i wouldnt think the laptop would stop vibrating before the sound returned...let alone initiate and process the microphone
bl4h1 2 years ago
It's actually even simpler than you said: you start recording, and then immediately play the sound. After some amount of time you just stop recording and begin processing. Finding the original chirp in the signal eliminates any latency issues which would otherwise be a killer.
If memory serves the laptop stopped vibrating well within about 5ms, which corresponds to a dead zone of about 2.75 feet round trip.
DaveTheYellowDart 2 years ago