25 lines
1.0 KiB
Python
25 lines
1.0 KiB
Python
from __future__ import annotations
|
|
|
|
import numpy as np
|
|
|
|
from galileo_rx.diagnostics.boc_lock_validation import (
|
|
boc11_autocorrelation,
|
|
boc11_five_tap_shape,
|
|
)
|
|
from galileo_rx.signal_profiles import galileo_e1_profile
|
|
from galileo_rx.signals.code_provider import SyntheticCodeProvider
|
|
|
|
|
|
def test_ideal_boc11_shoulder_and_negative_sidelobe_metrics() -> None:
|
|
profile = galileo_e1_profile()
|
|
code = SyntheticCodeProvider().primary_code(profile, "E1B", 1)
|
|
shape = boc11_autocorrelation(code, samples_per_chip=32)
|
|
taps = boc11_five_tap_shape(shape, np.asarray([0.0, 0.25, 0.5], dtype=np.float64))
|
|
# Finite-code adjacent-chip cross terms perturb the ideal 0.1/0.84/1/3
|
|
# values slightly; the classification must remain unchanged.
|
|
assert 0.08 < taps["legacy_prompt_el_ratio"][1] < 0.12
|
|
assert 0.80 < taps["main_peak_fraction"][1] < 0.88
|
|
assert 0.28 < taps["main_peak_coherence"][1] < 0.38
|
|
assert -0.55 < taps["prompt_amplitude"][2] < -0.45
|
|
assert abs(taps["main_peak_coherence"][2]) < 1e-12
|