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
47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
id: apollo_ranging_mod
|
|
label: Apollo Ranging Modulator
|
|
category: '[Apollo USB]'
|
|
flags: [python]
|
|
|
|
parameters:
|
|
- id: chip_rate
|
|
label: Chip Rate (Hz)
|
|
dtype: int
|
|
default: '993963'
|
|
- id: sample_rate
|
|
label: Sample Rate (Hz)
|
|
dtype: real
|
|
default: '5120000'
|
|
|
|
inputs:
|
|
- label: in
|
|
domain: stream
|
|
dtype: byte
|
|
|
|
outputs:
|
|
- label: out
|
|
domain: stream
|
|
dtype: float
|
|
|
|
templates:
|
|
imports: from apollo.ranging_mod import ranging_mod
|
|
make: apollo.ranging_mod.ranging_mod(chip_rate=${chip_rate}, sample_rate=${sample_rate})
|
|
|
|
documentation: |-
|
|
Apollo Ranging Modulator
|
|
|
|
NRZ-encodes PRN ranging chips (byte 0/1) to float (+1/-1) at the
|
|
specified sample rate. Output is suitable for summing with other
|
|
subcarriers before PM carrier modulation.
|
|
|
|
At the default 5.12 MHz sample rate, each chip occupies ~5 samples.
|
|
|
|
This is the same NRZ transform as the PCM NRZ Encoder but configured
|
|
for the ranging chip rate (~994 kchip/s) instead of the PCM bit rate.
|
|
|
|
Parameters:
|
|
chip_rate: PRN chip rate (default 993,963 Hz)
|
|
sample_rate: Output sample rate (default 5.12 MHz)
|
|
|
|
file_format: 1
|