Consolidate locally-defined constants into constants.py (single source
of truth for all uplink modulation and ranging parameters). Update
__init__.py with new imports across all three tiers. Add signal
architecture, block reference, and demo guide documentation for the
uplink and ranging subsystems.
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
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.
- 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
Implement the transmit/generate side as streaming GNU Radio blocks,
complementing the existing receive chain. Each block maps to a physical
instrument on CuriousMarc's Keysight bench:
pcm_frame_source - PCM bit stream generator (sync_block + FrameSourceEngine)
nrz_encoder - bits to NRZ waveform (+1/-1) with upsampling
bpsk_subcarrier_mod - NRZ x cos(1.024 MHz) BPSK modulator
fm_voice_subcarrier_mod - 1.25 MHz FM test tone source
pm_mod - phase modulator: exp(j * deviation * input)
usb_signal_source - convenience wrapper wiring all blocks together
Includes GRC YAML definitions for all blocks under [Apollo USB] category,
49 new tests (271 total, all passing), and a loopback test that validates
the full TX->RX round trip including frame recovery with 30 dB AWGN.
Project scaffold for decoding Apollo USB signals:
- 2287.5 MHz downlink with PM/FM modulation
- 1.024 MHz BPSK subcarrier (PCM telemetry)
- 1.25 MHz FM subcarrier (voice)
- 128-word PCM frames at 50 fps
Based on NAA Course A-624 Study Guide (1965) and Virtual AGC.