GNU Radio

Problems running DSPIRA GRC (GNU Radio Companion) flow-graphs due to missing gr-radio_astro out-of-tree (OOT) module in GNU Radio installation

I am experiencing errors when I try to tun DSPIRA GRC (GNU Radio Companion) flow-graphs due to missing gr-radio_astro out-of-tree (OOT) module in my Windows GNU Radio installation. What is the problem and how do I fix it?

Yes — that’s a known issue with some DSPIRA GNU Radio Companion (GRC) flowgraphs. The block
radio_astro_vector_moving_average is part of the Radio Astronomy (radio_astro) module that’s not included in a standard GNU Radio install anymore — and even older DSPIRA builds sometimes assume it’s there when it isn’t.

Here’s what’s going on and how to fix it 👇


🧠 What the Block Is

radio_astro_vector_moving_average is (or was) part of the gr-radio_astro out-of-tree (OOT) module developed for educational radio astronomy (Hydrogen line etc.).
It performs a moving average on a vector input — typically used to smooth FFT spectra in the DSPIRA projects.


🧩 Why GRC Says “Does not exist”

  1. The gr-radio_astro module is not installed or not compiled correctly.
  2. Some DSPIRA example flowgraphs reference the block by an old name (radio_astro_vector_moving_average) — but the newer gr-radio_astro version either:
    • Uses a different block name (radio_astro_avg, radio_astro_averager, etc.), or
    • Has dropped that specific vector block entirely.

🧰 Fix Options

Option 1: Install or rebuild gr-radio_astro

sudo apt install git cmake g++ python3-dev libboost-all-dev gnuradio-dev
git clone https://github.com/dspira/gr-radio_astro.git
cd gr-radio_astro
mkdir build && cd build
cmake ..
make
sudo make install
sudo ldconfig

Then restart GNU Radio Companion.

If installation succeeds, open GRC and check under Radio Astronomy → Vector Moving Average.


Option 2: Replace with standard GNU Radio blocks

If the module is deprecated or won’t build (which is common with modern GNU Radio 3.10/3.11+):

You can replace it manually with:

  • A Stream to Vector block (if needed)
  • Followed by a Moving Average block (set “Length” = number of spectra to average)
  • Possibly a Vector Multiply Const to normalize the result.

This reproduces the effect of the missing radio_astro_vector_moving_average.


Option 3: Use DSPIRA’s updated fork

Some recent DSPIRA courses maintain an updated repository that removes the dependency:

git clone https://github.com/dspira/dspira-grc.git

Look for a newer .grc file that doesn’t reference that missing block.


I am using gnu windows 3.10.12.0 Python 3.12.9 windows 10. The Github gr-radio-astro repository only gives instructions for installing it under Linux, not Windows as I am using. What do I do?

I dug around, and here’s what I found plus a concrete suggestion for how to patch your DSPIRA flows in GNU Radio 3.10 (on Windows) to get around the missing radio_astro_vector_moving_average.


What I found out

  • The gr-radio_astro out-of-tree (OOT) module is the one that contains (or used to contain) DSPIRA‘s specialized radio astronomy blocks. (GitHub)
  • The DSPIRA instructions still reference installing gr-radio_astro and then using its GRC blocks (e.g. the spectrometer_w_cal.grc) (wvurail.org)
  • The standard GNU Radio blocks/moving_average (in-tree) supports vector inputs (via the vlen parameter) so it can do a per-vector-element moving average. (wiki.gnuradio.org)
    • The documentation states:

“When operating on vectors, the average is done using only the numbers from the same vector index.” (wiki.gnuradio.org)

  • In past versions of GNU Radio, users asked for exactly that kind of “vector moving average” functionality, and the answer was to use moving_average with vlen > 1 (i.e. treat the stream as vectors) (lists.gnu.org)
  • However, the DSPIRA flows sometimes expect a block named radio_astro_vector_moving_average (or similar) which is not present in your install (hence the “does not exist” error).

So, in short: that DSPIRA block is likely a wrapper or alias provided by gr-radio_astro, but in your GRC it is unrecognized (since you don’t have or can’t load that OOT block in Windows). The in-tree GNU Radio moving_average block can do vector averages, so you can effectively replace the missing block with a configuration of standard blocks.


How to patch / replace radio_astro_vector_moving_average

Here’s a recipe (and steps) to patch the flowgraph:

Replacement block chain (conceptual)

  1. Stream to Vector (if your data is scalar streams, but in many DSPIRA flows you already have vector streams)
  2. Blocks → Moving Average (the built-in one) with parameters:
    • length = number of samples to average over (same as DSPIRA intended)
    • scale = 1/length (so the output is a true average, not just sum)
    • vlen = vector length (if your data is vectorized)
  3. Vector to Stream (if DSPIRA later expects stream output)
  4. Possibly a Multiply Const to fine-tune scaling or normalization.

In many DSPIRA flowgraphs, the block radio_astro_vector_moving_average is doing just that — a moving average over a vector of spectral bins.

Steps to patch your .grc

  1. Open your DSPIRA .grc flowgraph in GRC (in GNU Radio Companion).
  2. Locate the reference to radio_astro_vector_moving_average (it might be in “Radio Astronomy” category or under “gr-radio_astro” if partially recognized).
  3. Remove or disable that block.
  4. Insert a Stream to Vector block (if needed) such that each vector corresponds to one spectral snapshot (i.e. one FFT frame).
    • If your DSPIRA flow already passes vector data (e.g. from an FFT block), you may skip this.
  5. Add the Moving Average block (from gr::blocks)
    • Set Length to the same number of frames over which the DSPIRA block was averaging
    • Set Scale = 1/Length
    • Set vlen = the vector length (number of spectral bins)
  6. If the downstream expects a stream, add Vector to Stream to unpack vectors back to stream samples.
  7. Run/validate the flowgraph.

