aicodix___modem/README.md
Ahmet Inan 390a11e5dc revised modes to better amortize the preamble cost
.. and to have a larger minimum size payload of 256 bytes
2024-01-05 13:24:49 +01:00

2.6 KiB
Vendored

OFDM MODEM

Quick start:

Create file uncoded.dat with 2048 bits of random data:

dd if=/dev/urandom of=uncoded.dat bs=1 count=256

Encode file uncoded.dat to encoded.wav WAV audio file with 8000 Hz sample rate, 16 bits and only 1 (real) channel:

./encode encoded.wav 8000 16 1 uncoded.dat 23

Start recording to recorded.wav audio file and stop after 5 seconds:

arecord -c 1 -f S16_LE -r 8000 -d 5 recorded.wav

Start playing encoded.wav audio file:

aplay encoded.wav

Decode recorded.wav audio file to decoded.dat file:

./decode decoded.dat recorded.wav

Compare original uncoded.dat with decoded.dat:

diff -s uncoded.dat decoded.dat

Supported Modes

Ping:

  • Mode 0: DBPSK, 2/7-rate code, 1600 Hz bandwidth, 0.36 seconds and no payload

Rattlegram:

  • Mode 14: DQPSK, 2/3-rate code, 1600 Hz bandwidth, 1.08 seconds and 170 bytes
  • Mode 15: DQPSK, 1/2-rate code, 1600 Hz bandwidth, 1.08 seconds and 128 bytes
  • Mode 16: DQPSK, 1/3-rate code, 1600 Hz bandwidth, 1.08 seconds and 85 bytes

Next:

  • Mode 23: DQPSK, 1/2-rate code, 1600 Hz bandwidth, 1.80 seconds and 256 bytes
  • Mode 24: DQPSK, 1/2-rate code, 1600 Hz bandwidth, 3.24 seconds and 512 bytes
  • Mode 25: DQPSK, 1/2-rate code, 1600 Hz bandwidth, 6.12 seconds and 1024 bytes
  • Mode 26: QAM16, 1/2-rate code, 1700 Hz bandwidth, 1.08 seconds and 256 bytes
  • Mode 27: QAM16, 1/2-rate code, 1700 Hz bandwidth, 1.80 seconds and 512 bytes
  • Mode 28: QAM16, 1/2-rate code, 1700 Hz bandwidth, 3.24 seconds and 1024 bytes
  • Mode 29: QAM64, 1/2-rate code, 1900 Hz bandwidth, 1.26 seconds and 512 bytes
  • Mode 30: QAM64, 1/2-rate code, 1900 Hz bandwidth, 2.16 seconds and 1024 bytes

Simulating

Prerequisite: disorders

Encode uncoded.dat to analytic audio signal, add multipath, CFO, SFO, AWGN, decode and compare:

./encode - 8000 16 2 uncoded.dat 23 | ../disorders/multipath - - ../disorders/multipath.txt 10 | ../disorders/cfo - - 234.567 | ../disorders/sfo - - 147 | ../disorders/awgn - - -30 | ./decode - - | diff -q -s uncoded.dat -

Reading

  • Robust frequency and timing synchronization for OFDM
    by Timothy M. Schmidl and Donald C. Cox - 1997
  • On Timing Offset Estimation for OFDM Systems
    by H. Minn, M. Zeng, and V. K. Bhargava - 2000