Total Pageviews

Monday, 4 December 2017

Teaser: VMA Simple Spectrum Analyzer for HackRF One

Hi,

As you know, I am a spectrum freak. There are two implementations already for the HackRF One:
  • qspectrumanalyzer - works well under Linux, but crashes right away under Windows
  • hackrf-spectrum-analyzer - works on Windows, but crasshes frequently when changing settings
Both are fairly limited in terms of functionality, but they show something impressive: the HackRF One is capabale to show a very high resolution spectrum over the whole supported frequency range (1MHz-6GHz). And the speed is incredible!

This motivated me to do a preliminary hack to see if the HackRF One could be used with my VMA Simple Spectrum Analyser software and the results are very promising:

Live spectrum (10MHz to 1000MHz)

Average Trace

Live, Min and Max Traces

Solid render of Live Trace

3D spectrum mode

The implementation is totally hacked and with errors:

  • I am not reading out the data correctly and there is some unfixed bug, which is why there is a blank on the right side of the spectrum in the above images
  • The frequency values are wrong
  • The frequency range cannot be set, nor can any other setting, as I have not implemented the protocol, yet

However, all other measurement functionality works and speed is fantastic! This could be a dream come true.

But there is a LOT of work required to get this to work and sadly I won't be able to manage it by myself.

First things first - the TODO list:
  • Better understand the hackrf_sweep protocol
  • Implement correct start/end frequency setting
  • Implement correct bin_width setting (FFT frequency resolution)
  • Implement num_samples setting (number of samples per frequency)
  • Implement interpretation of sweep output
  • Implement way to change current start/end frequency and other parameters (*)
(*) This is the crucial part: as it is, the hackrf_sweep.exe needs to be stopped with CTRL+C and restarted with new settings. This is not ideal, as it causes a significant pause.

Worse than that, under Windows, every CTRL+C crashes the HackRF One and a resume requires to press the physical RESET button.

Instead of having a hackrf_sweep.exe tool running in a shell outputting the sweep data to the console (from where I am reading it right now), I would prefer a TCP/IP communication to receive the sweep data and to send any new setting.

Unfortunately this requires to change the C++ sources of the hackrf_tools, something I am not literate to do.

If you know how to program VC++ and are interested in this project, please contact me!

Regards,
Vitor



2 comments:

  1. Would like to know if you ever finished your project on hackrf

    I would be interested in giving a donation.

    ReplyDelete
  2. Hello,

    Unfortunately not and I gave up on it.

    The HackRF firmware and Windows binaries have a bug that causes the HackRF One to crash after each individual sweep. This has kind of been fixed by the sweep DLL created by the author of the HackRF One Spectrum Analyzer for Windows, but that approach does not work with my software.

    I never got around the problem that the hackrf_sweep simply does not work with Windows and neither did I get any help...

    This is the reverse of "open source": if you cannot fix it yourself, your screwed!

    Regards,
    Vitor

    ReplyDelete