effex is a software-defined correlator. It computes the cross-correlation of signals from two USB software-defined radios (RTL-SDRs) with synchronized clocks. This has applications in radio astronomy and remote sensing.
The library is written in Python and is driven by a command line application:
python effex.py --time 60 --bandwidth 2.4e6 --frequency 1.4204e9 --num_samp 262144 --resolution 4096 --gain 29.7 --mode spectrum --loglevel=INFO
which generates output data that is automatically plotted as
The time series of complex cross-correlation spectra is written to a file in .csv format.
Install it by running:
git clone https://github.com/evanmayer/effex.git
- python3
- numpy
- matplotlib
- scipy
- cupy
- NVIDIA RAPIDSAI cuSignal
- My fork of roger-'s RTL-SDR python interface: pyrtlsdr*
- A maintained fork of the RTLSDR USB library: librtlsdr*
* These libraries add functions to disable RTL-SDR phase-locked-loop (PLL) dithering, which is necessary for coherent operation of two receivers that share a clock signal, at the cost of tuning frequency accuracy. The librtlsdr fork is more actively maintained than the osmocom one installed by package managers.
If you have trouble with the install of dependencies, see the detailed install instructions I wrote for my Jetson Nano.
- Computer with NVIDIA CUDA-capable GPU (at least 4 CPU logical processors recommended)
- 2x USB RTL-SDR dongles
- CLK sharing modification a la: Juha Vierinen, Piotr Krysik, or RTL-SDR Blog v3 Selectable Clock & Expansion Headers
- 2x SMA antennas
- Any amplifiers/filtering needed to achieve good signal-to-noise ratio of your signal of interest. For Hydrogen line radio astronomy, I use the Nooelec SAWbird H1+ barebones
- A white noise source in your band of interest is useful for calibrating out the delay between channels caused by cable lengths and USB sampling startup delay. I use a room temperature 50 Ohm SMA calibration load amplified and filtered for my band of interest, a poor copy of this CASPER noise source.
Here's an image of my hardware stack set up for calibration on my kitchen table.
It is an FX architecture complex correlator implemented in software.
- F: a spectrometer is implemented for each channel by a polyphase filterbank followed by a Fast Fourier transform.
- X: The cross-power spectrum is computed by vector multiplication of one channel's spectrum by the complex conjugate of the other. Many computationally expensive operations are accelerated by performing them on a GPU using NVIDIA RAPIDSAI cuSignal.
Provided the data rate from the USB SDRs is not too high, this correlator runs in real time. This is accomplished by multicore and multithreaded execution to process data from both channels concurrently.
Testing is handled with pytest:
cd effex/
pytest
This is software I designed and tested myself, running on hardware that is far from "lab grade." Most of it passes a "sniff" test for reasonableness, but it is at best a proof of concept. It ignores many sources of error and probably reflects my imperfect knowledge of the hardware and algorithms required to make this truly "work." If you can point out any errors in hardware or software, I'd be grateful. Have at it:
- Issue Tracker: https://github.com/evanmayer/effex/issues
- Source Code: https://github.com/evanmayer/effex
If you are having issues, please let me know. See the Issues tab of this project.
The project is licensed under the GNU General Public License v2.0 license. Make sure you read and understand the terms.
I do not have explicit financial interest in the products or services of NVIDIA, RTL-SDR.com, Nooelec, or any other equipment manufacturer. This code was developed by me without financial assistance or sponsorship from anyone.
README.md Template from writethedocs