5 ms·
Having worked on a similar project, my experience is that signal-to-noise is a very challenging problem when you have an air gap. Inevitably, it opens up room
by ravenstine 9y ago
Having worked on a similar project, my experience is that signal-to-noise is a very challenging problem when you have an air gap. Inevitably, it opens up room for minute errors caused by accoustics. The only "reliable" workarounds I devised were to increase broadcast duration and rebroadcasting the same data with simple checksums.
This was what I came up with:
https://github.com/Ravenstine/airsocket https://github.com/Ravenstine/airsocket
Note it's extreme crappiness is due to a combination of my inexperience and also my desire to build as many parts from scratch as possible. The Web Audio API is only used to play audio, but the oscillator and decoding functions were written by me. It barely works. It's probably better to go full Web Audio all the way since I'm sure there's hardware acceleration(particularly with AnalyserNode). The author's method of encoding bytes is also far superior to what I came up with.
I wish such an article was published when I was trying to devise my own audio modem. He does an excellent job going over every step and explaining what's going on. Documentation and tutorials around Web Audio used to be too convoluted, with basic examples too few and far between.
- anilakar 9y agoCongratulations. You just found out the essence of signal processing in telecommunications.
- brian-armstrong 9y agoI have a WebAudio modem that works reasonably well, and I went a different direction with it. Mine uses a C DSP/SDR library with good error correction, run through emscripten to generate the samples. You can try it here https://quiet.github.io/quiet-js https://quiet.github.io/quiet-js
- ravenstine 9y agoActually, I think it was your project that gave me the idea to attempt near-ultrasonic transmission. I could only get to ~15000hz before it would just not work and I never figured out why that was. Maybe there's a flaw in how I used the Goertzel algorithm. (reason I went with Goertzel is because I built it for a previous project and wanted to see how far I could take it) Is that example page new? That's brilliant. Your ultrasonic transmission seems to work pretty consistently.
- tonmoy 9y agoA lot of microphones and speakers have built in hardware low pass filters that kill anything above 15kHz
- Arve 9y agoSomeone pointed out low-pass filters to you, but that's not the entire story. Built-in speakers in phones and laptops generally don't have a naturally extended frequency response. A while ago, I made audio measurements of the built-in speakers on the iPhone 7 Plus - https://imgur.com/gallery/DRbu5 https://imgur.com/gallery/DRbu5 The iPhone's extension is not entirely atypical of such devices, and leaves you with a reliable passband of 500 Hz to 10 kHz - above and below those frequencies, you're getting too much noise. If you're airgapping with audio cables, you'll have a reliable passband of 20 - 20 000 Hz or thereabouts, with some caveats for built-in audio on devices such as a Raspberry Pi that fizzle out at 15 kHz. As noted by brian-armstrong's comment, you'll only get reliable near-ultrasonic airgapping over a wired connection.
- brian-armstrong 9y agoThis isn't correct, by the way. Quiet's near-ultrasonic mode (~19kHz) works fine from several feet away using phone hardware. As long as you're using relatively narrowband communication, it works fine.
- vvanders 9y agoEven better than rebroadcasting is Forward Error Correction[1]. It's the basis of pretty much all modern radio based telecommuncation protocols(WiFi/3G/LTE/etc). Basic FEC can go a long way, esp if your packet sizes are large, latency is high or you have a lot of channel congestion. [edit] To give you an idea how awesome FEC can be quite a few ham operators do EME(Earth->Moon->Earth) contacts via JT65 with FEC[2]. [1] https://en.wikipedia.org/wiki/Forward_error_correction https://en.wikipedia.org/wiki/Forward_error_correction [2] https://en.wikipedia.org/wiki/Earth%E2%80%93Moon%E2%80%93Earth_communication https://en.wikipedia.org/wiki/Earth%E2%80%93Moon%E2%80%93Ear...