Wiki sections

Wiki Spectrum analyzer

Sweep

A sweep shows a span wider than the receiver's instantaneous bandwidth: the device retunes quickly from segment to segment and the app stitches the segments into one spectrum. On a HackRF One this covers the whole 1–6000 MHz range with a pass of about 0.6–0.7 s. This page explains how to start a sweep, how its sample rate on a HackRF One depends on a set RBW, what each control means, how a sweep differs on an RTL-SDR and on the SDR SA PRO receivers, and what the app does not do while sweeping.

Tuned mode and sweep

In tuned mode the screen shows what the receiver sees at one moment: a band as wide as the sample rate — up to 20 MHz on a HackRF One and up to 2.56 MHz on an RTL-SDR. A sweep is a different measurement, not a different zoom: the picture is glued together from many retunes taken at different moments. That is why the mode is always named. In the top right corner of the overview ruler above the spectrum there is a label, tuned or an amber SWEEP · pass with the duration of the last pass in seconds. Until the first pass is complete it shows the percentage of the span already captured instead.

Entering a sweep, leaving it and rebuilding it reset the traces and the reference trace: the frequency axis is no longer the same.

Starting and stopping a sweep

There is no separate button. A sweep starts by itself as soon as the selected span becomes wider than the device's widest sample rate, and ends as soon as the span fits into it again. There are four ways to select the span:

  • The overview ruler above the spectrum. Drag one of the two handles of the selected span, or the span itself. The device retunes when you release the mouse button, not while you drag.
  • The two range fields in the side panel header (followed by MHz; on a wide panel they are preceded by Range). Type the edges as numbers. The ruler scale is linear, so on a HackRF One everything below 100 MHz takes about 2 % of its width — a precise selection at the bottom of the range is made here.
  • The mouse wheel over the spectrum. It changes the receive bandwidth in steps of 1.25 times; the command is sent a quarter of a second after the last notch. Widen it past the widest sample rate and a sweep starts. Ctrl+wheel is display zoom and does not touch the bandwidth.
  • A click on a named band strip at the top of the spectrum selects that whole band.

Before a sweep the app sets the device's sample rate by itself. While the RBW is derived from N, this is the widest rate — that gives the fewest segments. If the RBW is set from the list, on a HackRF One 0.9.36 it is the widest rate at which the FFT frame for that RBW still fits into a device block (see Sweep rate and a set RBW). The exception is a recording or a transmission that is already running: the rate is then left alone (see what does not work during a sweep).

HackRF One: hardware sweep

A HackRF One sweeps by itself: the device firmware does the retuning, and the app places each block by the frequency the block carries. The 1–6000 MHz range is stitched from hundreds of segments, and one pass takes about 0.6–0.7 s. The whole requested range is measured, including the left edge: on the live device, the full span included, 0 unmeasured bins were left on either side.

If the hardware sweep does not start, the app says so in a dialog rather than silently showing a frozen picture. The dialog Hardware sweep unavailable means the sweep will take the software path — tens of times slower. The dialog The sweep did not start 0.9.25 appears when the USB exchange itself is failing: a software sweep would run over the same exchange, so it is not started either, and the dialog advises checking the cable and the USB port and reconnecting the device.

Sweep rate and a set RBW 0.9.36

A HackRF One delivers its own sweep in blocks of 8187 samples, and neighbouring blocks are not contiguous in time. That is why an FFT frame is built only inside one block: the hardware sweep takes N up to 8192. An RBW set from the list could need a longer frame at the widest rate (20 MS/s), so the app looks for a rate at which it can be reached with a shorter frame.

  • RBW derived from N (including after the app starts) — the sweep runs at the widest rate, as before.
  • RBW set from the list — the sweep runs at the widest rate at which the frame for it fits into a block. With the HANN window: 2 kHz — 10 MS/s, 1 kHz — 4 MS/s, 500 Hz — 2 MS/s.
  • The price is a longer pass. At a lower rate there are more tunes, and the device delivers blocks more slowly, so the pass time grows as the square of the rate reduction: 10 MS/s instead of 20 is about four times longer, 2 MS/s about a hundred times. A pass of 100–6000 MHz with an RBW of 2 kHz takes about 2.2 s (calculated; not measured on the live device).
  • The grid limit. The app chooses a rate for the set RBW only while the sweep grid does not exceed 5 million bins: 1 kHz on a span up to 2.4 GHz, 500 Hz up to 1.2 GHz. On a wider span the sweep stays at the widest rate, and the actual RBW is coarser than the one set.
  • An RBW the hardware sweep cannot give at any rate (finer than 366 Hz with the HANN window) — the sweep takes the software path at 2 MS/s, on a span up to 610 MHz. That means minutes per pass over hundreds of megahertz (an estimate, not measured).
  • N 16384 set by hand — the sweep takes the software path at the widest rate, tens of times slower than the hardware sweep. At rates above 10 MS/s the HackRF One stream also loses part of the samples by itself without saying where (0.65–2.4 % measured at 20 MS/s).

