DEV Community

Aman Sachan
Aman Sachan

Posted on

I built a modem that talks through sound. Yes, literally sound.

Every device you own has a speaker and a microphone. I decided to use them for something useful.


The problem worth solving

Natural disasters knock out cell towers. WiFi dies at conferences. Underground sensors need to offload data where nothing reaches. Bluetooth pairing is painful and range-limited. LoRa is great but requires hardware you don't have.

Sound doesn't care about any of that.

Every phone, every laptop, every embedded board with a transducer — they can all talk. And sound propagates through walls. And you don't need a license.

So I built SignalHop — a complete acoustic mesh networking stack that turns any device into a peer-to-peer mesh node using nothing but the speakers and microphones they already have.


The acoustic modem

The core is an FSK (Frequency Shift Keying) modem running at ultrasonic frequencies:

  • 0 → 18,000 Hz (low tone)
  • 1 → 20,000 Hz (high tone)

Both are in the ultrasonic range — inaudible to humans, perfectly detectable by any microphone with a 48kHz sample rate. At 500 symbols/sec, the modem delivers ~62 bytes/sec of raw throughput. Not Netflix. But enough for text messages, sensor readings, GPS coordinates, and emergency beacons.

Each bit is a 2ms tone burst with cosine-tapered edges to reduce spectral splatter. The Goertzel algorithm does single-tone energy detection — efficient enough for real-time embedded operation, no FFT required.

Frame structure:

[Preamble: 4 up-chirps, 200ms total] → [Header: 41 bytes] → [Payload: ≤255 bytes] → [CRC32: 4 bytes]
Enter fullscreen mode Exit fullscreen mode

The chirp preamble is a linear frequency sweep from 16kHz to 22kHz. Receivers use normalized cross-correlation to detect it — amplitude-invariant, works in both quiet rooms and moderately noisy environments.


What the numbers actually say

I measured everything in the lab, not in my head:

Metric Value
Encode latency (77B payload) 16.6 ms mean
Decode latency 713 ms mean
Decode P95 721 ms
Round-trip success 100% (lab, noise sigma ≤ 0.15)
Max payload 255 bytes
Chirp detection threshold corrcoef ≥ 0.3

The decode is slow because it scans the entire signal with a correlation loop. That's the next optimization.


The routing layer

Point-to-point is easy. Multi-hop is where it gets interesting.

SignalHop's mesh layer does:

  • Neighbor discovery via periodic chirp beacons
  • Route selection via a shortest-path routing table
  • Duplicate suppression so packets don't loop forever
  • Route expiry when peers disappear
  • TTL-based flooding as fallback when no route is known

TTL of 8 means a packet can traverse up to 8 hops. That's overkill for most acoustic use cases but costs nothing in the frame format.


The AI denoiser

Spectral subtraction works. It's in the code, it runs, it helps. I also trained a tiny 1D CNN denoiser on synthetic acoustic data — synthetic-train only, not field-certified, but the model path is real.

from ai.noise_cancel import cnn_denoise
clean = cnn_denoise(noisy_signal, model_path="models/tiny_denoiser.pt")
Enter fullscreen mode Exit fullscreen mode

When no model is available, it falls back to spectral subtraction automatically. No crashes, no missing dependencies.


The cross-platform story

  • Python — the full modem + mesh stack, runs anywhere
  • ESP32 — protocol-aligned C++ driver via I2S, ready for hardware bring-up
  • Browser — Web Audio API demo, loopback works, acoustic chat between tabs works
  • Arduino — stub, serial only, not a shipping path

What's still honest limitation

I want to be straight with you, because overclaiming has hurt open source more than underclaiming ever has:

  • Real multi-node acoustic mesh has not been tested across physical devices yet — routing logic is there, hardware validation is not
  • The CNN denoiser model was trained on synthetic data — it works, it's not field-certified
  • Arduino is a serial stub, not a shipping audio path
  • Range numbers (~10m indoors, ~50m outdoors) are estimates from acoustic physics, not field measurements

The modem core and the WAV/audio runtime are field-deployable today. The mesh is a working prototype waiting for someone to run it on real hardware.


Try it

git clone https://github.com/AmSach/SignalHop
cd SignalHop
python3 core/modem.py
python3 cli/signalhop.py roundtrip "hello from sound"
python3 tests/test_signalhop.py
python3 tests/test_extended.py
Enter fullscreen mode Exit fullscreen mode

Or open web/demo.html in two browser tabs and chat via speakers.


Links:


Sound is the oldest protocol. We just updated the spec.

Top comments (0)