AD-Vega / rtl-power-fftw

Power spectrum for RTLSDR dongles.
GNU General Public License v3.0
157 stars 38 forks source link
rtl-power rtl-sdr sdr

rtl_power_fftw

rtl_power_fftw is a program that obtains a power spectrum from RTL devices using the FFTW library to do FFT.

It is inspired by the program rtl_power in librtlsdr. However, the said program has several deficiencies that limit its usage in demanding environments, such as radio astronomy. An inspection of rtl_power in hope of modifying it and obtaining better performance resulted in the conclusion that it would be an unfeasible task. Measurements of FFT performance showed that the leading library in the field of FFT - fftw - makes mincemeat of the routine used in rtl_power, even on simple processors such as raspberryPi. Therefore, the following requirements for a program to obtain power spectrum from rtlsdr devices were set out:

The desire to have simple code to handle option parsing lead to the choice of TCLAP and therefore C++. This further meant that to implement things in a neat way, C++11 functionality snuck into the program and therefore a modern, C++11 enabled compiler is needed to compile rtl_power_fftw.

Prerequisites

In order to prepare your environment to build from the sources you have to first install a couple of development libraries. This step is needed only the first time.

sudo apt-get install libfftw3-dev libtclap-dev librtlsdr-dev pkg-config

Installation

To compile the program, cd into the directory where you have cloned the code and do:

mkdir build
cd build
cmake ..
make

This should make the rtl_power_fftw binary in the build directory. If you copy it into a directory in your PATH, you can call it from everywhere. You can also do make install and by default it will be copied to /usr/local/bin.

Documentation

The man page of rtl_power_fftw is available here. It is maintained in Markdown format suitable for reading online, but it is also converted into a regular man page that gets installed along with the program.

TODO:

Many thanks to Andrej Lajovic for cleaning up the C++ code, implementing a better buffer handling system and relentlessly improving the program.