LuaRadio Gives Insight Into SDR

In theory, you shouldn’t need any help to develop a software-defined radio (SDR) application. But in real life you really don’t want to roll your own code every time to read the IQ samples, perform various transformations on them, and then drive audio output. At worst, you’ll use some libraries (perhaps GNU Radio) but usually, you’ll use some higher-level construct such as GNU Radio Companion (GRC). GRC is a bit heavyweight, though, so if you’ve found it daunting before, you might check out some of the material on the LuaRadio website.

We’ve looked at LuaRadio several years ago, but it has undergone a lot of changes since then and has some excellent documentation. Like Lua itself, LuaRadio emphasizes fast scripting. It supports quite a few pieces of common hardware and nearly anything that feeds data through a soundcard.

Why not use GNU Radio? LuaRadio has an official answer. However, LuaRadio doesn’t have a GUI — at least, not yet. Maybe a Hackaday reader will fix that. It also isn’t as mature as GNU Radio, but it does have a lot of positive features such as a small footprint, easy embedding, and a simple way to add additional features.

If you have an RTL-SDR, there are a number of examples:

  • WBFM Broadcast Mono and Stereo Receivers
  • NBFM Receiver
  • AX.25 Packet Radio Receiver
  • POCSAG Receiver
  • RDS Receiver
  • AM Receiver (envelope and synchronous)
  • SSB Receiver

The project GitHub page shows recent updates to version 0.6.0. Just as an example, the flowgraph at the top of this post looks like this in Lua code:

local radio = require('radio')

radio.RtlSdrSource(88.5e6 - 250e3, 1102500), -- RTL-SDR source, offset-tuned to 88.5MHz-250kHz
radio.TunerBlock(-250e3, 200e3, 5), -- Translate -250 kHz, filter 200 kHz, decimate by 5
radio.FrequencyDiscriminatorBlock(1.25), -- Frequency demodulate with 1.25 modulation index
radio.LowpassFilterBlock(128, 15e3), -- Low-pass filter 15 kHz for L+R audio
radio.FMDeemphasisFilterBlock(75e-6), -- FM de-emphasis filter with 75 uS time constant
radio.DownsamplerBlock(5), -- Downsample by 5
radio.PulseAudioSink(1) -- Play to system audio with PulseAudio

Not too hard, even without too much documentation. If you’d rather tackle GRC, we have a tutorial for that.

3 thoughts on “LuaRadio Gives Insight Into SDR

  1. Sad, no comments. Lua is such a great language. Messed around with previous version on a pi many months back. Had more dependencies than I thought and was sort of burnt out by the time I got it running. Excited to see that the project is still getting updates and may give it another shot.

    1. Thanks for the feedback. I’ll modify the LuaRadio OS packages to pull in all the dependencies needed for real time usage, so users don’t have to spend time chasing them. This has become easier now since volk and liquid-dsp have become official packages in many distributions.

  2. I needed to the following things using sdr
    1) can i decode the digital voice recording of unknown frequency and if yes how. Pls email me
    2) which is the best sdr which is cheap and beat fromlow frequency up to 2.5hz.
    3) where can i download wide band plugins for Sdr.

    Pls mail me on

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

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