If done correctly, the built-in moving_average will average per vector index (i.e. each spectral bin’s time history) independently — effectively the same as radio_astro_vector_moving_average.

Example parameter setting

  • Suppose your spectrum has 1024 bins (so vlen = 1024).
  • You want to average over 10 time frames.
  • Then:
    • Length = 10
    • Scale = 1/10 = 0.1
    • vlen = 1024

Then each bin i in the vector will be averaged over the last 10 values of bin i.

Things to watch out for / caveats

  • The latency will increase (you are averaging over multiple frames). Make sure buffering is sufficient.
  • The GNU Radio moving_average has a parameter max_iter, which is the maximum number of samples the block will treat in one call. If your window length is large, you may need to tune max_iter appropriately or watch out for discontinuities. (wiki.gnuradio.org)
  • Be careful with the scaling factor so you don’t inadvertently multiply or divide twice.
  • Ensure your flowgraph data types and vector lengths match (float, complex, etc.).
  • On Windows, building OOT modules is trickier than Linux, so using in-tree blocks reduces complexity and increases portability.

Recommendation & Workflow

Given you’re running Windows + GNU Radio 3.10, here’s what I’d suggest you do:

  1. Try patching your DSPIRA flow using the replacement chain above. This is the fastest way to restore functionality without relying on gr-radio_astro under Windows.
  2. Optionally see if the Windows build of gr-radio_astro is available (precompiled) or whether someone has built a Windows port, but that’s less likely.
  3. Test with a small averaging window first (e.g. length = 4 or 8) to verify the block is working, then scale to the value that DSPIRA intended.
  4. Compare behavior (output amplitude, noise smoothing) between your patched version and any reference examples (e.g. from DSPIRA docs) to ensure correctness.

Excellent — and yes, you’ve hit the tricky part:
gr-radio_astro is a C++ + Python (CMake-based) GNU Radio OOT module, and indeed all the official build instructions are for Linux.

However, you can build it on Windows using CMake and the MSVC toolchain that ships with your GNU Radio installation — it just needs a bit of manual setup. Let’s go through it carefully.


🧩 Goal

You want to compile and install gr-radio_astro so that its blocks (including radio_astro_vector_moving_average) appear in GNU Radio Companion 3.10.12.0 (Windows).


🧰 You’ll need

Before you start, make sure you have:

  1. GNU Radio 3.10.12.0 (already installed — you said yes ✅)
    • Installed typically at:
o    C:\Program Files\GNURadio-3.10\
  1. CMake (GUI or CLI) — version ≥ 3.20
  2. Visual Studio Build Tools (or full Visual Studio)
    • With the “Desktop development with C++” workload installed
  3. Git Bash or PowerShell (for running commands)
  4. Python 3.12 already installed (yours is fine)

🧱 Step-by-step: Build gr-radio_astro on Windows

Let’s assume you extracted the ZIP to:

C:\Users\Andrew\Downloads\gr-radio_astro-main

1. Open a “x64 Native Tools Command Prompt for VS 2022”

(You’ll find it in Start Menu → Visual Studio 2022 → Developer Command Prompts)

This ensures you have cl.exe, link.exe, and the correct environment.


2. Set up environment variables for GNU Radio

You may need to help CMake find GNU Radio.
Run these commands:

set GNURADIO_DIR="C:\Program Files\GNURadio-3.10\cmake"
set PATH=%PATH%;"C:\Program Files\GNURadio-3.10\bin"

3. Create a build directory

cd C:\Users\Andrew\Downloads\gr-radio_astro-main
mkdir build
cd build

4. Run CMake configuration

Use this form (replace paths if needed):

cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_INSTALL_PREFIX="C:\Program Files\GNURadio-3.10" ..

CMake should detect GNU Radio, Boost, and Python bindings.

If it complains about missing packages, you can add flags like:

-DPython3_EXECUTABLE="C:\Program Files\GNURadio-3.10\python3.exe"

5. Build the project

Still in the build folder:

cmake --build . --config Release

This will compile the C++ code.


6. Install the module

Once it builds successfully:

cmake --install . --config Release

This copies the compiled libraries and XML block definitions into GNU Radio’s directories.


7. Verify

Start GNU Radio Companion.
Go to Help → About GNU Radio → Paths and confirm it lists your install directory.

Then open the Block Tree, scroll to Radio Astronomy, and look for:

Vector Moving Average
Spectrometer
FFT Log Power
File Writer

etc.


⚠️ Common pitfalls

SymptomLikely causeFix
Could NOT find GNURADIOWrong path to GNURadio cmake filesSet GNURADIO_DIR correctly
Could NOT find BoostBoost not found in MSVC environmentUse the Boost that ships with GNU Radio (should be under its lib folder)
Python import errorsModule installed to wrong Python site-packagesEnsure CMAKE_INSTALL_PREFIX matches GNU Radio’s install root
Missing block in GRC.xml files not copied into share/gnuradio/grc/blocks/Copy them manually from gr-radio_astro/build/grc/

🧠 Alternative: Easier workaround (if build fails)

If you get stuck building on Windows, there’s a practical fallback:

Use the replacement chain we discussed earlier — the built-in Moving Average block with vlen set — it gives identical functionality and requires no compilation.


ChatGPT’s offer of further help:

I can even send you a ready-to-import .grc subflow (a self-contained block) that behaves identically to radio_astro_vector_moving_average, so you can drop it into your DSPIRA project instantly.

Would you like me to generate that .grc “drop-in replacement block” (so you can keep working even if the CMake build fails)?

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.