Using LimeSDR as a signal generator


I would like to use LimeSDR-USB as a signal generator. My first attempt was to use GNU Radio like this:

.grc file:

It kind of works (the signal could use a little filtering) and I see a signal on TX1L with my oscilloscope.

Unfortunately, the script stops after about a second after running it. I tried to change USB ports, change sample rate and use external power source, but it didn’t help. I didn’t manage to find a way to make the script work until I explicitly stop it.

Here is a GNU Radio output:

I also tried to follow item 4.3 from this article to generate a signal using LimeSuiteGUI. It also kind of works but resulting signal is heavily distorted:

Lastly I tried GNU Radio + Osmocom Sink and osmocom_siggen scirpt. Unfortunately I didn’t manage to make it work, I get a “Tx Calibration: MCU error 3 (SXR tune failed)” error. A few people complained about it on this forum, but apparently no solution has been found.

Device info:

device info

Packages versions (I’m using Arch Linux x64):

libosmosdr-git r162.ba4fd96-1
gr-limesdr-git r19.3234d26-1
soapysdr-git 3:0.6.1.r103.g5f5a4d8-1
limesuite-git r1739.d6b0371-1

A little peace of advice on how to prevent premature GNU Radio termination or fix the distortion problem in case of LimeSuiteGUI would be much appreciated.

1 Like

Hi, @afiskon

Try changing “Options” block parameter “Generate Options” to “QT GUI”, for example. This should prevent your flow graph from stopping. Not sure why it happens but it seems that there is a difference from when you are using “Signal Source” and “Constant Source”. “Constant Source” seems to tell “GNU Radio” that it has finished working and flow graph may be terminated when “NO GUI” is used. That’s at least what I have found after trying different ways of generating constant waveform.

Hello @Osvald,

I’ve just tried signal_generator.grc from myriadrf/gr-limesdr repository. It’s QT based and also terminates after 1 second of execution.

Strange. I’m on GNU Radio and signal_generator.grc does not terminate until I stop it myself.

What version of GNU Radio do you use?
Have tried other GNU Radio versions?
Have you tried to change “Options” block options?
Do you always get the same output?

Hello @Osvald,

OK, I figured it out. I increased the gain to 60 dB and now signal generation doesn’t terminate. In fact it worked all this time as expected, I just used a wrong scale on the oscilloscope :frowning:

However after playing with GNU Radio for a while I didn’t find a way to get a relatively clean sinusoidal signal. It always looks something like this:

Why the signal is distorted? Is it an expected behavior for LimeSDR? Can I somehow smooth the signal?

1 Like

I played a little with sample rates, sine wave frequency and FFT plots and eventually figured it out. You can find some details in this discussion What exactly LimeSuite Sink (TX) does with IQ data? Apparently LimeSDR doesn’t work as a signal generator particularly well on frequencies < 90 MHz. Especially it doesn’t like frequencies that don’t divide by 30 MHz, I guess it has something to do with internal clock: Rakon RPT7050A @30.72MHz.

TL;DR it’s a bit tricky, but you actually can use LimeSDR as a signal generator (I got sine waves up to 500Mhz, my oscilloscope can’t show larger frequencies) if you keep in mind stuff like how aliasing depends on sample rate and are willing to tune the gain manually (it changes with frequency and is much higher if frequency % 30Mhz == 0).

I am Sorry for speaking out of term, I am a newbie with SDRs, I have a LimeSDR-USB and currently trying to generate signal between 1MHz to 100MHz. I am using GNUradio-companion with gr-limesdr package, which requires the ‘.ini’ file . I am unable to get proper tutorial or documentation for how to set parameters in LimesuiteGUI to generate the .ini file. Any help is very much appreciated.

Hello @siddiki,

gr-limesdr doesn’t require .ini files, it is completely optional. If you want to generate a signal try signal_generator example which is documented here. With it you can choose what type of signal you want by modifying “Signal Source” block and you can change the signal and RF frequency when the flowgraph is running.

Hello @Garmus,
Thank you so much for responding, and my apologies if i am asking something silly but i am quite perplexed now. When i run the same example simulation (Signal Generator) on gnuradio-companion with gr-limesdr TX block(without the .ini file) . The simulation does not run and I get following response:
Warning: failed to XInitThreads()
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to ‘/tmp/runtime-root’
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to ‘/tmp/runtime-root’

LimeSuite Sink (TX) info

Connecting to device
LimeSuite version: 18.10.1-myriadrf1~ubuntu18.10
gr-limesdr version: 2.1.4
Device list:
Nr.:0 device:LimeSDR-USB, media=USB 2.0, module=FX3, addr=1d50:6108, serial=0009081C05C11B23
Reference clock 30,72 MHz
Using device: LimeSDR-USB(0009081C05C11B23) GW: 2.19 FW: 4

INFO: device_handler::enable_channels(): SISO CH0 set for device number 0.
INFO: device_handler::set_samp_rate():


Can you try it on USB 3.0 port? And you are using quite old LimeSuite version, can you get the newer one? Your current version is almost whole year old.

Thanks @Garmus, I tried upgrading my LimeSuite to newer version by building from source through github but i encountered following error in OpenGL(Provided that i uninstalled the previous LimeSuite first):
8%] Building CXX object src/CMakeFiles/LimeSuite.dir/lms7002m/LMS7002M_BaseCalibrations.cpp.o
In file included from /home/siddiqui/LimeSuite/src/oglGraph/dlgMarkers.cpp:23:
/home/siddiqui/LimeSuite/src/oglGraph/OpenGLGraph.h:282:1: error: expected class-name before ‘{’ token
In file included from /home/siddiqui/LimeSuite/src/oglGraph/dlgMarkers.cpp:23:
/home/siddiqui/LimeSuite/src/oglGraph/OpenGLGraph.h:368:5: error: ‘wxGLContext’ does not name a type; did you mean ‘wxCenter’?
wxGLContext *m_DrawingContext;
/home/siddiqui/LimeSuite/src/oglGraph/OpenGLGraph.h:404:2: error: ‘wxGLContext’ does not name a type; did you mean ‘wxCenter’?
wxGLContext *m_glContext;
make[2]: *** [src/oglGraph/CMakeFiles/oglGraph.dir/build.make:63: src/oglGraph/CMakeFiles/oglGraph.dir/dlgMarkers.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:318: src/oglGraph/CMakeFiles/oglGraph.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
[ 8%] Building CXX object src/CMakeFiles/LimeSuite.dir/lms7002m/goert.cpp.o

Nevertheless, I am using Ubuntu 18.10 and through PPA i can only download LimeSuite version 18.10-1
which works fine but had those above mentioned signal generation issues (that it needs .ini file)
What should I do, any recommendations ? Thanks