Added FCC Check API calls - #35
Open
hunterhubble wants to merge 2 commits into
Open
Conversation
- No new tests were designed here - Add API Call to see if current tone is FCC compliant with spurious emissions and the occupied bandwidth. - Previously, this was only visual in the spectrum analyzer view. - Returns dict with pass/fail, carrier wave stats (frequence, power, snr, offset), and test stats of occupied bandwidth and spurious emissions tests Signed-off-by: hunterhubble <hunter@hubble.com>
hunterhubble
force-pushed
the
fcc-api-calls
branch
from
September 1, 2026 19:40
1fa6959 to
167dad4
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The new API response reports an incorrect DC-notch span value and the new endpoint lacks test coverage in a codebase that already tests Flask routes.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adds a machine-readable FCC 15.247 compliance check endpoint and refactors the spectrum-analyzer overlay logic so both the UI overlay and the new API share a single measurement implementation.
Changes:
- Introduces
evaluate_fcc_compliance()to compute occupied-bandwidth and spur checks (no plotting/I/O). - Refactors spectrum averaging/peak-hold computation into
spectrum_traces()and reuses it in both rendering and the API. - Adds
GET /api/fcc_checkto capture fresh IQ, compute a spectrum window, and return pass/fail/no-signal results as JSON.
File summaries
| File | Description |
|---|---|
| src/stream_web/spectrogram.py | Extracts spectrum trace reduction and FCC compliance evaluation into reusable helpers; updates overlay rendering to consume computed results. |
| src/stream_web/app.py | Adds /api/fcc_check endpoint that captures IQ and returns FCC compliance verdict/details using the shared measurement helpers. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Added tests to generate artificial signals and verify if they pass/fai - Testing clean tones, noise only, wide band tone, nearby spurs, and dict formatting 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.
No description provided.