Uncategorized

Concrete examples of small-scale / home interferometry projects & designing system based on SDRPlay Duo software-defined radio.

Some concrete examples of small-scale / home interferometry projects that use open-source software, so you can see how people have actually tied the pieces together.

Here are some examples you might find useful:


🔹 Example 1: GNU Radio + SDR-based Two-Element Interferometer

  • Hardware: Two RTL-SDRs or SDRplay units, GPSDO for clock sync, simple dipoles / small Yagis.
  • Software:
    • GNU Radio flowgraph to capture I/Q streams from both receivers.
    • Perform cross-correlation using gr-corr or custom Python block.
    • Output visibilities as time series.
  • Reference: A project called Small Radio Interferometer using RTL-SDRs (used to detect solar fringes at 1420 MHz).

This is the simplest working example for a setup like yours.


🔹 Example 2: DiFX on a Single Baseline

  • Hardware: Any two synchronized SDRs (or even WAV recordings).
  • Software:
    • Record baseband data as standard VLBI-style files.
    • Run DiFX as a correlator, which gives visibilities.
    • Post-process with AIPS or CASA for delay calibration and (optionally) imaging.
  • Reference: A few amateurs have adapted DiFX to single-baseline setups — one project is vDIF on Raspberry Pi with DiFX.

This is heavier but closer to professional practice.


🔹 Example 3: Bifrost Streaming Correlator

  • Hardware: Two SDRs (ideally clock-locked), GPU-equipped PC.
  • Software:
    • Bifrost pipelines handle input streams, FFT, cross-multiply, integrate.
    • Used in professional pathfinder arrays (e.g. LWA, CHIME) but can scale down.
    • Can run in real time if you want to see fringes as they happen.
  • Reference: Bifrost’s GitHub includes example correlator pipelines — you’d adapt them for 2 inputs.

This is a good “DIY but modern” approach.


🔹 Example 4: Amateur Radio Astronomy Correlators (Python / C)

  • Hardware: Any two antennas + SDRs.
  • Software:
    • People have written lightweight correlators in Python/Numpy (sometimes C for speed).
    • Typically: read raw IQ from SDR, apply delay, multiply, average.
    • Plots fringes directly, e.g. when tracking the Sun.
  • Reference: DIY Two-Element Interferometer (various GitHub repos).

This is probably the easiest way to start — code is simple and you learn the steps.


🔹 Example 5: Educational Projects (Radio JOVE + Interferometry add-ons)

  • Hardware: Two Radio JOVE dipoles or long cables joined in the middle (like you described).
  • Software:
    • Uses Radio-SkyPipe or custom Python code to cross-correlate noise levels from both antennas.
    • Mainly designed for solar & Jovian bursts, but people have hacked it into crude interferometers.

Very approachable, though limited in resolution.


Here are several GitHub / online-projects + guides that you can download / adapt. Some are full correlators; others are “toy” examples. I’ve included what each project gives you in terms of code, how close it is to your setup, and what modifications you’d likely need.


✅ Useful GitHub Examples & Projects

