Software defined radio

From Random Projects
Jump to: navigation, search

Introduction

This page is a small overview of my experiments with software-defined radio (SDR) and also a collection of resources, tutorials, videos, etc. done by others which help to understand the topic.

Hardware

rtl-sdr (Realtek RTL2832U based USB dongles)

Terratec Noxon DAB/DAB+ Stick

The Terratec Noxon DAB/DAB+ Stick is a cheap DAB / DAB+ USB dongle.

See the device's lsusb for more detailed info.

See #kalibrate-rtl for some calibration runs of this device.

Terratec ran T Stick+

The Terratec ran T Stick+ is a cheap DVB-T and DAB / DAB+ USB dongle.

See the device's lsusb for more detailed info.

See #kalibrate-rtl for some calibration runs of this device.

Newsky TV28T v2

The Newsky TV28T v2 is a cheap DVB-T USB dongle.

See the device's lsusb for more detailed info.

See #kalibrate-rtl for some calibration runs of this device.

Upconverters

Antennas

LNAs

Software

Common setup and notes

I'm building all software from source, and installing it (as non-root user) in $HOME/sdr. This requires a few setup steps so everything works properly.

Add <home>/sdr/lib to /etc/ld.so.conf (replace <home> with the absolute path to your $HOME directory), then run (as root, or using sudo):

$ ldconfig

Additionally, also set LD_LIBRARY_PATH to $HOME/sdr/lib (e.g. by adding the following to your .bashrc):

$ export LD_LIBRARY_PATH=$HOME/sdr/lib

In order to be able to run the programs we'll install easily, add $HOME/sdr/bin to your $PATH (e.g. by adding the following to your .bashrc).

$ export PATH=$HOME/sdr/bin:$PATH

You also have to set the correct PYTHONPATH, which is needed for GNU Radio and applications that use it (e.g. by adding the following to your .bashrc):

$ export PYTHONPATH=$HOME/sdr/lib/python2.7/dist-packages

rtl-sdr

rtl-sdr is a project which allows various cheap DVB-T USB dongles based on the Realtek RTL2832U chip to be used as cheap SDRs (around 20€ or such).

rtl-sdr consists of a shared library written in C (librtlsdr) and a few command-line utilities using that library.

Building

$ git clone git://git.osmocom.org/rtl-sdr.git
$ cd rtl-sdr
$ autoreconf -i
$ ./configure --prefix=$HOME/sdr
$ make
$ make install

rtl_test

Terratec ran T Stick+ using an active One For All SV 9380 DVB-T antenna (indoor).

$ rtl_test -t
Found 1 device(s):
  0:  Terratec T Stick PLUS

Using device 0: Terratec T Stick PLUS
Found Elonics E4000 tuner
Supported gain values (14): -1.0 1.5 4.0 6.5 9.0 11.5 14.0 16.5 19.0 21.5 24.0 29.0 34.0 42.0
Benchmarking E4000 PLL...
[E4K] PLL not locked for 52000000 Hz!
[E4K] PLL not locked for 2202000000 Hz!
[E4K] PLL not locked for 1101000000 Hz!
[E4K] PLL not locked for 1238000000 Hz!
E4K range: 53 to 2201 MHz
E4K L-band gap: 1101 to 1238 MHz

The following command was run for about 10 minutes, then aborted with CTRL-C.

$ rtl_test -p
Found 1 device(s):
  0:  Terratec T Stick PLUS

Using device 0: Terratec T Stick PLUS
Found Elonics E4000 tuner
Supported gain values (14): -1.0 1.5 4.0 6.5 9.0 11.5 14.0 16.5 19.0 21.5 24.0 29.0 34.0 42.0
Reporting PPM error measurement every 10 seconds...
Press ^C after a few minutes.
Reading samples in async mode...
lost at least 100 bytes
real sample rate: 2047819
real sample rate: 2048096
real sample rate: 2048098
real sample rate: 2048104
real sample rate: 2048125
[...]
real sample rate: 2048097
^CSignal caught, exiting!

User cancel, exiting...
Cumulative PPM error: 40

The cumulative PPM error is the same for runs with lower or higher samplerates, e.g. 2.4MHz or 250kHz:

$ rtl_test -s 2400000 -p
[...]
$ rtl_test -s 250000 -p
[...]

kalibrate-rtl

Building

