LimeSDR Made Simple Part 4: to Pothos and Beyond

It’s time again for another bite sized chunk of LimeSDR. This is the fourth post in the series and while this will be our second practical exercise, it does build upon the whole series and so if you have not read the first three articles, you are advised to take a look now (Part 1Part 2Part 3)

Last time we went though the self-test.ini and pretty much broke the example in most ways possible. This time we’ll try to use what we have learnt to improve a signal and create our very first application.

Getting started

At this point it’s assumed Lime Suite is successfully installed and everything is working.

If you have not already, it might be a good time to install Pothos, along with GQRX or SDR Console (these are not the only two and any general purpose receiver application will do).

Secondly, we are going to need some hardware for our LimeSDR and if you have one an antenna suitable for FM radio. Don’t worry if you cant find a suitable antenna, as a length of un-screened wire around 75cm and an SMA connector will do as a makeshift aerial.

Also given we are again working in a licensed band it may be wise to disconnect any high gain antennas on the TX port. It should be pointed out that while licensed spectrum in most European countries, it is now legal to use an “MP3 transmitter” of nW power levels within certain FM bands and so in theory using the LimeSDR as one of these transmitters is possible within the law. While this is the case it’s best not to take any chances.

GQRX/SDR Console

Almost always the first application launched with SDR is a tuning application like GQRX or SDR Console. While we won’t dwell on the finer details there are a few key items to point out. Additionally we will need to confirm a radio channel we can tune to later. Using one of these radio applications search around the VHF FM radio band for your region. In our case we found BBC Radio 3 was a strong signal on 90.9MHz.

SDR Console is a windows only application, it has LimeSDR support and is hardware-accelerated. There are not many settings that need to be adjusted other than setting the correct receive path. In this case we are using LNAL (low band) RX1_L since we are looking for signals around 100MHz. See article 1 in the series for the explanation of these bands and which LNA/connection to use.

GQRX has similar controls in the “Input Controls” tab. Hopefully the background from the last few articles has prepared the way that these controls are used.

The power of Pothos

If you are going to follow along it is a good time to play with the previous applications and find a suitable radio channel. After this it is time to warm up the software for our first application. As with all things new baby steps to start with and our first application will be an FM radio. If you want a good working example without making one there is a great example by Josh Blum here.

Before we get started a few words about Pothos. Pothos is dataflow programming software suite targeted at SDR. In simple terms you draw your program rather than typing code and this makes it very intuitive to use. So let’s get started by opening PothosGUI and then naming the new application by “save as” to a sensible name.

On the right is a block tree. These are the items we will interact with and so first let’s add an “SDR source” — this lives in the SDR tab. Note the terminology “source”(read proves output) and “sink” (read takes input).

Double-click this device to open the SDR Source properties and change them to those as shown below. Note the settings:

  • Device Args has a few options but clicking the drop-down box and selecting your LimeSDR seems to work well.
  • In “channels” we need LNAL selected and the frequency in Hz. This will need to match your radio channel. Ours was 90.9MHz or 90900000Hz and you can also use engineering notation, so 90.9e6:

Click commit and add 2 more controls an “Audio Sink” and a “Freq Demod”. Once this is done you can click the “go” button. Remember to turn your volume down first!

White noise

This doesn’t sound like Radio 3 (or your choice of radio station)! Well this is not surprising and lets look at what we have at this point:

  • An SDR device (the LimeSDR) outputting raw I/Q data at 1Msample/s.
  • A default gain and filtering set-up.
  • A frequency demodulator. This is a software FM demodulator.
  • A speaker playing the audio.

The first thing to check is do we have sufficient gain. Let’s start by turning the SDR “Gain” property up. The amount it needs to be adjusted will depend on your signal. Once you get sufficient gain the signal will change from white noise to a digital chirp/stutter sound, but still nothing decipherable.

Looking at what else is wrong we can see we are playing 1Msample of data at the speaker….. this probably wont work well so lets down-sample a little. The easiest way to do this is use a filter (without the filter). Adding an “FIR filter” and opening the properties change both “Decimation” to 35 and “Data Type” to Float32 from Complex Float32. The reason for switching from “Complex” is after demodulation we no-longer have I/Q only baseband, connect this between the demod and the audio sink.

.

At this point the example should be getting there and somewhere in the white noise should be some audio!

To visualise this data coming in let’s use a spectrogram. This, like many of the controls in Pothos, has two parts: the control and a “widget” — do not forget to add this widget.

From the spectrogram it’s clear we have no filters set up, so we can see an ultrawide band at the output and so we are listening to 1MHz+ worth of spectrum, noise and all.

Time for some filtering

While designing FIR filters by hand is “fun” there are controls that will do this for us, so let’s add an FIR Designer and a FIR Filter. These devices have variables within them so will be a little different when we connect them, so do not do this yet.

On the FIR Designer properties set upper frequency to 16KHz (16e3 or 16000) and the rest of the default settings will be fine.

The FIR filter needs no adjustment and it will be fine as-is. We need Complex Float32 because we will have both I and Q data to filter.

Next connect the “0” (orange) nodes of the filter. Nothing should have changed and at this point white noise mixed with audio coming out of the speakers. So let’s add some taps. Drag the FIR designer output onto the body of the FIR filter. This brings up the “Connection” control panel. In here we can set what happens with the FIR Designer output. Click “tapsChanged” on the left and then “setTaps” on the right and commit.

We are left with a much better audio signal — but hang on, it sounds like we are listening to the Smurfs, the audio sounds wrong. Well at this point we admit we’ve given you the wrong setting for decimation and it should be 25; if this setting is incorrect the output will be frequency shifted. It’s worth having a play with this control at this point as some very amusing results can be achieved.

Final words

There we have it: an implementation of a very basic (bare minimum) FM radio. Improvements can be made by adding controls for tuning and gain. Adding a Filter Designer to the decimating “FIR Filter” would help, along with sample rate/bandwidth adjustments. This very basic application implementation should be enough to get started in Pothos and hopefully explains a little how the FM radio from Josh works. These are the basic building blocks of most SDR systems: Filter > demodulator > decimation.

Because we’ve been so science light in this instalment of LimeSDR Made Simple we’ll try to treat you to the usual insights into the theory side next time when we look at some more applications and ways to make use of the power embedded within your LimeSDR.

Karl Woodward

 

3 Responses to “LimeSDR Made Simple Part 4: to Pothos and Beyond”

  1. Karl, thanks for your posts. LimeSDR team is too tech savvy, concentrated on R&D and thus doesn’t care much about users with lack of C/C++ and embedded SW programming skills. Their web-sites are so far away from being perfect, IMHO, e.g. compared to German osmocom.org that really sets the bar in the field. You fill the gap and do awesome job. Thanks a lot!

    • Am I too harsh on Lime team? Oh, yes, I am. Feel sorry for that. They do a great job assisting us to learn the field in practice.

  2. Hi Dmitry, work is under way to improve the documentation and software ease of use. Karl’s posts, such as this, are one example — but others are in the pipeline too :o)

Leave a Reply