NameWhat it Does / What Code is AvailableRelevance to Your Setup (2-cable / small baseline)Pros / What You’d Need to Adapt
Effex (evanmayer/effex)A software correlator: cross-correlates signals from two USB RTL-SDR dongles (sharing/synchronizing clocks). You run a command, specify time, bandwidth, frequency, etc. (GitHub)Very close to exactly what you want: two inputs, real hardware, correlation.Need RTL-SDRs (or similar), and you’ll want them clock-locked/synchronized. If your antennas / cables are different, adjust gain / frequency. Also adapt output formats if needed.
Spectro Radiometer (ccera-astro/spectro_radiometer)Provides spectral & continuum modes, plus includes correlation between two channels. Uses GNU Radio, etc. (GitHub)Good for learning the basics of correlation, seeing cos/sin correlation, total power, etc.If your sample rates / frequency are different, you’ll need to modify flowgraphs. Also the hardware (SDRs) must be supported. Integration time, buffering etc will need tuning.
Setting Up a 2 Horn Interferometer (WVURAIL / “2 Horn” + LimeSDR + GNURadio)A lesson module showing how to build a 2-horn (i.e. two-antenna) interferometer using LimeSDR, with GNU Radio flowgraphs: one that adds signals, one that multiplies (i.e. correlator) for interference detection. (wvurail.org)Very relevant: two antenna elements, multiplication (correlation), usable as starting point with your two-cable scheme.You might have to adapt to your antennas/cables (gain, phase), ensure clocking of the two channels is coherent. The flowgraphs likely assume horns; for cables you may replace the front end appropriately. Also might need higher sample rates or buffer sizes.
pyuvsim (RadioAstronomySoftwareGroup)A simulator: generates realistic interferometer outputs from model skies, for testing calibration/imaging pipelines. (GitHub)Useful for testing / validation: simulate your expected fringe patterns/delays without hardware. Not for real-time correlation of physical signals.After getting some real data, you can compare to simulation. Also use to test your pipeline’s imaging/calibration steps. But you’ll still have to write/connect the code that takes real SDR inputs and produces visibilities.
pyuvdataPython library for handling interferometric datasets (various formats: uvfits, measurement sets, etc.), reading, writing, manipulating visibilities. (GitHub)Very useful after you’ve done correlation: to store, inspect, maybe calibrate or format your data.You’ll need to convert whatever raw output you have into a format pyuvdata can read (or adapt your output). Also you may use CASA or other tools alongside.

🛠 Suggested Starter Pipeline Using One of These

Here’s a suggested minimal pipeline that borrows from these, for your two-cable antenna setup.

  1. Hardware setup
    • Use two SDRs (or a dual-channel SDR) with shared clock/timing (GPSDO, 1PPS, or shared reference).
    • Each cable to one channel. Ensure amplification / filters are reasonable so signals are in decent SNR.
  2. Capture / Digitize
    • Use GNU Radio (or SDR software) to sample both channels, synchronously.
    • Save raw IQ data, with timestamps, at your chosen bandwidth and sample rate.
  3. Correlation / Cross-Multiply
    • Use a project like Effex for correlation. Alternatively, build a GNU Radio flowgraph (as in the “Multiplying spectrometer” example in the 2-horn project) that multiplies the IQ streams (with delay compensation if needed).
    • Integrate over time to reduce noise (average the cross products).
  4. Calibration / Delay Compensation
    • You might have different cable lengths, phase delays, clocks; measure or estimate these.
    • Possibly feed in a known source (sun, satellites, etc.) to see the fringe pattern, adjust for delays.
  5. Post-Processing / Imaging / Visualization
    • Use pyuvdata to load the visibility data.
    • If your baseline and coverage allow, you might do a simple Fourier inversion to produce “images” (though with 2 points baseline, resolution is very limited).
    • Compare to simulated output using pyuvsim to see whether your data are reasonable.
  6. Testing & Debugging
    • Start small: first try with strong signals (sun, broadcast transmitter) so fringes are obvious.
    • Check coherence: see if two channels are maintaining phase stability.
    • Adjust integration times, sample rates, filtering to get usable signal.

A zip of starter code (using Effex + GNURadio + pyuvdata) configured for a particular SDR, so you can just drop in your setup parameters and test.

The SDRplay RSPduo is a good choice for a two-channel interferometer, since both tuners can be clock-locked internally and sampled simultaneously. That saves you a lot of synchronization headaches compared to two independent SDRs.


📦 Proposed Starter Package (for RSPduo at 1420 MHz)

The bundle would include:

  1. GNU Radio Flowgraph (.grc)
    • Uses the gr-sdrplay3 source block (RSPduo driver).
    • Configured for:
      • Center frequency: 1420.405 MHz
      • Sample rate: ~250 kS/s (tunable up/down depending on your PC power)
      • Both tuners active (Tuner A = Antenna 1, Tuner B = Antenna 2)
    • Output: two streams of complex64 samples, time-synchronous.
  2. Python Correlator (correlator.py)
    • Reads the two streams (from files or live GNU Radio pipe).
    • Applies optional delay correction (for cable differences).
    • Computes cross-correlation:

