Modulation and coding

Previous: Host transports · Up: esp-sdr-zephyr · Next: Channelizer

This is the third part of the docs. The radio ends with complex baseband I/Q samples, and Samples in and out brings them into memory as bursts, gapless rings and paced streams. This part turns those samples into packets and packets back into samples.

It covers how the code finds signals in a band, demodulates them, finds their frames and corrects their errors. Each page takes one technique as the tree implements it: the idea first, then the implementation, then its measurements and limits. All figures live on the pages, not here.

Fundamentals

The pages rely on these ideas; each is explained where it is used.

  • Complex baseband. Every receiver here starts from I/Q samples around the LO (The radio).

  • Channels. A channelizer splits one wideband stream into a grid of equally spaced channels, so that one receiver watches many (Channelizer).

  • Phase-difference discriminator. The imaginary part of a sample times the conjugate of an earlier one measures the phase step between them. Its sign is a hard decision per chip or bit, and a carrier offset only biases it (IEEE 802.15.4, GFSK and Bluetooth LE).

  • O-QPSK as MSK. Half-sine O-QPSK turns the carrier phase by plus or minus 90 degrees each chip period, so the discriminator recovers its chips without carrier recovery (IEEE 802.15.4).

  • Single carrier and OFDM. Single-carrier QAM sends shaped symbols on one carrier; OFDM sends them on subcarriers, each symbol with a cyclic prefix, with pilot symbols for the channel (QAM and OFDM).

  • MER. The modulation error ratio a link reaches caps the constellation it can carry (MER ceilings).

  • Codes. A frame’s payload travels under an error correcting code or a CRC alone (Error correction).

Receiver tasks

Every receiver in this part solves the same tasks. The pages name them as follows.

Detection

Finding when, and on which channel, a signal is on the air:

Carrier offset

The two ends’ crystals differ, so every receiver meets a carrier offset:

  • the 802.15.4 discriminator is only biased by it (IEEE 802.15.4); the pcap decoder estimates it from the decoded chips (Burst detection);

  • the MicroPython receiver takes it from the access code (GFSK and Bluetooth LE);

  • QAM estimates it from the preamble and derives the sample clock offset from it; OFDM takes it from the preamble’s phase and tracks the residual from its pilots (QAM and OFDM).

Timing

Sampling each symbol at the right instant:

Framing

Finding where a frame’s bits start and what they mean:

Unknown signals

Describing what no decoder knows: centre, bandwidth, modulation and symbol rate, in the generic analysis of Burst detection.

Error correction

Recovering from bit errors, or at least detecting them: the codes of Error correction, and the CRCs every framing above ends with.

Implementations

Page

Technique

Code

Chips

Channelizer

polyphase filter bank, per-channel decimators, power gates

esp_sdr_chancap.h (chancap)

ESP32-S3

fixed-point polyphase filterbank

esdr_pfbq.h (osmosdr_bridge, pcap)

ESP32-P4

IEEE 802.15.4

O-QPSK received as MSK, half-sine transmit

lib/ieee802154 (wpan)

ESP32-S3

GFSK and Bluetooth LE

GFSK demodulator

gfsk_demod (ubertooth)

ESP32-S3

LE 1M from channel captures

tools/ble_pcap.py (chancap)

host

GFSK burst receiver

cmod/esdr_fsk.c (micropython)

MicroPython boards

Burst detection

burst detectors, Bluetooth LE and 802.15.4 decoders, generic analysis

pcap

ESP32-P4 with the ESP32-C6 as radio

the same detector and decoders

cmod/esdr_pcap_core.c (micropython)

MicroPython boards

the same, every channel of a wideband stream

tools/esdr_gr_pcap.py (pcap)

host

QAM and OFDM

single-carrier QAM, OFDM, CSMA/CA with ARQ

src/qam.c, src/ofdm.c, src/mac.c (link)

ESP32-S3

Error correction

Reed-Solomon, extended Hamming, BCH, CRC-32

src/bch.c and the frame code (link)

ESP32-S3

Pages in this part

  1. Channelizer: many channels from one wideband stream, with power gates that cut out one capture per packet.

  2. IEEE 802.15.4: a software O-QPSK radio, its driver and its ACKs.

  3. GFSK and Bluetooth LE: the Ubertooth demodulator, LE 1M from channel captures, and the MicroPython GFSK receiver.

  4. Burst detection: detectors, decoders and the generic analysis that turn a stream into classified bursts.

  5. QAM and OFDM: a packet link with two PHYs and a MAC, and where its time goes.

  6. Error correction: the link’s codes, their decoders, and how to choose one.

Part 4, Applications, describes the apps that use these pages.

Previous: Host transports · Up: esp-sdr-zephyr · Next: Channelizer