feat: report nav-message data frequency for a decoder state#72
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: report nav-message data frequency for a decoder state
What
Bumps the
GNSSSignalscompat to3.3and adds aget_data_frequencymethodfor
GNSSDecoderState: given a decoder, it returns the navigation-messagesymbol rate of the signal that decoder demodulates.
Why
Downstream code (e.g. PositionVelocityTime.jl, which converts
num_bits_after_valid_syncro_sequenceto seconds) needs the nav-message symbolrate 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
GNSSSignals.get_data_frequencyonGNSSDecoderState(not piracy —the type is ours; Aqua confirms), one small method per signal, each next to
its existing
GNSSDecoderState(::Signal, prn)constructor.rather than hardcoding a literal, so the value stays single-sourced.
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) approximationshare one method (identical 250 Hz I/NAV stream).
Scope notes
3.3. The accessor itself doesn't require3.3 (
get_data_frequencypredates it), but this pins the intended baseline.get_data_frequency. It does not introduce ageneric 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
test/data_frequency.jl: each decoder matches its signal's rate; L5-I andL2C-M stay distinct; E1B BOC(1,1) matches full E1B.
2491/2491), including Aqua (no piracy/ambiguity).Follow-up (separate PR, PositionVelocityTime.jl)
Delete the six
nav_data_frequencymethods insc/multi-gnssand callGNSSSignals.get_data_frequency(decoder)directly.🤖 Generated with Claude Code