Skip to content

Added FCC Check API calls - #35

Open
hunterhubble wants to merge 2 commits into
HubbleNetwork:mainfrom
hunterhubble:fcc-api-calls
Open

Added FCC Check API calls#35
hunterhubble wants to merge 2 commits into
HubbleNetwork:mainfrom
hunterhubble:fcc-api-calls

Conversation

@hunterhubble

Copy link
Copy Markdown
Contributor

No description provided.

- 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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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_check to 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.

Comment thread src/stream_web/app.py
Comment thread src/stream_web/spectrogram.py
Comment thread src/stream_web/app.py
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants