feat: /api/iq_capture + /api/record_analyze signal diagnostics#27
Closed
hunterhubble wants to merge 2 commits into
Closed
feat: /api/iq_capture + /api/record_analyze signal diagnostics#27hunterhubble wants to merge 2 commits into
hunterhubble wants to merge 2 commits into
Conversation
Helpful for: - Extra signal processing through numpy or matplotlib - Recording samples with pyhubblenetwork - Testing Satellite hardware with IQ samples from real devices - Determining the frequency of a continuous tone Signed-off-by: hunterhubble <hunter@hubble.com>
Signed-off-by: hunterhubble <hunter@hubble.com>
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.
Summary
Adds two RX diagnostic endpoints so a customer can capture and characterise a device's signal against protocol expectations, without needing the live GUI.
1.
GET /api/iq_capture?seconds=N— records N s (1–60) of raw IQ forward from now and returns a.npy(complex64) download withX-Sample-Rate-Hz/X-Center-Freq-Hz/X-N-Samplesheaders.2.
GET /api/record_analyze?seconds=N— records N s (1–30) and returns a plain-text diagnostic report file the customer sends back. For the representative decoded packet it prints, per symbol:Plus decoder-reported chipset / synth-res, frequency offset, and Reed-Solomon correction counts, and a one-line summary per packet.
Scope / design
correct_symbol_edgesfor symbol edges; shared helpers were factored intotiming.py(dominant_symbol_freq,symbol_amplitudes_dbfs) andconfig.py(packet_symbol_grid,rotated_hop_sequence) and are now also called byspectrogram.py/processor.py, removing pre-existing duplication.iq_capture), so the live spectrogram isn't stalled; capture is serialised by a shared lock.Files
src/stream_web/analysis.py(new) — the diagnostic pipeline (detection → per-symbol analyses → report).src/stream_web/app.py—iq_capture+record_analyzeroutes, shared_capture_iqhelper.src/stream_web/{timing,config,spectrogram,processor}.py— shared symbol-DSP / geometry helpers.CLAUDE.md— endpoint docs.Testing
ruff check src/clean; mock test suite 12/12 pass.🤖 Generated with Claude Code