A Gnu Radio Project implementing a multimode signal generator for the HackRF Board
Project Description
Most software defined radio projects (SDR) concentrate on receiving.
This is a Gnu Radio project implementing a multimode signal generator (5mw transmitter!)
for the HackRF board. By adding a microphone audio source, it becomes a
multimode transmitter for 1MHz to 6GHz. The project source was designed
using Gnu Radio Companion (GRC). GRC generates a standalone python file
that is run to operate the signal generator. The python program loads modules
and libraries from the Gnu Radio and QT5 installations as needed.
What is the HackRF?
The HackRF One is a Software Defined Radio (SDR) peripheral capable of
transmission or reception of radio signals from 1 MHz to 6 GHz.
Designed to enable test and development of modern and next generation
radio technologies, the HackRF One is an open source hardware platform
that can be used as a USB peripheral or programmed for stand-alone operation.
- 1 MHz to 6 GHz operating frequency
- Up to 20 million samples per second
- 8-bit quadrature samples (8-bit I and 8-bit Q)
- Compatible with GNU Radio, SDR and more
- Software-configurable RX and TX gain and baseband filter
- Software-controlled antenna port power (50 mA at 3.3 V)
- SMA female antenna connector
- SMA female clock input and output for synchronization
- Internal pin headers for expansion
- Hi-Speed USB 2.0
- USB-powered
- Open source hardware
- Chinese clones can be purchased for as little as $99USD
System Requirements
You will need a recent version of python (I used 3.9.9), a recent installation
of Gnu Radio (I used 3.9.3.0), a recent installation of the QT5 development system
(I used 5.15) and a HackRF One SDR board. I use a rolling distribution
of linux known as arch linux for my main development computer. I have heard
all these packages should be available for windows, but ... "I Don't Do Windows".
Although this project uses the the HackRF board for output, with slight modifications, it
can be reconfigured to use other SDR hardware capable of transmitting
(Lime, Ettus, Pluto etc)
Interesting Things I Learned
- Gnu Radio Companion is a great tool for exploring DSP applications without getting bogged down in the math details.
- All the DSP for different modulations is done in software blocks that operate at a low sample rate of 48KHz.
- The easiest was probably FM mode as all the hard work is done by the NBFM Transmit block.
- DSB was next easiest... audio in the I channel and 0's in the Q channel.
- USB and LSB were then very easy using a simple matter of filtering for the wanted sideband.
- AM hurt my head for a bit. The secret was injecting the carrier by adding 1 to the audio stream resulting in a DC component
in the I channel.
- Using individual filters for each mode allowed for optimising the audio
response and tailoring the gains to keep the I/Q streams within -1.0 to +1.0 range.
- Use of selector blocks made it easy to switch components in and out and interact with the GUI controls.
- Having time domain and frequency domain scope views on the IQ data stream really helped debug the logic.
- Multiple audio sources made the generator very configurable. A repeating wave file, a PL tone and and another
adjustable tone covered most of cases I could see for testing HF and VHF/UHF analog radios. In the future,
if I need to test digital modulations, it is easy to expand the modulation section. Using the input wave file,
one can generate repeating test patterns for many test cases. The file I supplied below has a voice announcemnt,
a section of 1kHz tone at 100% amplitude, and 10 DTMF tones at 50% amplitude. (all great for adjusting NBFM transmitters)
- The GUI is not the most elegant, but because the code is done in QT and python, one could add more embellishments.
This is not really needed for a desktop piece of test gear. The power in the software is that it can be
readily altered as unique test scenerios arise.
- The output is not calibrated for amplitude but is variable by about 60dB from uW to mW. If absolute signal
levels are required, an external power meter and an external step attenuator can be used with the generator.
- I used a TCXO additional module on the HackRF resulting in better than 0.5PPM frequency accuracy. This is better
than most of the old radios I work with!
Drawing(s)
GRC Project Block Diagram - HackRF-siggen.pdf (41kB)
Source Code
GRC Project File - HackRF-siggen.grc (29K)
Generated Python Source - HackRF_Siggen.py (29K)
Sample Audio Source Wave File - ve7it-at.wav (1.4Mb)