Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OMD — Optical Modem

A real-time optical data link from a screen to a phone camera: 33.20 KB/s wall-clock file delivery, SHA-256 verified, with a zero-install receiver — an unmodified phone opens a URL from a QR code and starts decoding.

(The name comes from the format's own magic bytes: every stream starts with OMD1 — Optical Modem, version 1.)

Unlike animated-QR tools and matrix barcodes, this is a modem: it measures the screen-camera channel per spatial frequency, then loads each OFDM carrier with the densest constellation that channel can carry, and keeps adapting from live receiver feedback.

Demo

OMD — a file crossing between two devices as light

Two devices, a file crossing between them as light, SHA-256 verified on arrival. Nothing installed on either side: both are web pages, one showing the pattern, the other watching it through its camera.

What you are watching is the slow path, and it is worth saying so plainly. That receiver is the demodulator rewritten in TypeScript, running inside a phone browser at roughly 2 KB/s. The 33.20 KB/s figure below is measured with the native receiver (sounding/rx_live.py). Same protocol, same bit-exact maths — verified frame by frame against an 18-frame reference corpus — the difference is JavaScript versus C.

Record 33.20 KB/s wall-clock (206,310 bytes in 6.1 s, SHA-256 verified)
In the demo video ~2 KB/s — portable receiver, zero install
Reliability 22/22 real transfers completed and verified
Receiver stock phone browser (camera permission only), no app
Closest real-time system in the literature FOCUS (MobiSys 2016), ~30 KB/s sustained

Documentation

  • docs/REPORT.md — the technical report: design, measurement campaign, and a first-class section of negative results and pitfalls (Italian translation)
  • docs/PROTOCOL.md — the wire-format specification, with deterministic test vectors: enough to write an interoperable implementation
  • sounding/README.md — the operating manual: how to run every stage yourself
  • docs/FACTS.md — the canonical register of measured numbers

Quick start

Requirements: Python 3.13, numpy, opencv-python, matplotlib, reedsolo, aiohttp, cryptography, qrcode (plus av for the H.264 uplink path).

cd sounding
python selftest.py                    # validates the whole pipeline, no phone needed
python rx_live.py --wide --alloc allocation_live2.json --workers 7

Then open display/tx_txframes_record2.html full-screen on the transmitting screen, scan the QR code printed in the terminal with a phone, and point it at the screen.

No phone is needed to validate the code: selftest.py, loopback_test.py, test_live_loopback.py, test_closed_loop.py, test_h264_path.py and bench_saturation.py exercise the full chain synthetically.

Frame sets and probe images are generated, not committed — generate_probes.py and tx_encode.py rebuild them in seconds. The measurement evidence behind every number in the report is committed: sounding/out/*/report.md (channel sounding), sounding/out_color/ (color crosstalk) and sounding/rx_*/rx_report.md (per-session decode reports).

How it works, in one paragraph

The transmitter renders each frame as a 2D-OFDM symbol: data rides on spatial frequency carriers of a 256×256 Hermitian spectrum, so the inverse FFT is a real image. Pilots fund equalization (residual sub-sample shift, per-ring complex gain, and — in color mode — a 3×3 crosstalk matrix inverted per bin). Payload bytes are protected by Reed-Solomon and carried as LT fountain symbols, so the link is genuinely one-way: any large enough subset of decoded frames reconstructs the file. The receiver rectifies each camera frame via ArUco markers, demodulates in a process pool, and — when the transmitter is on the same machine — can command it to switch to a more conservative allocation when conditions degrade, and back when they recover.

License

Code: Apache License 2.0 — see NOTICE for the attribution that redistributions must carry. Documentation and specification (docs/): CC BY 4.0.

Independent implementations of the protocol are welcome and unencumbered: the specification is published precisely so the format can be implemented freely.

About

Screen-to-camera optical modem: 33 KB/s file transfer via light, adaptive OFDM with per-carrier bit loading, zero-install browser receiver

Topics

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages