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
31 lines
784 B
YAML
31 lines
784 B
YAML
id: apollo_ranging_source
|
|
label: Apollo Ranging Source
|
|
category: '[Apollo USB]'
|
|
flags: [python]
|
|
|
|
parameters: []
|
|
|
|
outputs:
|
|
- label: out
|
|
domain: stream
|
|
dtype: byte
|
|
|
|
templates:
|
|
imports: from apollo.ranging_source import ranging_source
|
|
make: apollo.ranging_source.ranging_source()
|
|
|
|
documentation: |-
|
|
Apollo PRN Ranging Source
|
|
|
|
Generates a continuous stream of PRN ranging code chips (bytes 0 or 1).
|
|
The composite code combines CL, X, A, B, and C component sequences
|
|
using majority-vote logic: output = (NOT(X) AND maj(A,B,C)) XOR CL
|
|
|
|
Code length: 5,456,682 chips (~5.49 seconds at 993,963 chips/sec)
|
|
The code repeats cyclically.
|
|
|
|
The full code period is pre-generated at startup, so the first call
|
|
has a brief delay while the sequence is computed.
|
|
|
|
file_format: 1
|