Tagged: hackrf_sweep

HackRF Sweep Spectrum Analyzer for Windows

A few weeks ago the HackRF drivers and firmware were updated and one new feature added was hackrf_sweep. This new feature allows us to scan across the spectrum at up to 8 GHz per second, which means that a full 0 – 6 GHz scan can complete in under a second.

Previously only Linux software such as QSpectrumAnalyzer was compatible with hackrf_sweep, but now over on GitHub user pavsa has released a new Windows based Spectrum Analzyer which is compatible with hackrf_sweep.

We gave the software a test and it ran flawlessly with our HackRF. The features include:

  • Optimized for only one purpose – to use HackRF as a spectrum analyzer
  • All changes in settings restart hackrf_sweep automatically
  • Easy retuning
  • hackrf_sweep integrated as a shared library
  • Peak display
  • High resolution waterfall plot

Remember that to run the software you will need to have updated your HackRF to the latest firmware. The spectrum analyzer software is also Java based, so you’ll need to have the Java JRE for Windows x64 installed.

Scanning the Spectrum at 8GHz per Second with the new HackRF Update

Recently Mike Ossmann, creator of the HackRF released version 2017.02.1 of the libhackrf, hackrf-tools and firmware on the HackRF Git. The update was developed together with the help of Dominic Spill. The full release text is pasted below:

To upgrade to this release, you must update libhackrf and hackrf-tools on your host computer. You must also update firmware on your HackRF. It is important to update both the host code and firmware for this release to work properly. If you only update one or the other, you may experience unpredictable behavior.

Major changes in this release include:

Sweep mode: A new firmware function enables wideband spectrum monitoring by rapidly retuning the radio without requiring individual tuning requests from the host computer. The new hackrf_sweep utility demonstrates this function, allowing you to collect spectrum measurements at a sweep rate of 8 GHz per second. Thanks to Mike Walters, author of inspectrum, for getting this feature working!

Hardware synchronization: It is now possible to wire the expansion headers of two or more HackRF Ones together so that they start sampling at the same time. This is advantageous during phase coherent operation with clock synchronized HackRFs. See the -H option of hackrf_transfer. Thank you, Mike Davis!

A new utility, hackrf_debug, replaces three older debug utilities, hackrf_si5351c, hackrf_max2837, and hackrf_rffc5071.

Power consumption has been reduced by turning off some microcontroller features we weren’t using.

There have been many more enhancements and bug fixes. For a full list of changes, see the git log.

Special thanks to Dominic Spill who has taken over much of the software development effort and has helped with nearly every improvement since the previous release!

One of the most interesting updates is the upgrade to hackrf_sweep. The new firmware allows you to make huge wideband scans of the entire 0 – 6 GHz range of the HackRF in under one second (8 GHz/s). In comparison the Airspy is currently capable of scanning at about 1 GHz/s (although the Airspy author has mentioned that a sweep mode could also easily be added on the Airspy).

To update the drivers and flash the new firmware in Linux:

  1. Download the new release tar at https://github.com/mossmann/hackrf/releases/tag/v2017.02.1
  2. Extract the tar.xz file into a folder.
  3. Build and install the host tools using the instructions
    at https://github.com/mossmann/hackrf/tree/master/host
  4. Flash the new firmware with hackrf_spiflash -w firmware-bin/hackrf_one_usb.bin (or the bin file for the Jawbreaker if you have that version of the HackRF)
  5. Disconnect then reconnect the HackRF.

To install Mike Ossmanns fork of QSpectrumAnalyzer which supports the new hackrf_sweep:

  1. sudo apt-get install python3-pip python3-pyqt4 python3-numpy
  2. git clone https://github.com/mossmann/qspectrumanalyzer
  3. sudo pip3 install ./qspectrumanalyzer
  4. This gets installed to ~/.local/bin

To generate a wideband waterfall image sweep with hackrf_sweep and Kyle Keen’s heatmap.py software:

  1. git clone https://github.com/keenerd/rtl-sdr-misc. Take note of heatmap.py inside rtl-sdr-misc/heatmap.
  2. Scan from 1 MHz – 3 GHz, with a bin size of 100k, LNA gain of 32 and VGA gain of 8: ./hackrf_sweep -f1:3000 -w100000 -l32 -g8 > output_data.csv
  3. Generate the heatmap (can take some time to complete if you have a large data file from a long scan): python heatmap.py output_data.csv heatmap_image.png

We’ve uploaded an 0-6 GHz example waterfall scan image over about 30 minutes which is available at filedropper.com/op4. The png file is 90 MB. A sample of the sweep from 400 – 600 MHz is shown below. Trunking, various telemetry and DVB-T signals are visible.

hackrf_sweep 400 - 620 MHz sample
hackrf_sweep 400 – 620 MHz sample

Some GIF examples of QSpectrumAnalyzer running the new hackrf_sweep in order from 1) 0 – 6 GHz scan, 2) 0 – 3 GHz scan, 3) 0 – 1 GHz scan, 4) 500 – 640 MHz scan, 5) 2.4 GHz WiFi Band are shown below.

Continue reading