Simple OFDM modem for transceiving datagrams
Find a file
2025-07-18 07:19:13 +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 accommodate preamble symbol in PAPR computations 2025-07-18 07:19:13 +02:00
decode.cc accommodate preamble symbol in PAPR computations 2025-07-18 07:19:13 +02:00
encode.cc accommodate preamble symbol in PAPR computations 2025-07-18 07:19:13 +02:00
freezer.cc added polar code for new preamble 2025-07-17 10:20:07 +02:00
LICENSE Initial commit 2021-06-11 11:12:44 +02:00
Makefile sample rate of 8000 Hz not supported anymore 2025-07-16 12:37:27 +02:00
polar_tables.hh added polar code for new preamble 2025-07-17 10:20:07 +02:00
psk.hh use 16 bit LLRs 2025-07-01 22:53:14 +02:00
qam.hh use 16 bit LLRs 2025-07-01 22:53:14 +02:00
README.md sample rate of 8000 Hz not supported anymore 2025-07-16 12:37:27 +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 5 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 and use a 1/2-rate forward error correction code

These use a differential modulation scheme:

  • Mode 0: DBPSK, 3 seconds and 256 bytes
  • Mode 1: DQPSK, 3 seconds and 512 bytes
  • Mode 2: D8PSK, 4 seconds and 1024 bytes

And these a coherent modulation scheme:

  • Mode 3: BPSK, 3 seconds and 256 bytes
  • Mode 4: QPSK, 3 seconds and 512 bytes
  • Mode 5: QAM16, 1 second and 256 bytes
  • Mode 6: QAM16, 3 seconds and 1024 bytes
  • Mode 7: QAM64, 4 seconds and 2048 bytes

Simulating

Prerequisite: disorders

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

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