017: SigV3.1 output format ('sig' file, gensig-compatible) #18

Merged
ykp merged 2 commits from feat/017-sig-output into main 2026-09-23 13:13:20 +02:00
Owner

Implements backlog step 017 (docs/backlog/017-sig-output.md). Stacked on merged 009/010.

src/gengnss/core/sig_writer.py (self-contained - no gensig dependency)

  • write_sig_header(params, num_samples): the 1024-byte SigV3.1 header per
    doc/sigv3.md (field grid mirrors gensig's sig_io.py); sets Signature 'SIG 3.1',
    EchantillonsVirguleFixe=1, Complexe=1, Fe/FrequenceHF/BandeFI; everything else zeroed
  • sig_quantize / sig_interleave: the reference mapping
    clip(round(c * 2**15), -32768, 32767) (asymmetric: -1 -> -32768, +1 -> 32767),
    little-endian pinned

src/gengnss/core/writer.py

  • Scenario.fmt gains 'sig': SigFileWriter sink (header first, per-block fixed
    quantization); the two-pass flow is unchanged, with the sig-specific difference
    that the pass-1 complex peak pre-conditions the float mix to full_scale_pct of
    +/-1.0 (the sig range is FIXED, unlike raw IQ's configurable int scaling)
  • header BandeFI = fs_hz (full complex-baseband span)

CLI: --format sig accepted in run/scenario/show; sidecar unchanged.

Tests (9): header layout (signature/enums/Fe/FrequenceHF/BandeFI/NombreEchan,
non-applicable fields zeroed), quantization mapping and clipping, endianness,
generate_to_file integration (header + size), determinism across block sizes,
complex-peak pre-conditioning bounds (100% and 80%), and BYTE-COMPATIBILITY with
the gensig reference writer (import test-only, skipped without the ../gensig
checkout - present here and passing).

Local verification: pytest 139 passed + 1 gui skip, ruff clean (Python 3.14).

Note (process): NOT to be merged by automation - awaiting manual review/merge.
Next: 016 Tier-2 signals (v1.1) - the last open backlog step.

Implements backlog step 017 (docs/backlog/017-sig-output.md). Stacked on merged 009/010. **`src/gengnss/core/sig_writer.py`** (self-contained - no gensig dependency) - `write_sig_header(params, num_samples)`: the 1024-byte SigV3.1 header per doc/sigv3.md (field grid mirrors gensig's sig_io.py); sets Signature 'SIG 3.1', EchantillonsVirguleFixe=1, Complexe=1, Fe/FrequenceHF/BandeFI; everything else zeroed - `sig_quantize` / `sig_interleave`: the reference mapping clip(round(c * 2**15), -32768, 32767) (asymmetric: -1 -> -32768, +1 -> 32767), little-endian pinned **`src/gengnss/core/writer.py`** - `Scenario.fmt` gains 'sig': `SigFileWriter` sink (header first, per-block fixed quantization); the two-pass flow is unchanged, with the sig-specific difference that the pass-1 complex peak pre-conditions the float mix to full_scale_pct of +/-1.0 (the sig range is FIXED, unlike raw IQ's configurable int scaling) - header BandeFI = fs_hz (full complex-baseband span) **CLI**: `--format sig` accepted in run/scenario/show; sidecar unchanged. **Tests** (9): header layout (signature/enums/Fe/FrequenceHF/BandeFI/NombreEchan, non-applicable fields zeroed), quantization mapping and clipping, endianness, generate_to_file integration (header + size), determinism across block sizes, complex-peak pre-conditioning bounds (100% and 80%), and BYTE-COMPATIBILITY with the gensig reference writer (import test-only, skipped without the ../gensig checkout - present here and passing). Local verification: pytest 139 passed + 1 gui skip, ruff clean (Python 3.14). Note (process): NOT to be merged by automation - awaiting manual review/merge. Next: 016 Tier-2 signals (v1.1) - the last open backlog step.
017(core): SigV3.1 output format — sig_writer, fmt 'sig' integration, gensig byte-compat test
All checks were successful
ci / test (3.14) (push) Successful in 1m10s
ci / test (3.12) (push) Successful in 1m22s
ci / test (3.12) (pull_request) Successful in 7m52s
ci / test (3.14) (pull_request) Successful in 7m40s
9c67c86fe0
ykp merged commit 1936b778b9 into main 2026-09-23 13:13:20 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ykp/gengnss!18
No description provided.