Skip to main content

Software-defined Radio on a Shoestring

Software-defined radio (SDR) holds incredible promise for the future of communications: from reducing the bill of materials and enabling software upgrade of equipment, to cognitive radio systems that bring unprecedented efficiency in managing access to scarce spectrum resource. However, most hardware platforms that enable SDR experimentation are expensive or else limited to some specific use. But this is no longer the case and due to a neat hack it's possible to re-purpose hardware that can be had for less than £20, to provide an RF front-end that can be tuned from 64-1700 MHz and to provide sample rates of up to 2.8 MS/s.

Firstly, it's important to note that if you require a system with high resolution ADCs or one that supports transmit as well as receive, this may not be what you're looking for. But if you have basic Linux skills and would like to gain hands on experience with SDR for minimal outlay, this provides incredible value for money. Which is not to say that the hardware covered here cannot be put to use in some pretty impressive applications, as it's been used to receive everything from FM broadcast and AM aircraft traffic, to GSM, TETRA and various satellite modes.

rtl-sdr

Over the years there has been much talk among the open source community of re-purposing DVB receiver hardware for use with SDR, but with very limited actual success. That changed earlier this year when a Linux developer reported that a particular DVB-T demodulator IC could be configured to provide raw samples instead of a demodulated signal. Two days later and another member of the community had managed to demodulate an FM broadcast from a file captured with a DVB receiver that uses the IC. This was back in February, and since then open source tools have been created to support using RTL2832U-based receivers with SDR, rtl-sdr. With other projects building on this to provide integration with existing open source SDR software.

A Generic RTL2832U-based USB DVB-T Receiver

Drivers for RTL2832U-based DVB-T hardware are already present in the Linux kernel, and what rtl-sdr provides is two simple command line tools that support use with SDR. The rtl_sdr command can be used to tune a receiver to a particular frequency and to set the gain and sample rate, whilst specifying a file to capture samples to. And rtl_tcp performs a similar function but provides a TCP server that makes samples available over the network instead of capturing them to a file.

Getting up and running with rtl-sdr takes no time at all and requires following a few simple build steps provided by the project. And if you wanted to write your own SDR application from scratch you could proceed from there by studying the rtl-sdr source code. But for a far friendlier approach we'll look at using the GNU Radio SDR framework.

GNU Radio

GNU Radio is an open source toolkit for creating SDR applications, that provides signal processing blocks written in C++ which are assembled together via Python scripts to create flow graphs. This can either be done by hand or via a graphical editor, GNU Radio Companion (GRC).

The software has quite a few open source dependencies, and by far the easiest way to get up and running with GNU Radio is to use the build script provided by Marcus D. Leech. When using this it should be noted that you may have to unpick problems with installing dependencies if the script fails, and the build can take some time if your machine has limited resources. Should you already have a recent version of GNU Radio installed, all you need to do is install rtl-sdr and some additional software, gr-osmosdr, which will provide RTL2832U support from within GNU Radio.

A Multimode Receiver

With GNU Radio, rtl-sdr and gr-osmosdr installed we are now ready to run SDR applications, and a good starting place is the Multimode receiver that is available from the Comprehensive GNU Radio Archive Network (CGRAN). The files for this can be checked out from CGRAN Subversion with the command:

$svn co https://www.cgran.org/svn/projects/multimode

Following which the receiver can be started either by executing multimode.py from the command line, or by running gnuradio-companion and from within this selecting to open the file called multimode.grc.

As can be seen GRC provides a powerful editing environment where GNU Radio blocks can quickly be browsed and assembled to create signal processing graphs.

With the application loaded in GRC we now select to Execute the flow graph.

Creating GNU Radio Applications

Although the rtl-sdr breakthrough is quite recent GNU Radio has been around for many years, and there exists a good selection of open source applications which can be used to learn from and as the basis for new projects. For example, GNU Radio is supplied with applications for a variety of modes and these get installed to /usr/local/share/gnuradio/examples, the aforementioned CGRAN provides hosting for 3rd party GNU Radio applications, and others can be found around the Web.

GRC provides the perfect learning tool for those that are just starting out, and since the underlying flow graphs are Python scripts these can be easily viewed to understand the finer details. The GNU Radio documentation is fairly comprehensive, the project provides tutorials and further support is available via the mailing lists.

Other SDR Software

The availability of SDR hardware at such a price point has created immense excitement among the open source, ham radio and electronics hobbyist communities. And there now exists a number of projects doing work with rtl-sdr hardware. One notable example being a fork of the GHPSDR project, which provides Android software that can connect over the Internet to control a remote system that is configured with an RTL2832U-based receiver.

DVB-T receiver and antenna

Open source (hardware and software!) advocate, Treasurer and Director of the Free and Open Source Silicon Foundation, organiser of Wuthering Bytes technology festival and founder of the Open Source Hardware User Group.

Comments