Commit Graph

4 Commits

Author SHA1 Message Date
ben
3d58760b5e fix(viz): render sample_spectrogram for split-I/Q RadioDataset samples
All checks were successful
Build Sphinx Docs Set / Build Docs (pull_request) Successful in 1m5s
Build Project / Build Project (3.10) (pull_request) Successful in 3m3s
Build Project / Build Project (3.11) (pull_request) Successful in 2m27s
Build Project / Build Project (3.12) (pull_request) Successful in 1m20s
Test with tox / Test with tox (3.11) (pull_request) Successful in 2m57s
Test with tox / Test with tox (3.10) (pull_request) Successful in 4m3s
Test with tox / Test with tox (3.12) (pull_request) Successful in 1m27s
RadioDataset samples are commonly split I/Q with shape (2, T) (row 0 = I,
row 1 = Q). `sample_spectrogram_plot` assumed 1-D complex, so `len(sample)`
returned 2 (the I/Q axis) — the compatibility gate saw `2 < 32` and every
dataset showed "doesn't have sufficient signal data for spectrogram
visualization", and the fallback path raised "need at least 32 samples, got 2".

Normalize each sample to a 1-D complex signal before measuring/plotting:
- add `_to_complex_1d` (complex any-shape -> flat; (2, ...) I/Q rows and
  (..., 2) I/Q cols -> I + jQ; real 1-D -> real signal; None on empty).
- compatibility gate and `sample_spectrogram_plot` normalize first, then use
  the true length; plot returns the styled "Not Available" figure for
  unusable/too-short (<32) samples.
- `_compute_spectrogram` measures length via reshape(-1) (belt-and-suspenders).

Tests: parametrized `_to_complex_1d` and `sample_spectrogram_plot` over
complex 1-D, (2, T) rows, (T, 2) cols, real 1-D, and (2, 4, 256) multi-channel
I/Q (all render), plus (2,)/empty (still "Not Available"). 16 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 12:11:27 -04:00
ben
a0b46a35e2 format fix 3?
All checks were successful
Build Sphinx Docs Set / Build Docs (pull_request) Successful in 13s
Test with tox / Test with tox (3.11) (pull_request) Successful in 32s
Test with tox / Test with tox (3.12) (pull_request) Successful in 31s
Test with tox / Test with tox (3.10) (pull_request) Successful in 42s
Build Project / Build Project (3.10) (pull_request) Successful in 50s
Build Project / Build Project (3.11) (pull_request) Successful in 49s
Build Project / Build Project (3.12) (pull_request) Successful in 48s
2025-10-22 12:02:05 -04:00
ben
c7c7100d46 Formatting fixes 2025-10-20 14:44:51 -04:00
ben
2721ed866c Radio-dataset widgets
Some checks failed
Build Sphinx Docs Set / Build Docs (pull_request) Successful in 16s
Test with tox / Test with tox (3.11) (pull_request) Successful in 34s
Test with tox / Test with tox (3.12) (pull_request) Successful in 31s
Test with tox / Test with tox (3.10) (pull_request) Failing after 42s
Build Project / Build Project (3.10) (pull_request) Successful in 53s
Build Project / Build Project (3.11) (pull_request) Successful in 53s
Build Project / Build Project (3.12) (pull_request) Successful in 52s
2025-10-17 09:35:27 -04:00