$ git clone git://github.com/steve-m/kalibrate-rtl.git
$ cd kalibrate-rtl
$ ./bootstrap
$ PKG_CONFIG_PATH=$HOME/sdr/lib/pkgconfig ./configure --prefix=$HOME/sdr
$ make
$ make install

Usage

Terratec ran T Stick+ using an active One For All SV 9380 DVB-T antenna (indoor).

$ kal -s GSM900
Found 1 device(s):
  0:  Terratec T Stick PLUS

Using device 0: Terratec T Stick PLUS
Found Elonics E4000 tuner
Exact sample rate is: 270833.002142 Hz
kal: Scanning for GSM-900 base stations.
GSM-900:
       chan: 1 (935.2MHz - 30.653kHz)  power: 417647.82
       chan: 8 (936.6MHz - 30.663kHz)  power: 383494.84
       chan: 10 (937.0MHz - 30.686kHz) power: 420518.71
       chan: 17 (938.4MHz - 30.715kHz) power: 1683405.93
       chan: 19 (938.8MHz - 30.720kHz) power: 3579404.22
       chan: 24 (939.8MHz - 30.747kHz) power: 3721080.40
       chan: 34 (941.8MHz - 30.770kHz) power: 486380.80
       chan: 35 (942.0MHz + 33.781kHz) power: 580315.81
       chan: 36 (942.2MHz + 33.828kHz) power: 546639.55
       chan: 38 (942.6MHz - 30.755kHz) power: 337495.20
       chan: 48 (944.6MHz + 33.681kHz) power: 2893223.06
       chan: 49 (944.8MHz - 30.870kHz) power: 4906493.23
       chan: 51 (945.2MHz - 30.874kHz) power: 634253.99
       chan: 61 (947.2MHz - 30.901kHz) power: 627761.95
       chan: 62 (947.4MHz + 33.589kHz) power: 2386957.29
       chan: 63 (947.6MHz - 30.932kHz) power: 4558919.48
       chan: 73 (949.6MHz - 31.031kHz) power: 553294.59
       chan: 77 (950.4MHz - 31.214kHz) power: 1967877.15
       chan: 78 (950.6MHz + 33.803kHz) power: 1900473.82
       chan: 87 (952.4MHz - 31.122kHz) power: 2301038.80
       chan: 88 (952.6MHz - 31.081kHz) power: 2702582.91
       chan: 110 (957.0MHz - 31.201kHz) power: 287043.47

$ kal -c 49
Found 1 device(s):
  0:  Terratec T Stick PLUS

Using device 0: Terratec T Stick PLUS
Found Elonics E4000 tuner
Exact sample rate is: 270833.002142 Hz
kal: Calculating clock frequency offset.
Using GSM-900 channel 49 (944.8MHz)
average         [min, max]      (range, stddev)
- 30.800kHz             [-30819, -30783]        (36, 9.116408)
overruns: 0
not found: 0
average absolute error: 32.600 ppm

GNU Radio

Building

$ git clone git://gnuradio.org/gnuradio
$ cd gnuradio
$ mkdir build
$ cd build
$ PKG_CONFIG_PATH=$HOME/sdr/lib/pkgconfig cmake -DCMAKE_INSTALL_PREFIX=$HOME/sdr -DPYTHON_EXECUTABLE=/usr/bin/python2.7 \
  -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so ..
$ make
$ make install

Note: It's important to override PYTHON_EXECUTABLE, PYTHON_INCLUDE_DIR, and PYTHON_LIBRARY here! On recent (e.g. Debian) systems you might have both Python 2.7 and Python 3.x installed. Per default, cmake will pick up 3.x, which is the wrong one, though. GNU Radio requires Python 2.7 and is not yet ported to Python 3.x, hence this won't work and the manual overrides above are required.

gr-osmosdr

Building

$ git clone git://git.osmocom.org/gr-osmosdr
$ cd gr-osmosdr
$ mkdir build
$ cd build
$ PKG_CONFIG_PATH=$HOME/sdr/lib/pkgconfig cmake -DCMAKE_INSTALL_PREFIX=$HOME/sdr ..
$ make
$ make install

gxrx

Building

$ git clone git://github.com/csete/gqrx.git
$ cd gqrx
$ PKG_CONFIG_PATH=$HOME/sdr/lib/pkgconfig qmake PREFIX=$HOME/sdr
$ make
$ make install

Use-cases

FM radio

433MHz gadgets

Satellites

Weather balloons and Radiosondes

Resources, Tutorials, Talks, Videos

Basics

Amplitude modulation

GNU Radio