The app says all of this in amber lines below the sweep status line — see Sweep controls in the panel. While the first pass runs, the status line shows how long it will take, judging by the pace of the segments already captured: at a lowered rate and on the software path that can be minutes.

RTL-SDR: software sweep 0.9.25

An RTL-SDR has no hardware sweep. The app itself tunes the tuner to each segment, collects the samples and moves on to the next one. A sweep starts when the span is wider than 2.56 MHz. On the author's R820T2 dongle one retune takes 30–51 ms, and a sweep of 88–108 MHz takes 1.16 s with 99.72 % coverage (measured).

Differences from the HackRF One:

  • The software path measures the level mismatch at every seam and needs 400 bins of overlap between segments for that. When N is too small, the dialog Sweep plan cannot be built appears with the advice to raise the sample rate or set a larger N.
  • A segment on which the tuner's synthesiser did not lock does not go into the picture: its frequency is unknown, and it stays unmeasured.
  • There are no passes with a shifted local oscillator here. The Spurs check produces no result, the IQ correction is not applied, and the passport of the receiver's own spurs is taken without the LO cross-check — the panel says so plainly.
  • 0.9.33 The samples of one tune are not glued across a gap in the stream: the piece before the gap gives its own spectra separately. If gaps come more often than the frame length, the segment stays "no data" rather than being drawn with a seam. The same applies on a HackRF One when its sweep takes the software path.

Sweep controls in the panel

In sweep mode extra rows appear in the Resolution bandwidth group on the Spectrum analyzer tab. RBW, N, the window, the detectors, VBW and the waterfall controls stay where they are; the DC filter selector disappears, because the DC bins of the segments are excluded from the measurement anyway. Changing N or the window rebuilds the sweep and resets the traces.

