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
fetch_apollo_audio.py downloads Apollo 11 audio highlights from Archive.org
and extracts clips using ffmpeg (48 kHz mono WAV). Supports --list, --clip,
--all with idempotent downloads and progress reporting.
real_signal_demo.py auto-discovers downloaded clips and runs them through the
full USB downlink TX/RX chain (PCM telemetry + FM voice), saving recovered
audio for comparison. Falls back to the bundled demo clip if no downloads exist.
Also adds .gitignore to keep large audio files out of the repo while preserving
the small apollo11_crew.wav demo clip.
FM mode now has the same three-layer architecture as PM mode:
- fm_mod/fm_demod for carrier-level FM modulation
- fm_signal_source/fm_downlink_receiver convenience wrappers
- fm_loopback_demo.py verifying round-trip SCO voltage recovery
Includes GRC YAML for all 4 blocks and doc updates across
blocks reference, SCO guide, and signal architecture pages.
Assembles the complete Apollo USB downlink signal from individual blocks:
PCM frames on 1.024 MHz BPSK + crew voice on 1.25 MHz FM, both PM-modulated
onto a single complex carrier. Receives and splits into decoded PCM frames
and recovered voice audio.
Clean: 399/402 frames, 8s voice. At 25 dB SNR: 395/402 frames.
FM-modulates real Apollo 11 onboard audio onto the 1.25 MHz voice
subcarrier (+/-29 kHz deviation) and demodulates it back, achieving
94.1% correlation with the original. Audio source: NASA/Internet
Archive public domain (Collins bidding farewell to Eagle crew).
- sco_mod: 9-channel FM subcarrier oscillator modulator (inverse of sco_demod),
with round-trip tests proving voltage recovery across all channels
- fm_voice_subcarrier_mod: add audio_input parameter to accept external float
streams (e.g., Apollo mission voice recordings) instead of internal test tone
- loopback_demo.py: streaming TX->RX round-trip with CLI for noise/voice/frames
- agc_loopback_demo.py: full Virtual AGC integration via TCP bridge