V(τ)=⟨X(t)⋅Y∗(t+τ)⟩V(\tau) = \langle X(t) \cdot Y^*(t + \tau) \rangle

  1. Integrates over chosen time windows (e.g. 1 s, 10 s, 60 s).
  2. Saves visibilities as .npy and .uvfits (using pyuvdata).
  3. Post-Processing Notebook (analysis.ipynb)
    • Loads the correlated data.
    • Plots:
      • Real & imaginary visibilities vs time.
      • Fringe amplitude when tracking the Sun.
    • Option to export to CASA-compatible formats.

🛠 Requirements

  • Hardware: SDRplay RSPduo, GPSDO (optional but helpful), LNA(s), your two-cable antenna.
  • Software (Linux recommended, e.g. Ubuntu):
    • SoapySDR + SoapySDRPlay3 (driver)
    • GNU Radio 3.10+
    • Python 3.10+ with numpy, scipy, pyuvdata, matplotlib

🔜 Next Step

I can generate for you:

  • The GNU Radio Companion .grc file
  • The Python correlator script (correlator.py)

so you can run them straight away on your RSPduo.

👉 Do you want me to:

  1. Make the flowgraph save raw IQ data to disk and correlate offline (safer, easier first step),
  2. Or set it up for real-time streaming correlation (slightly trickier, but more exciting)?

a full starter kit for the SDRplay RSPduo with both real-time and offline correlation paths.

📦 Attached – RSPDuo Interferometer Starter Kit (ZIP)

Inside you’ll find:

  • capture_and_correlate_realtime.py — GNU Radio Python flowgraph using gr-soapy (RSPduo, 2 channels) with optional raw recording and on-the-fly cross-correlation + moving-average integration.
  • offline_correlator.py — Numpy-based correlator for two raw IQ files (complex64), with delay compensation and integration.
  • plot_vis.py — quick plots of real/imag/|V| vs time.
  • config.yaml — central settings (freq = 1420.405 MHz, sample rate, gains, integration window, etc.).
  • requirements.txt and a detailed README.md.

How to run (short version)

  1. Install SoapySDR + SoapySDRPlay3 (RSPduo driver) and GNU Radio 3.10+ (with gr-soapy).
  2. Create a venv for the Python tools and pip install -r requirements.txt.
  3. Edit config.yaml as needed (sample rate, gain, integration).
  4. Real-time + record:
  5. python capture_and_correlate_realtime.py –realtime –record_raw

Outputs:

  1. data/ch0_iq.c64, data/ch1_iq.c64 (optional raw IQ)
  2. data/vis_realtime.c64 (complex64 visibilities)
  3. data/vis_realtime.csv (timestamped summary)
  4. Offline correlation (after a recording):
  5. python offline_correlator.py –ch0 data/ch0_iq.c64 –ch1 data/ch1_iq.c64 –sps 250000 –integrate 0.5 –out data/vis_offline.csv
  6. Plot:
  7. python plot_vis.py data/vis_realtime.csv
  8. # or
  9. python plot_vis.py data/vis_offline.csv

Notes tuned to your setup

  • The real-time script uses gr-soapy’s two-channel source to grab both RSPduo tuners synchronously, then does: conjugate(CH1) × CH0 → moving-average.
  • Integration window defaults to 0.5 s; tweak integration_seconds in config.yaml.
  • If your two long cables differ in length, set cable_delay_ns in the config (for offline) or sweep –delay_ns in offline_correlator.py.
  • First light target: the Sun (broadband, strong fringes).

If you’d like, I can also:

  • add a frequency-domain correlator (FFT → X-engine) variant,
  • export to UVH5/UVFITS via pyuvdata,
  • add CASA import helper scripts,
  • or tailor the defaults to your exact RSPduo gain/bandwidth preferences.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.