Sweep: spectra
How many spectra are averaged per segment: from 1 to 16, default 1. Each extra one is extra bytes over the instrument bus, so the pass time grows almost proportionally. It buys a smoother noise floor, not sensitivity: a weak signal will not appear because of it, it only stops flickering. The sweep itself runs at the instrument's widest instantaneous bandwidth at which the frame for the set RBW still fits into a device block — that gives the fewest segments; a finer RBW may need a narrower bandwidth, and then the pass is longer (see above). In a hardware sweep everything that arrived in a block is used, so while no blocks are lost the actual number of spectra is never lower than the one set — the trust bar shows it next to the detector. 0.9.36 On a HackRF One frames are built only inside a block, so several spectra per tune are taken from separate blocks.
The status line below the slider
Pass … · … segments · overlap … bins · covered … % — the duration of the last pass, the number of segments in the plan, the overlap between neighbouring segments and the share of bins really measured in the last completed pass. 0.9.36 Until the first pass is complete, the duration is replaced by ≈ … s (from the segments taken so far) — how long the pass will take, judging by the pace of the segments already captured.
Amber lines about the sweep 0.9.36
Below the status line the app writes what cannot be seen from the picture. The sweep runs at … MS/s, not at the widest … — the rate was lowered for the set RBW; the line says how many times longer the pass is than at the widest rate with the same N and number of spectra (calculated). The sweep runs in software: … — and why: the frame is longer than a device block, the device delivered shorter blocks, or its hardware sweep did not start; this is tens of times slower. On a span this wide the set RBW would make a sweep grid of more than 5 million bins… or The set RBW cannot be reached at any rate of the device… — the sweep stayed at the widest rate, and the actual RBW is coarser than the one set. The program could not take the sweep blocks fast enough: … — how many blocks were dropped since the sweep was started, and how many tunes of the last pass were averaged from fewer spectra than ordered.
Spurs
do not check, mark (default) or remove. A spur is born inside the receiver itself and sits at a fixed offset from the local oscillator: when the LO moves, the spur moves with it, while a signal on the air stays put. So about once every 20 s one pass runs with shifted sweep bounds — by +1, +2 and +3 MHz in turn — and never reaches the screen. The first pair of passes runs after two clean ones. The bins found get a blue mark at the top of the spectrum; remove substitutes the shifted pass point by point, only in the marked bins, so packet signals stay intact. The line below the selector says how many bins were found, or why the check is not possible: the shifted last segment would go past the device's ceiling — then narrow the span from the top or 0.9.36 set a coarser RBW: the sweep rate follows it, and at a wider rate the last segment stands farther from the ceiling. Only the device's own sweep can make a shifted pass; in a software sweep (RTL-SDR; a HackRF One when its sweep takes the software path) the line 0.9.36 says just that: In a software sweep spurs are not checked by shifting the local oscillator: only the device's own sweep can make a shifted pass.
The ADC saturation line
The red line The ADC is saturated in … tunes (… MHz) appears when at least 0.1 % of the samples in a segment sit at the ADC's full scale (a tune in this line is the same as a segment). 0.9.36 Saturation is counted over the whole tune: a clean last block does not clear the warning set by a saturated first one. Levels there are clipping products, not a measurement, and false peaks are possible nearby. Reduce the gain or remove the strong signal.
Passport
The buttons measure WITHOUT antenna and cut / show. The passport of the receiver's own spurs can be taken only in a sweep; details are on the page Detection marks and the spur passport.
IQ correction
off or on (default). I/Q amplitude and phase imbalance produces an image peak on the other side of the segment centre. The correction measures the imbalance on every segment, because it depends on the LO frequency, and suppresses the image. The line Imbalance … dB, phase …° → image suppressed by … dB shows the hardware state before correction.
Response
The measure button (later re-measure) stores the shape of the receiver's noise floor across the whole span from the last complete pass and switches the flattening on at once; divide / do not divide switches it on and off. The line Noise floor ripple … → … dB shows what it achieved. Only the shape is flattened: the scale stays dBFS, and this is not amplitude calibration. The curve is valid for the same sample rate, N and gains — after they change, the panel asks in red to re-measure it.
Seams
blended (default) — a crossfade in the overlap zone of the segments. visible — a hard handover in the middle, and every mismatch becomes a step. The second option is for judging the stitching, not for measurement.

Segment seams

Neighbouring segments overlap, and in the overlap zone the app moves smoothly from one to the other in linear power rather than in decibels — otherwise a dip would appear at the seam. The levels of the segments are not matched to each other: the error of such matching would accumulate along the whole span.

How visible the seams are has been measured as a number on a full 1–6000 MHz span with 522 seams: the median step between neighbouring bins exactly at the seams is 1.000 dB, against 1.465 dB across the whole spectrum. In other words, the seams are quieter than the ordinary noise between neighbouring bins and do not stand out in the picture.

Sweep age

In the stitched picture the left edge was captured earlier than the right one by exactly the duration of a pass. This is a property of a sweep, not a delay, and the trust bar names it: the Age field shows up to … s — the time of the last pass. If a pass takes more than 2 s, the number turns amber. Neighbouring segments are not a simultaneous measurement: a short signal that appeared while the receiver was parked on another segment will not make it into that pass.

Traces and averaging in a sweep

Max hold, Min hold and Average work in a sweep and build up between passes; the averaging counter counts passes. The shifted pass of the spur check does not go into the traces. In a sweep the trace detector acts along frequency — it reduces grid bins into a trace point — while the spectra of one segment are folded by the main detector. An unmeasured point is a hole in Live; in hold and average the point keeps its value. The waterfall gets one row per completed pass.

The weighted CISPR detectors work without memory in a sweep: the receiver stays on a frequency for milliseconds, and the time constants have no time to act. Auto scale judges one snapshot per pass in a sweep, so the fit after start-up takes two passes. More on the pages Traces, Detectors and Scale, auto scale and waterfall.

