Basic DSP experiments

Nov 23, 2022

There are many internet resources that cover digital signal processing (DSP) and software defined radio (SDR), but I’ve only found a few that provide a good introduction along with practical examples. Software Defined Radio for the Radio Amateur by AC2CZ (G0KLA) is an excellent set of SDR tutorials which I found particularly useful. The sample code is written in Java, but it was fairly straightforward to rewrite the parts that I wanted in C++ using Qt.

I started with Tutorial 1 and rewrote the simple numerically-controlled oscillator and Fourier transform examples in C++. I used the FFTW 3 library and my code generated the same results, giving me the confidence to try some of my own experiments. Here’s an example of one of my experiments showing the DFT of two oscillators running at different frequencies and magnitude.

Tutorial 3 introduces the processing of IQ data sourced from a SDR. Whilst I have a FunCube Dongle that supplies IQ data on the stereo channels of the soundcard I decided to try the Afedri AFE822x SDR that I use primarily for 2m EME. I already had some C++ code that I’d written a while back to configure the Afedri SDR and start the IQ data stream. After adapting this code and adding in the FFT processing I was able to run a test program to receive the GB3VHF beacon on 144.430Mhz. I use a 144-14 Mhz receive converter in front of the Afedri, so the SDR is tuned to 14.435MHz.

Microsoft Excel has a Fourier Analysis option as a tool in the Data Analysis add-in. It’s a bit clumsy but I found it useful for a quick sanity check or to debug some of the more complex examples in the AC2CZ tutorials. FFT in excel for spectral analysis is a short video explaining how it works. Here’s an example of showing the output of a Excel FFT when I was testing a mixer stage.