Using GNU Radio to show I/Q wav file on waterfall plot
Installing GNU Radio #
Finally I managed to get GNU Radio working on Mac OS X. Firstly I used Homebrew repository from here https://github.com/robotastic/homebrew-hackrf to install GNU Radio and HackRF tools. However it did not went well. Gnuradio-companion always crashed with the following error:
Warning: Block with key "xmlrpc_server" already exists. Ignoring: /usr/local/Cellar/gnuradio/220.127.116.11/share/gnuradio/grc/blocks/xmlrpc_server.xml Fatal Python error: PyThreadState_Get: no current thread Abort trap: 6
It turned out that some of the libraries were still using Mac OS X system’s Python instead of Python installed using Homebrew. I got it to work after renaming system’s Python and rebuilding boost libraries.
sudo mv /System/Library/Frameworks/Python.framework/ /System/Library/Frameworks/Backup.Python.framework brew reinstall boost
Moreover robotastic fork uses old GNU Radio (3.6 series), however I found out that someone has made another fork which adds support for GNU Radio 3.7 series and also supports BladeRF devices. Unfortunately this fork did not have HackRF tools, therefore I made another fork cherry-picking best from both repositories. Here it is: https://github.com/andresv/homebrew-gnuradio.
HDSDR format #
I wanted to use GNU Radio to take a closer look into ESTCube-1 overpass recordings that are recorded with HDSDR. Audacity was used to check in which format these recorded wav files were. Here is the screenshot from Audacity that shows sample rate as 390625 Hz and data type as 32 bit float.
Later I found out that this information is also in RIFF .wav header. Look page 64 for more details.
GNU Radio #
GNU Radio graphical interface can be started with the following command:
Here are the blocks that are needed to display .wav file on waterfall plot:
If you would like to build this by yourself I encourage you to use magnification icon on GNU Radio companion to search for needed blocks by name.
N Channels parameter in
Wav File Source block must be changed to 2 because our source file consists of 2 channels (I/Q data). Those I/Q channels must be converted to complex numbers because this is the most common format for GNU Radio signal blocks. As we can see
QT GUI Waterfall Sink also uses this as input format.
Throttle block is used to slow down or speed up data flow. Here variable
samp_rate (set to 390625 sps, because data in input file is sampled with that speed ) is used in
Throttle box configuration to feed data to
Waterfall Sink with the same rate as it is in input file.
Waterfall Sink can just be dropped in without configuring anything. Here is the output:
Notice that at 50 kHz packets can be seen, although we know that ESTCube-1 transmits on 437.505 MHz. This is because there is no such frequency information in raw I\Q data. Very good explanation about I\Q data can be found here. Actual frequency where recording has been made, should be looked up from RIFF .wav file metadata field as described before in HDSDR chapter. If this is determined it can be used as
center frequency parameter in
Waterfall Sink. After that correct frequency is shown on waterfall plot.