What does not work during a sweep

  • Listening. The receiver retunes hundreds of times per second, so no single frequency can be listened to. The receiver panel says so in an amber line; audio returns when you select a span narrower than the instantaneous bandwidth.
  • Zero span. The plot shows Sweep in progress — the receiver is not parked on one frequency.
  • IQ recording. While a sweep runs, the recording receives no samples. 0.9.25 The gap is not hidden: it is marked in the metadata as a sweep outage. If a recording is already running, the sweep uses the recording's sample rate rather than the one the app would choose — usually slower; when a plan cannot be built at that rate, the dialog advises setting a larger N or stopping the recording. When the recording ends, the app re-requests a sweep ordered under it once, at the rate it needs.
  • Transmission. The HackRF One is half duplex: a transmission does not start during a sweep, and a sweep does not start during a transmission. Both refusals come with an explanation.
  • Kurtosis classes and block skipping. There are too few spectra per segment for the classes; Spectrum from blocks skips nothing in a sweep.

Saving a pass as CSV

The menu File → Save sweep (CSV)… (Ctrl+E) writes the last completed pass, so that it can be compared with another program by numbers rather than screenshots. The columns are freq_hz, dBFS, valid and, when the corresponding masks exist, lo_spur and passport with the values 0 or 1. The level is raw: no spur substitution, no passport cut and no division by the response. Unmeasured bins are in the file — with an empty level and valid=0. The header lines start with # and carry the device, the gains, the window, the detector and the number of spectra per segment. If the first pass is not complete yet, what has been collected is written, and the header says so. In tuned mode the command refuses: only a sweep can be saved.

0.9.39 The frequency in the freq_hz column is the true frequency of the bin. Files saved by earlier versions have frequencies half a bin higher than the true ones. With a tinySA 0.9.41 the menu item works too; what goes into such a file is on the page tinySA and tinySA Ultra.

Sweeping with the SDR SA PRO receivers PRO

In SDR SA PRO its receivers sweep as well. The numbers below were measured on real devices, without an antenna.

  • ADALM-Pluto — a software sweep: a step of 16–22 ms; 2100–2400 MHz at 30.72 MS/s — 25 segments, a pass of 0.65–0.78 s. The full range on a Pluto is several times slower than on a HackRF One, which sweeps by itself.
  • Fobos SDR — with the maker's special firmware the sweep runs as the device's own scan, like the HackRF One hardware sweep: 50–6900 MHz at 50 MS/s — a pass of 0.82 s, 99.6 % covered. With the standard firmware the sweep is software.
  • bladeRF 2.0 micro — a software sweep: 70–6000 MHz at 61.44 MS/s — 161 segments, about 3.5 s per pass (up to 8 s when a USB stall is recovered in the middle of a pass).

Limits

  • A sweep is not a simultaneous measurement. Short and bursty signals may miss a pass; one edge of the picture is older than the other by the pass time.
  • A fine RBW set on a HackRF One lowers the sweep rate, and the pass grows as the square of the reduction; an RBW finer than 366 Hz (HANN) means a software sweep at 2 MS/s and minutes per pass (an estimate). A rate for the set RBW is chosen only while the sweep grid does not exceed 5 million bins.
  • Levels are in dBFS, not in calibrated dBm. Segment levels are not equalised against each other; Response flattens only the shape of the noise floor.
  • With one spectrum per segment, the LO-shift spur check marks only lines above its 20 dB threshold; lines of 10–20 dB stay unmarked. Up to 20 s pass between checks, so a spur that appeared after the last one is noticed only at the next.
  • CFAR marks have a high threshold in a sweep, because there is one spectrum per cell — see Detection marks.
  • On a full HackRF One span the first segment (1–14 MHz) was 99.6 % saturated on the author's device — this is exactly what the ADC saturation line is for.
  • An RTL-SDR sweeps in software and is therefore slower; tested on an R820T2, while the R828D tuner and the RTL-SDR Blog V4 are untested on hardware.
  • A tinySA 0.9.25 sweeps by itself and has none of these controls — see tinySA and tinySA Ultra.

The wiki describes version 0.9.49. Your app's version is shown in the Help menu, under About. Found a mistake? Write to us.