Skip to content

Repository files navigation

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.wavWAV audio file with 48000 Hz sample rate, 16 bits and only 1 (real) channel:

./encode encoded.wav 48000 16 1 1500 ANONYMOUS QAM16 1/2 short uncoded.dat

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

sox -d -c 1 -e float recorded.wav

Start playing encoded.wav audio file:

play encoded.wav

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

./decode recorded.wav decoded.dat

Compare original uncoded.dat with decoded.dat:

diff -s uncoded.dat decoded.dat

Stream Audio

This currently works on macOS and Linux only.

Stream live audio into the decoder:

sox -q -d -c 1 -e float -t wav - | ./decode - decoded.dat

Stream audio out of the encoder:

./encode - 48000 32 1 1500 ANONYMOUS QAM16 1/2 short uncoded.dat | play -q -

Supported Modes

All modes need a bandwidth of 2400 Hz and there are two frame sizes.

These are the durations for each modulation scheme:

ModulationShortNormal
BPSK1.5s2.6s
QPSK1.0s2.6s
8PSK1.9s3.4s
QAM161.0s2.6s
QAM641.9s3.4s
QAM2561.5s2.6s
QAM10242.2s4.0s
QAM40961.9s3.4s

These are the numbers for the short modes with a 1/2 code rate:

ModulationPayloadBitrate
BPSK128B0.7kb/s
QPSK128B1.1kb/s
8PSK512B2.1kb/s
QAM16256B2.1kb/s
QAM641024B4.3kb/s
QAM2561024B5.4kb/s
QAM10242048B7.5kb/s
QAM40962048B8.6kb/s

These are the numbers for the normal modes with a 1/2 code rate:

ModulationPayloadBitrate
BPSK256B0.8kb/s
QPSK512B1.6kb/s
8PSK1024B2.4kb/s
QAM161024B3.2kb/s
QAM642048B4.8kb/s
QAM2562048B6.3kb/s
QAM10244096B8.3kb/s
QAM40964096B9.6kb/s

These are the numbers for the short modes with a 2/3 code rate:

ModulationPayloadBitrate
BPSK171B0.9kb/s
QPSK171B1.4kb/s
8PSK684B2.9kb/s
QAM16342B2.9kb/s
QAM641368B5.7kb/s
QAM2561368B7.3kb/s
QAM10242736B10.0kb/s
QAM40962736B11.4kb/s

These are the numbers for the normal modes with a 2/3 code rate:

ModulationPayloadBitrate
BPSK342B1.1kb/s
QPSK684B2.1kb/s
8PSK1368B3.2kb/s
QAM161368B4.2kb/s
QAM642736B6.4kb/s
QAM2562736B8.4kb/s
QAM10245472B11.0kb/s
QAM40965472B12.8kb/s

These are the numbers for the short modes with a 3/4 code rate:

ModulationPayloadBitrate
BPSK192B1.0kb/s
QPSK192B1.6kb/s
8PSK768B3.2kb/s
QAM16384B3.2kb/s
QAM641536B6.4kb/s
QAM2561536B8.2kb/s
QAM10243072B11.2kb/s
QAM40963072B12.8kb/s

These are the numbers for the normal modes with a 3/4 code rate:

ModulationPayloadBitrate
BPSK384B1.2kb/s
QPSK768B2.4kb/s
8PSK1536B3.6kb/s
QAM161536B4.7kb/s
QAM643072B7.2kb/s
QAM2563072B9.5kb/s
QAM10246144B12.4kb/s
QAM40966144B14.4kb/s

These are the numbers for the short modes with a 5/6 code rate:

ModulationPayloadBitrate
BPSK213B1.1kb/s
QPSK213B1.8kb/s
8PSK852B3.6kb/s
QAM16426B3.6kb/s
QAM641704B7.1kb/s
QAM2561704B9.1kb/s
QAM10243408B12.5kb/s
QAM40963408B14.2kb/s

These are the numbers for the normal modes with a 5/6 code rate:

ModulationPayloadBitrate
BPSK426B1.3kb/s
QPSK852B2.6kb/s
8PSK1704B4.0kb/s
QAM161704B5.2kb/s
QAM643408B8.0kb/s
QAM2563408B10.5kb/s
QAM10246816B13.8kb/s
QAM40966816B16.0kb/s

Simulating

Prerequisite: disorders

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

./encode - 48000 32 2 1500 ANONYMOUS QAM16 1/2 short uncoded.dat | ../disorders/multipath - - ../disorders/multipath.txt 10 | ../disorders/cfo - - 234.567 | ../disorders/sfo - - 147 | ../disorders/awgn - - -20 | ./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

About

Simple OFDM modem for transceiving datagrams

Topics

Resources

Stars

147 stars

Watchers

15 watching

Forks

Releases

Packages

Contributors

Languages