SDR with Raspberry Pi and DVB-T receivers
My holiday project is to play around with a Raspberry Pi and a RTL-2832U DVB-T USB receiver. This specific receiver has a mode where it dumps raw IQ samples over USB to the computer. The gnuradio experimenters realised this and therefore gnuradio supports this relatively cheap off the shelf USB receiver as a software defined radio.
The Raspberry Pi has a rather tiny ARMv6 CPU running at 800MHz. Doing signal processing on this CPU (as the GPU is still too closed to do it on that), looked impossible to me.
Doing some tests on my netbook using gnuradio to decode FM radio broadcasts took anything from 30%-120% of CPU. I later discovered rtl_fm which included the entire FM demodulation chain I implemented in gnuradio into one single highly optimised program. This program took about 7% of CPU on my netbook. Things started to look a little less impossible and the next step was to find a Pi and test it on there.
Following the steps here I installed the RTL's drivers on the Pi, running the Raspbian OS. After that I did the seemingly impossible and ran the following command:
rtl_fm -f 144800000 -s 22050 - | multimon -a AFSK1200 -t raw /dev/stdin
This command uses rtl_fm to receive the Amateur radio frequency of 144.8MHz and demodulate that to 22.05kHz audio. The audio is then piped to multimon, a general purpose digital decoder program for linux. Multimon is set up to try and demodulate AFSK1200, the amateur radio packet mode at 1200baud.
At this point I was really impressed. Just by running that command that used 7% of CPU on my AMD fusion netbook (frequency scaled to 800MHz), did not kill the Pi. It in fact used so little CPU that I thought something was wrong. Having a look with the top system monitor, the rtl_fm program stood at 18%-18.5% CPU usage and multimon stood at 1.5%-2%. Surely something was not working.
A few seconds later I heard an APRS broadcast on my HAM radio set and the decoded packet appeared in the terminal on the Raspberry Pi. Everything was indeed working correctly. I am oficially impressed by the performance of the Raspberry Pi and the osmocom rtl_sdr package/driver.
Well now that I got APRS decoding working, how about DTMF, CTCSS, SSTV and vox recording. Perhaps add a trasmitter and set up a controller for a repeater or a remote weather station.
More updates to follow!
The past few weeks I built on the previous findings. I got DTMF and CTCSS detected by multimonNG, but only after I realised that there was a problem piping the raw audio data from rtl_fm to multimon. rtl_fm's audio regularly has a DC offset, with which multimon can't deal. Therefore I wrote a little C program to do DC blocking according to what I read on DSP guru.
The command as previously used would thus change to:
rtl_fm -f 144800000 -s 22050 - | DCblocker | multimon -a AFSK1200 -t raw /dev/stdin
The previous system was only able to decode AX.25/APRS packets. I however wanted to transmit packets too. Therefore I set up soundmodem on the Raspberry Pi, using a Logitech USB soundcard. I built a VOX to do the PTT on the radio according to G4ILO's website. This was then connected to an Icom handheld radio.
Now that I got this working, I wanted to do something with it. Because the Raspberry Pi has a few GPIO pins, I thought that one could switch something using APRS messaging. I built a repeater controller. The python source code can be found on Github here.