Ryan Malloy 86a5b08e9d Add PRN ranging system: code generator, modulator, demodulator, and demo
Implements the Apollo composite PRN ranging code (5,456,682 chips) from
five component sequences (CL, X, A, B, C) combined via majority-vote
logic, matching Ken Shirriff's Teensy rangeGenerator.ino bit-for-bit.

LFSR taps corrected to produce maximal-length sequences:
  A: 5-bit, taps [2,0] (x^5+x^2+1, period 31)
  B: 6-bit, taps [1,0] (x^6+x+1, period 63)
  C: 7-bit, taps [1,0] (x^7+x+1, period 127)

New files:
  src/apollo/ranging.py          -- pure-Python code generator and correlator
  src/apollo/ranging_source.py   -- GR sync_block streaming PRN chips
  src/apollo/ranging_mod.py      -- GR hier_block2 NRZ chip modulator
  src/apollo/ranging_demod.py    -- GR basic_block FFT-based range correlator
  grc/apollo_ranging_*.block.yml -- GRC block definitions (3 files)
  examples/ranging_demo.py       -- standalone demo with delay simulation
2026-02-24 14:21:02 -07:00

gr-apollo

GNU Radio 3.10+ out-of-tree module for decoding Apollo Unified S-Band (USB) telecommunications signals.

Overview

The Apollo Unified S-Band system was the primary communication link between the spacecraft and Earth during the Apollo missions (1967-1972). This module implements GNU Radio blocks to decode these signals, enabling:

  • Reception of Apollo-era recordings
  • Integration with the Virtual AGC emulator
  • Educational exploration of 1960s space communications

Signal Specifications

Parameter Value
Downlink Frequency 2287.5 MHz
Uplink Frequency 2106.40625 MHz
Coherent Ratio 240/221
PM Peak Deviation 0.133 rad (7.6°)
PCM Subcarrier 1.024 MHz BPSK
PCM Bit Rate 51.2 kbps (high) / 1.6 kbps (low)
Voice Subcarrier 1.25 MHz FM
Frame Length 128 words × 8 bits @ 50 fps

Installation

# Using uv (recommended)
uv pip install -e .

# Install GRC blocks
cp grc/*.yml ~/.local/share/gnuradio/grc/blocks/

Signal Chain

RF 2287.5 MHz
     │
     ▼
┌─────────────┐
│ Carrier PLL │ ◄── 240/221 coherent recovery
└─────────────┘
     │
     ▼
┌─────────────┐
│  PM Demod   │ ◄── 0.133 rad peak deviation
└─────────────┘
     │
     ├────────────────────┬──────────────────┐
     ▼                    ▼                  ▼
┌──────────┐        ┌──────────┐       ┌──────────┐
│ 1.024MHz │        │ 1.25 MHz │       │ Ranging  │
│   BPSK   │        │    FM    │       │   PRN    │
└──────────┘        └──────────┘       └──────────┘
     │                    │
     ▼                    ▼
┌──────────┐        ┌──────────┐
│ PCM Sync │        │  Voice   │
│ 51.2kbps │        │ 300-3kHz │
└──────────┘        └──────────┘
     │
     ▼
┌──────────┐
│ 128-word │
│  Demux   │
└──────────┘
     │
     ▼
  Telemetry

References

License

MIT

Description
Apollo Unified S-Band decoder for GNU Radio 3.10+
Readme 881 KiB
Languages
Python 100%