Skip to content

feat: report nav-message data frequency for a decoder state#72

Merged
siebc merged 2 commits into
masterfrom
sc/decoder-data-frequency-accessor
Jul 5, 2026
Merged

feat: report nav-message data frequency for a decoder state#72
siebc merged 2 commits into
masterfrom
sc/decoder-data-frequency-accessor

Conversation

@giove-a

@giove-a giove-a commented Jul 5, 2026

Copy link
Copy Markdown

feat: report nav-message data frequency for a decoder state

What

Bumps the GNSSSignals compat to 3.3 and adds a get_data_frequency method
for GNSSDecoderState: given a decoder, it returns the navigation-message
symbol rate of the signal that decoder demodulates.

using GNSSDecoder, GNSSSignals
get_data_frequency(GPSL1CADecoderState(1))  #  50 Hz
get_data_frequency(GPSL5IDecoderState(1))   # 100 Hz
get_data_frequency(GPSL2CMDecoderState(1))  #  50 Hz

Why

Downstream code (e.g. PositionVelocityTime.jl, which converts
num_bits_after_valid_syncro_sequence to seconds) needs the nav-message symbol
rate for a decoder. Today it hand-maintains a decoder→signal→rate map — one
method per signal — purely because GNSSDecoder exposed no way to recover a
decoder's signal. This lifts that mapping into GNSSDecoder, where it belongs,
so callers can just write get_data_frequency(decoder).

How

  • Extends GNSSSignals.get_data_frequency on GNSSDecoderState (not piracy —
    the type is ours; Aqua confirms), one small method per signal, each next to
    its existing GNSSDecoderState(::Signal, prn) constructor.
  • Each method forwards to the corresponding signal's rate in GNSSSignals
    rather than hardcoding a literal, so the value stays single-sourced.
  • Dispatch is on the constants type (1:1 with the signal). This is what
    keeps GPS L5-I (100 Hz) and L2C-M (50 Hz) distinct even though both decode
    into a shared GPSCNAVData. The full-CBOC E1B and its BOC(1,1) approximation
    share one method (identical 250 Hz I/NAV stream).

Scope notes

  • The compat lower bound moves to 3.3. The accessor itself doesn't require
    3.3 (get_data_frequency predates it), but this pins the intended baseline.
  • Deliberately limited to get_data_frequency. It does not introduce a
    generic signal-type escape hatch, because ranging quantities (code/carrier
    frequency) belong to the tracked signal, which may differ from the decoded
    data component — a distinction a decoder state shouldn't blur.

Testing

  • New test/data_frequency.jl: each decoder matches its signal's rate; L5-I and
    L2C-M stay distinct; E1B BOC(1,1) matches full E1B.
  • Full suite green (2491/2491), including Aqua (no piracy/ambiguity).

Follow-up (separate PR, PositionVelocityTime.jl)

Delete the six nav_data_frequency methods in sc/multi-gnss and call
GNSSSignals.get_data_frequency(decoder) directly.

🤖 Generated with Claude Code

siebc and others added 2 commits July 5, 2026 15:19
Extend GNSSSignals.get_data_frequency for GNSSDecoderState so a decoder can
report the navigation-message symbol rate of the signal it demodulates,
without the caller re-deriving which signal the decoder is running on.

Each method forwards to the corresponding signal's rate in GNSSSignals, so the
value stays single-sourced. Dispatch is on the constants type (1:1 with the
signal), which keeps GPS L5-I (100 Hz) and L2C-M (50 Hz) distinct despite both
decoding into GPSCNAVData.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.15%. Comparing base (f592d02) to head (a05aba2).

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #72   +/-   ##
=======================================
  Coverage   98.14%   98.15%           
=======================================
  Files          14       14           
  Lines        1513     1519    +6     
=======================================
+ Hits         1485     1491    +6     
  Misses         28       28           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@siebc
siebc merged commit 3e0a2ee into master Jul 5, 2026
9 checks passed
@siebc
siebc deleted the sc/decoder-data-frequency-accessor branch July 5, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants