Simple OFDM modem for transceiving datagrams
Find a file
2025-07-21 11:06:25 +02:00
.gitattributes only allow statistics on c++ language 2021-10-22 12:26:01 +02:00
.gitignore use a shortened systematic polar code and CA-SCL decoding 2021-09-03 20:52:09 +02:00
common.hh use at least 16 symbols with normal frames 2025-07-21 11:06:25 +02:00
decode.cc added support for base37 encoded call sign 2025-07-18 15:24:27 +02:00
encode.cc added support for base37 encoded call sign 2025-07-18 15:24:27 +02:00
freezer.cc restored short and long codes 2025-07-18 09:38:57 +02:00
LICENSE Initial commit 2021-06-11 11:12:44 +02:00
Makefile added support for base37 encoded call sign 2025-07-18 15:24:27 +02:00
polar_tables.hh restored short and long codes 2025-07-18 09:38:57 +02:00
psk.hh use 16 bit LLRs 2025-07-01 22:53:14 +02:00
qam.hh added support for QAM4096 2025-07-18 12:52:01 +02:00
README.md use at least 16 symbols with normal frames 2025-07-21 11:06:25 +02:00
schmidl_cox.hh need to be more sensitive for BPSK to show its potential 2025-07-05 19:53:30 +02:00

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

./encode encoded.wav 48000 16 1 1500 ANONYMOUS 176 uncoded.dat

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

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

Start playing encoded.wav audio file:

aplay 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

Supported Modes

All modes need a bandwidth of 2400 Hz.

These are the durations for each differential modulation scheme:

Modulation Short Normal
DBPSK 1.5s 2.6s
DQPSK 1.0s 2.6s
D8PSK 1.9s 3.4s

And these are the durations for each coherent modulation scheme:

Modulation Short Normal
QAM16 1.0s 2.6s
QAM64 1.9s 3.4s
QAM256 1.5s 2.6s
QAM1024 2.2s 4.0s
QAM4096 1.9s 3.4s

Currently all digital modes use a 1/2-rate forward error correction code.

Therefore we have the following byte payloads for each modulation:

Modulation Short Normal
DBPSK 128B 256B
DQPSK 128B 512B
D8PSK 512B 1024B
QAM16 256B 1024B
QAM64 1024B 2048B
QAM256 1024B 2048B
QAM1024 2048B 4096B
QAM4096 2048B 4096B

Which give us the following bitrates for each modulation:

Modulation Short Normal
DBPSK 681b/s 789b/s
DQPSK 1070b/s 1577b/s
D8PSK 2141b/s 2398b/s
QAM16 2141b/s 3155b/s
QAM64 4282b/s 4795b/s
QAM256 5449b/s 6310b/s
QAM1024 7493b/s 8268b/s
QAM4096 8563b/s 9591b/s

Simulating

Prerequisite: disorders

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

./encode - 48000 16 2 1500 ANONYMOUS 176 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