$ show neural75/gqrx-scanner
This repository contains a C-based frequency scanner for Gqrx, a software-defined radio (SDR) application. The scanner controls Gqrx via its remote TCP protocol to perform sweep or bookmark-based scanning, with integrated voice activity detection (VAD) for distinguishing speech from noise. The system supports interactive controls (skip, ban, pause frequencies) and automatic recording of detected signals. The architecture is a standalone CLI executable built with CMake, featuring two scanning modes: adaptive sweep (fast, with fine-tuning) and bookmark-based (reading Gqrx's bookmarks CSV). VAD is implemented using a G.729B-style pitch-based algorithm with LPC analysis, running on Linux via PipeWire audio capture. The codebase includes a comprehensive test suite using cmocka, with mock socket infrastructure for simulating Gqrx responses. Notable strengths include self-contained VAD modules and a reusable mock Gqrx protocol implementation. However, the code exhibits heavy use of global variables, some known bugs (e.g., unsigned underflow in frequency saving), and platform-specific limitations (VOX and sweep tests are Linux-only).
The LLM identified 4 files worth highlighting for reuse:
Implements autocorrelation, Levinson-Durbin recursion, LPC to LSF conversion, pitch strength estimation, zero-crossing rate, and band energy calculations. This module is self-contained (only depends on standard math and its header) and could be reused in any audio analysis pipeline requiring LPC-based features or pitch detection.
Implements a 4-criteria weighted VAD decision with hangover (2 frames), combining pitch strength, zero-crossing, and band energy ratios. The algorithm is documented in the code and can be extracted for use in other voice activity detection systems requiring low-latency, pitch-aware decisions.
Provides a protocol-aware fake Gqrx server that can be loaded with spectrum profiles (noise floor, squelch, carriers) and responds to the Gqrx remote commands. This mock is reusable for testing any client that communicates with Gqrx via TCP, enabling deterministic testing without actual hardware or Gqrx instance.
Parses scanner sweep output into frequency hits. This module is small, well-isolated, and could be reused in any tool that needs to extract frequency information from similar text-based scanner logs.