{"api":"v1","endpoint":"/api/v1/documents/how-usdr-s-automatic-voice-scan-loop-does-wideband-decoding-carrier-search","generated_at":"2026-11-29T10:23:03Z","scope":"Published, public entries only. Bodies are Markdown; [n] markers cite the numbered sources.","data":{"slug":"how-usdr-s-automatic-voice-scan-loop-does-wideband-decoding-carrier-search","title":"How uSDR's Automatic Voice-Scan Loop Does Wideband Decoding: Carrier Search, Parallel Test Decodes and Window Stepping","summary":"uSDR's SCAN loop finds carriers in one wideband FFT, re-mixes up to four channels inside the span without retuning, test-decodes each for about 1.2 s, and retunes the radio only when a window is exhausted. Based on the project README as of 20 Nov 2026.","kind":"research","format":"research","format_label":"Report","topic":{"slug":"amateur-radio","name":"Amateur Radio"},"section":{"slug":"technical","name":"Technical"},"published_at":"2026-11-20T17:41:45Z","updated_at":"2026-11-20T17:41:45Z","read_minutes":13,"source_count":10,"url":"https://intel.innerpulse.net/doc/how-usdr-s-automatic-voice-scan-loop-does-wideband-decoding-carrier-search","api":"https://intel.innerpulse.net/api/v1/documents/how-usdr-s-automatic-voice-scan-loop-does-wideband-decoding-carrier-search","tags":[{"slug":"p25","name":"P25"},{"slug":"sdr","name":"SDR"},{"slug":"configuration","name":"configuration"},{"slug":"open-source","name":"open source"},{"slug":"trunking","name":"trunking"}],"pdf_url":"https://intel.innerpulse.net/doc/how-usdr-s-automatic-voice-scan-loop-does-wideband-decoding-carrier-search.pdf","word_count":2621,"body":"uSDR's automatic loop does not decode a wide span in one pass. It uses one wideband FFT to find where the carriers are, then re-mixes a few narrow channels out of the same sample stream and test-decodes each one. The hardware is retuned only when a whole window has been worked through. This note describes that design as the project README documents it [1].\r\n\r\n## Where this lives, and what \"the loop\" is\r\n\r\nThe repository is at `github.com/innerpulsenet/uSDR`. The path in the request, `github.com/innerpulse.net/uSDR`, returns 404, because the GitHub account is `innerpulsenet` [3]. The README describes uSDR as \"a single-radio spectrum inspector for RTL-SDR and SDRplay hardware\". It is written in Rust and served to a web page and a native desktop console [1][2]. The studio's portfolio page calls it open source and in daily use as a lab receiver [2]. At the time of reading the repository had 269 commits and no stars [1]. The workspace has six crates: `desktop`, `dsp`, `engine`, `proto`, `radio` and `server` [9]. The studio lists SDR receivers and decoders among its services [10].\r\n\r\nThe README does not use the phrase \"monitoring loop\". Two features fit it:\r\n\r\n- **`SCAN`** is the unattended loop. It sweeps a configured range, holds whatever it can decode, plays it when `MONITOR` is on, and files each call into Last Heard [1].\r\n- **`AUTO`** is the decode arbiter the loop reuses. It runs the classifier, both digital voice receivers and every packet and paging decoder on the same channel at once, so a signal is identified without being told what it is [1].\r\n\r\nThe code in `crates/dsp`, `crates/engine` and `crates/radio` started as copies from the author's `scannerd` project (commit `5dda1c4`). The README says changes made in uSDR have not been sent back upstream [1].\r\n\r\n> [!WARNING]\r\n> This report rests on the README and portfolio text. I did not read the Rust source, so function names, thread layout and exact thresholds beyond those the README states are unverified. The README is also the project's own account, with measurements taken on the author's hardware.\r\n\r\n*[Welch average]: A spectrum estimate made by averaging FFTs of overlapping sample segments, which smooths the noise floor.\r\n*[Inspect chain]: uSDR's narrowband path that mixes one channel out of the already-captured span and decodes it, with no hardware retune.\r\n*[Birdie]: A steady spurious carrier, generated by the receiver or its surroundings, that looks like a signal.\r\n*[Control channel]: In a trunked system, the channel carrying grants and signalling rather than voice.\r\n\r\n## The loop at a glance\r\n\r\n```keyfigures\r\n[{\"value\":\"3.2 MHz\",\"label\":\"Max span, RTL-SDR\"},{\"value\":\"10 MHz\",\"label\":\"Max span, SDRplay\"},{\"value\":\"~1.2 s\",\"label\":\"Test decode per candidate\"},{\"value\":\"4\",\"label\":\"Parallel channels (1–8)\"},{\"value\":\"30 min\",\"label\":\"Park time, control channels\"}]\r\n```\r\n\r\n```timeline\r\n[{\"date\":\"Step 1\",\"title\":\"Capture the span\",\"text\":\"Front end removes DC, LO leakage and image; Welch-averaged FFT every frame\",\"highlight\":true},\r\n{\"date\":\"Step 2\",\"title\":\"Find candidates\",\"text\":\"Peak search inside the configured range, tuner spurs masked\"},\r\n{\"date\":\"Step 3\",\"title\":\"Centre and test\",\"text\":\"Inspect chains re-mix each candidate; centroid centring; ~1.2 s test decode\"},\r\n{\"date\":\"Step 4\",\"title\":\"Lock or reject\",\"text\":\"Evidence-based lock; failures earn strikes and skips\"},\r\n{\"date\":\"Step 5\",\"title\":\"Hold and record\",\"text\":\"Each held call records itself while the pool keeps sweeping\",\"highlight\":true},\r\n{\"date\":\"Step 6\",\"title\":\"Move the window\",\"text\":\"Only when candidates are exhausted, retune to the next overlapping window; wrap at the top\"}]\r\n```\r\n\r\nThe steps above are stage order, not calendar dates. The central design choice is stated directly in the README: the scanner \"spends its slow hardware retunes on span moves instead of channel steps, and finds carriers the cheap way\" [1].\r\n\r\n## Stage 1: one wideband capture, cleaned and searched\r\n\r\n### Capture and front-end correction\r\n\r\nThe radio layer fans I/Q out to the DSP and engine crates through a bounded queue [1]. Every block first passes through `dsp::FrontEnd`, which removes DC offset and LO leakage and corrects the I/Q image before the spectrum measures it or any channel is mixed out [1]. Measured on a quiet band at 2.048 MS/s, this flattens the centre of the span to **0.04–1.7 dB** above the noise floor [1].\r\n\r\n### The display FFT doubles as the scanner's sensor\r\n\r\nThe FFT computed for the display every frame covers the whole span. Each frame is a Welch average of every half-overlapped segment since the last one, so a 2 ms burst between frames lands in the next frame instead of being dropped. Full duty at 10 MS/s costs under 5% of a core [1]. The scanner reuses this spectrum rather than running a separate sweep [1].\r\n\r\n### Peak detection with spur masking\r\n\r\nPeak detection is the same local-maximum search the display uses. It runs against its own noise floor and produces the candidate carriers inside the configured range [1]. The peak list ignores the tuner's own artifacts: DC and LO leakage, plus the RTL2832's ±fs/4 images, within half a channel either side [1].\r\n\r\nThis masking matters in practice. A VHF/UHF/700/800 MHz survey without it returned **48** strong \"signals\" that all sat at the same baseband offset and moved with the tuner. With masking the same survey returned **6** candidates [1]. A manual `SPUR CHK` also exists. It nudges the LO by an eighth of a span and keeps every bin that did not move. Its threshold is 4 dB [1].\r\n\r\n```chart\r\n{\"type\":\"bar\",\"title\":\"Candidates from one VHF/UHF/700/800 survey\",\"x\":[\"Without spur masking\",\"With spur masking\"],\"series\":[{\"name\":\"Candidates\",\"data\":[48,6]}],\"unit\":\"\",\"note\":\"Source: uSDR README, Front end section; author's own hardware.\",\"highlight\":\"With spur masking\"}\r\n```\r\n\r\nGain affects this stage. The README says a wide-open front end on an RTL dongle makes its own images from nearby transmitters, and its advice is to turn gain down first when the screen fills with stationary \"signals\" [1]. Automatic gain is not the tuner's own AGC but a clip-guarded loop. It starts at 40% of range, steps down 2 dB within two seconds of ADC clipping, and creeps up only while the peak sample stays under a quarter of full scale [1].\r\n\r\n## Stage 2: narrowband chains inside the span\r\n\r\n### Re-mixing without retuning\r\n\r\nThis is the step that makes the decoding \"wideband\". The narrowband inspect chain \"can re-mix onto any channel inside the current span without touching the tuner\" [1]. Every candidate from Stage 1 is therefore reachable at no hardware cost. The README also says P25, DMR and NXDN each \"extract and equalize their own channel out of the span and decode it to audio in real time\" [1].\r\n\r\nFor each candidate the loop:\r\n\r\n1. Centres it by spectral centroid.\r\n2. Test-decodes it for about **1.2 s** with the receivers for the selected modes, all at once, using the same arbitration as `AUTO` [1].\r\n\r\n### What runs on a candidate\r\n\r\n`AUTO` runs the classifier, both digital voice receivers and every packet and paging decoder on the same channel. A receiver that has locked outranks the classifier's heuristic for the label [1]. The engine recognises the following [1]:\r\n\r\n- P25 Phase 1 and 2\r\n- DMR Tier II/III, including Connect Plus, Capacity Plus and Hytera XPT control telemetry\r\n- NXDN\r\n- Motorola SmartNet/SmartZone, LTR and Passport\r\n- POCSAG, FLEX, APRS/AX.25, NOAA SAME and MDC-1200\r\n- CTCSS/DCS\r\n- Frame-sync-qualified identification for ProVoice, EDACS, X2-TDMA, dPMR, M17, YSF and D-STAR\r\n\r\nThe scan itself only takes **AM, NFM, P25 and DMR** as modes. NXDN is not yet a scan mode [1].\r\n\r\n### Parallel testing\r\n\r\nCandidates are not tested one at a time. Up to **four** parallel channels (configurable, 1–8) each carry their own receivers. On every sweep frame the idle ones take the strongest carriers in the window [1]. The stated reason is that a birdie's test dwell no longer holds up a short call two channels away. That matters on airband, where a transmission can be over in a few seconds [1].\r\n\r\nWhen channels prove calls, each holds its own. Every held call records its own audio while the pool keeps sweeping, the newest call takes the speaker, and the window only moves once the last held call has dropped [1]. On screen, dashed amber brackets mark candidates under test, solid green brackets mark held calls recording in the background, and the filled passband is the call on the speaker [1].\r\n\r\n## Stage 3: what counts as a lock\r\n\r\nA candidate \"earns a lock on evidence, not on power alone\" [1]. The criteria differ by mode:\r\n\r\n| Mode | Lock evidence | If it fails or is the wrong kind |\r\n|---|---|---|\r\n| P25 / DMR | Channel receiver found frame sync **and** a call started | Locks but only grants/control traffic: treated as a trunked control channel and parked for **30 minutes**, with the skip explained in the decode log. Locks but never talks: retested after **a minute** |\r\n| NFM / AM | Hysteresis squelch on channel SNR (default **8 dB**, configurable) says a carrier is present; energy through the gated voice audio says someone is talking | Squelch blip with no voice behind it is filed nowhere |\r\n\r\n### Analog cross-check\r\n\r\nThe two analog paths check each other. FM has a near-constant envelope, so the AM detector hears almost nothing from it. The FM discriminator hears almost nothing from AM. \"Whichever path carries voice is what the channel was\" [1].\r\n\r\n### Skips and strikes\r\n\r\nCarriers that keep failing the test are treated as birdies or persistent hash. After a few strikes (configurable) they park for a long stretch and stop costing the sweep dwell time. They stay in the skip list, labelled with frequency, reason and time left, until re-tested. The panel has a per-entry re-test button, because \"a memory that cannot be inspected cannot be trusted\" [1]. Learned skips survive reconfiguration and the sweep wrapping around. Only a server restart forgets them [1].\r\n\r\n### Call endings and records\r\n\r\nA call drops a couple of seconds after it goes quiet (configurable), which releases its slot back to the sweep. Analog calls are bracketed by the slot's squelch with the hang time trimmed off the tail. Each finished call lands in Last Heard tagged `P25`, `DMR`, `NFM` or `AM` with its frequency [1]. Last Heard keeps the most recent sixteen calls with their audio, and retains each call's decoded WAV and channelized raw CS16LE I/Q [1].\r\n\r\nA decoded call is not always an audible one. Encrypted voice is vocoded to silence, so the list says `encrypted · ALG 0x84 — muted` or `no audio decoded` rather than leaving silence looking like a fault [1].\r\n\r\n### Labels are not proof\r\n\r\nThe README warns that \"probable\" labels are modulation and clock candidates, not validated frames. With no antenna the classifier fitted `M17 · 4-FSK @ 4800 Bd` to noise at 0.015 dB SNR [1]. The Protocol Decode/FEC panel shows rejected frame attempts alongside accepted ones for this reason. The legacy-family sweep (three baud rates across eight phases of a 0.65 s history) now runs only when something is above the noise floor. The README calls that a correctness fix as well as a saving, because sweeps over noise produced confident labels on empty channels [1].\r\n\r\n## Stage 4: moving the window and living with the hardware\r\n\r\nThe reason for this design is the tuner. An RTL-SDR's tuner faults above about one control write per ~250 ms. A 40 MHz range at 6.25 kHz steps would take \"half an hour per sweep, nearly all of it spent listening to empty channels\" [1]. That is roughly 6,400 steps at 0.25 s each, about 27 minutes (my arithmetic, consistent with the README's figure). With a span of up to 3.2 MHz, the same range needs a few window moves instead.\r\n\r\nOnly when the current window's candidates are exhausted does the tuner move, to the next overlapping window up the range. At the top it wraps [1].\r\n\r\n### Retries and stream health\r\n\r\nThe radio layer is built to ride out tuner faults [1]:\r\n\r\n- Every tune is retried up to three times a few milliseconds apart.\r\n- A failed tune is not recorded as done.\r\n- A failed tune never tears the stream down.\r\n- Reopening the device is a last resort. It needs six failures across thirty seconds with no successful tune, then backs off from 2 s to 30 s.\r\n- The display never claims a frequency the tuner did not confirm.\r\n\r\nThe README says plainly that a persistently failing dongle is a physical problem. Its advice is to unplug it and let it cool [1].\r\n\r\n### SDRplay differences\r\n\r\nOn an SDRplay RSP1A the span reaches 10 MHz. The tool runs LO offset by default, parking the LO just past the channel so the DC hump is not under the tuned signal [1]. Before a tune the LNA state is lowered to the deepest the new band has, because the API refuses a tune into a band that lacks the current LNA state [1].\r\n\r\n## What it costs: AUTO and classifier load\r\n\r\n`AUTO` is the most expensive thing the loop leans on. The README reports that profiling found three scans re-examining work already done, and fixing them cut every mode by two to five times [1].\r\n\r\n```chart\r\n{\"type\":\"dumbbell\",\"title\":\"CPU use before and after classifier fixes\",\"x\":[\"NFM\",\"P25\",\"DMR\",\"AUTO\"],\"series\":[{\"name\":\"Before\",\"data\":[92,21,29,102]},{\"name\":\"After\",\"data\":[19,14,16,33]}],\"unit\":\"%\",\"better\":\"lower\",\"note\":\"Source: uSDR README, Classifier cost; percent of one core, 2.4 MS/s per the AUTO text.\"}\r\n```\r\n\r\nThe three fixes were:\r\n\r\n- **P25 frame detection** was 45% of all CPU on its own. It re-correlated about 7,400 positions per push against a sync it had already rejected, and now resumes where the previous scan stopped.\r\n- **DMR acquisition** swept the whole retained buffer while unlocked, classifying each position twice (normal and inverted). It now keeps a marker that resets when the fit changes.\r\n- **Legacy family detection** now runs only when something is above the noise floor.\r\n\r\nBefore the work, `AUTO` ran at 102% and dropped blocks at 2.4 MS/s. After it, 33% with none dropped [1]. Back-pressure is handled by design: DSP runs on a standard thread, and the I/Q subscriber has a bounded queue. A slow classifier drops its own blocks instead of stalling the radio thread, and `dropped_blocks` and `lagged_blocks` report it [1]. If `AUTO` falls behind it says so instead of decoding patchily: \"AUTO cannot keep up at 2.400 MS/s — dropping blocks; try a narrower span\" [1].\r\n\r\n## Configuring and controlling it\r\n\r\nScan settings go through the HTTP API [1]:\r\n\r\n```json\r\nPOST /api/sdr/scan/config\r\n{\"start_hz\": 118000000, \"stop_hz\": 137000000,\r\n \"modes\": [\"am\",\"nfm\",\"p25\",\"dmr\"],\r\n \"threshold_db\": 8, \"resume_delay_s\": 2}\r\n\r\nPOST /api/sdr/scan/control\r\n{\"action\": \"pause\" | \"resume\" | \"skip\" | \"forget\"}\r\n{\"action\": \"unskip\", \"freq_hz\": 123450000}\r\n```\r\n\r\nThe field names come from the README. The values in this example are illustrative, not defaults, apart from the 8 dB threshold.\r\n\r\nBehaviour to know:\r\n\r\n- **Persistence.** Range, modes, threshold and resume delay persist in `usdr.toml`. A restart with `scan` as the saved mode comes straight back up scanning [1].\r\n- **Operator priority.** Tuning by hand pauses the sweep, and the panel says so [1].\r\n- **Voice keys.** P25 keys can be supplied with `--voice-keys`, but the README says a configured key cannot be authenticated. The `decrypted` flag means a key was applied, not that it was correct [1].\r\n- **Security.** The server has no authentication. It binds to localhost by default and should not be exposed to a network you do not control [1].\r\n\r\n### Not in this first version\r\n\r\nThe README lists three gaps [1]:\r\n\r\n1. Following a trunked control channel's voice grants. The engine already surfaces grants, and this is \"the natural next step\".\r\n2. NXDN as a scan mode.\r\n3. A manual per-channel lockout list.\r\n\r\nThe README says explicitly that explicitly configured P25 Phase 2 reception is not \"automatic Phase 2 trunk-following parity\" with OP25 [1].\r\n\r\n### Related tools\r\n\r\nOther open-source projects take a similar approach to wideband channelising. WaveShark describes itself as channelizing \"a wide span once\" and decoding every signal in it at once [6]. SDRTrunk is the established Java application for decoding, monitoring and recording trunked protocols [5]. uSDR's scan is narrower than either, being single-radio with no call database and no trunking follow [1].\r\n\r\n## Bottom line\r\n\r\nuSDR's automatic loop is a search-then-verify design. One wideband FFT per frame finds candidates, and the inspect chains re-mix up to four of them out of the same samples at no tuner cost. Each is test-decoded for about 1.2 s against evidence-based lock rules. The slow, fault-prone hardware retune happens only per window. Held calls record independently, and control channels and birdies are parked by timer.\r\n\r\nFor practical use: keep the gain low enough that spur masking has little to hide, check SNR and the FEC panel before trusting a label, and do not expect it to follow trunked voice grants yet. If you need to confirm thresholds or the exact scheduling, read the Rust source, which this report did not.","sources":[{"n":1,"title":"innerpulsenet/uSDR README (GitHub)","site":"github.com","url":"https://github.com/innerpulsenet/uSDR"},{"n":2,"title":"uSDR: Rust software-defined radio console (innerpulse portfolio)","site":"www.innerpulse.net","url":"https://www.innerpulse.net/portfolio/usdr"},{"n":3,"title":"innerpulsenet GitHub profile","site":"github.com","url":"https://github.com/innerpulsenet"},{"n":4,"title":"wavelet-lab/usdr-lib (unrelated uSDR hardware library)","site":"github.com","url":"https://github.com/wavelet-lab/usdr-lib"},{"n":5,"title":"DSheirer/sdrtrunk","site":"github.com","url":"https://github.com/DSheirer/sdrtrunk"},{"n":6,"title":"v0l/waveshark (super-radio)","site":"github.com","url":"https://github.com/v0l/super-radio"},{"n":7,"title":"The Hidden Life of Public Safety Communications Signals (arXiv 2608.05247)","site":"arxiv.org","url":"https://arxiv.org/pdf/2608.05247"},{"n":8,"title":"innerpulse: custom software development and design","site":"www.innerpulse.net","url":"https://www.innerpulse.net/"},{"n":9,"title":"uSDR crates directory (GitHub)","site":"github.com","url":"https://github.com/innerpulsenet/uSDR/tree/main/crates"},{"n":10,"title":"innerpulse Firmware & radio services","site":"www.innerpulse.net","url":"https://www.innerpulse.net/services/firmware-radio"}]},"source":"intel.innerpulse.net, a library of researched, cited reports. Please credit intel.innerpulse.net and link the entry you used.","docs":"https://intel.innerpulse.net/developers"}