LimeSDR Basics - Software

Hello,
I recently started working on limeSDR and I could not quite decide where to start. I thought coding c++ with LimeSuite API would be the best option since coding could give me more flexibility but I realized that the given library is somewhat limited compared to GUI. I decided to move on to GNU Radio or Pothos. What are your suggestions? What are your thoughts on the API? Also, I could not find many examples on GitHub regarding the API except a few given on the official repo. Do you guys have examples on API?

Thank you,
Ugur

Do you just want to experiment with SDRs or are you doing something special that the available programs cannot do ?

Hello,
I am in the same situation @ugy99 is. I have a LimeSDR-USB since 4 weeks.
I tested it, under Win10, using Pothos and LimeSuite just to see if all works.
With Pothos I have the problem that all the math blocks don’t work.
I would program in Python 3.9 with pyLMS7002Soapy but even if the installation is ok when I try to import and use I have an error regarding the Soapy SDR dll.

  • Is it better to leave Win10 and move to Ubuntu 20?

  • Forget Python and start to code in c++?

Thanks for suggestions
BR
L.

Is it better to leave Win10 and move under Ubuntu 20?
I

@RightHalfPlane My final goal is to do an RF receice chain for magnetic resonance imaging device but I dont think any of the programs can do this by default. This kind of application requires extremely precise timing and incredibly small phase difference between the LO signal and the received signal. Right now I am experimenting with LimeSDR to learn it. For instance, I am trying to demodulate a basic AM signal with the cpp library. The signal is generated from a signal generator.

You can write a program to get the data from the LimeSDR using LimeSuite or SoapySDR, but they both buffer the data so that the precise timing is questionable. You could improve it some by going into the library and doing the buffering yourself. Using a LimeSDR Mini and SoapySDR, I timed a data transfer that should have taken exactly 10 seconds. For the three tries, I got 9.882, 9.851, and 9.804 seconds. This was the time to load 1.6GBs of data. I assume that it would better minimizing the buffering, but I do not know by how much ?

To decode AM you can use calls to few of the liquid-dsp routines - nco_crcf_mix_block_up, nco_crcf_mix_block_down, msresamp_crcf_execute, freqdem_demodulate_block, and msresamp_rrrf_execute. A slight variation of the commands will get you FM, NBFM, USB and LSB. sdrTest is a example program that does the decodes. It is a utility program that comes with SdrGlut.

@RightHalfPlane now that you mentioned liquid-dsp, I got a little more confused. Does this mean that the limeSuite API is not capable of implementing some modulation types with enough detail via its small choice of functions? I noticed that there are no functions that have control over some features of limeSDR such as phase correction and decimation. My application needs to do IQ Demodulation with almost zero phase error. Although I even used a reference clock input, the simple AM demodulation program I wrote failed to satisfy this criteria. Would liquid-dsp or gnu radio provide more control over some parameters of the board so that it could fulfil the needs? Also, does LimeSDR have built-in support for liquid dsp library?

Thank you for your reply.

I do not have much experience about Lime but I hope I can help you a bit: When it comes to your question about c++ or python, I would say c++ since most of the libraries I came across are written in c++ or c rather than python but I am sure you can find many alternatives using python as well. Regarding your first question, Ubuntu is a must in my opinion since this vast universe of open source software is built in consideration with Linux OS. Also, package managing on Ubuntu seems 10x easier with sudo apt-get install …

1 Like

Doing AM demodulation is not as easy as it seems - when you do the decimation, you need to have carefully designed low pass filters to prevent Anti aliasing from polluting the results. The liquid-dsp function has the filters built in.

The LimeSuite has the functions to control the LimeSDR for getting the I/O data - not much more.

If you look at the lime include files - they appear to the have the information required to directly control the board and many other things. You may need to program the board to get what you need.

gnuradio uses LimeSuite - so you only get what LimeSuite provides for board control, but it also has many dsp functions built in - so doing demodulation and many other things is possible.

The liquid dsp is a separate stand alone library that you download from his website and built. It has the decimation, mixing, demodulation and 100s of kinds of other dsp functions.

@RightHalfPlane Now I see, but one thing still isnt clear for me. You mention that LimeSuite is only for receiving the I/O data and I can perform demodulation using the DSP libraries. But once you type in the center frequency on LimeSuite, it automatically mixes the signal with a sinusoidal at the center frequency that has a phase relative to the incoming signal. What I’m saying is that the phase problem would always persist no matter what DSP library I would use to process the I/O. One thing I could do is to directly sample the received signal without mixing it if the center freq is below the maximum sample rate of the ADC but again, I do not see any option for this with the API. What do you suggest?

Thanks a lot for the replies again.

I have never needed to worry about the phase - for normal signals that become audio the phase is unimportant. An article on the MRI says - “A traditional MRI receiver configuration has a low-noise amplifier (LNA) followed by a mixer.” - so there must be a standard way around the problem. That description pretty much fits the LimeSDR.

@RightHalfPlane hmmm I see, I guess I need to do more research about lms7002 internals. Thanks again for fast replies, you the best!

You don’t normally do the demodulation in this case at baseband (on the center frequency of the ADC mixer). For example, if your signal is at 120 kHz, you would tune to a frequency close enough to fit the whole signal in the real part, say 100 kHz, and then shift the samples in software to baseband to do the demodulation. GNU radio has the rotator function for this purpose for example.

As to the latency problem, there is no way to avoid the USB bus latency for time critical applications, so you either need to use something like timestamps generated from the FPGA and count samples, or just do the time critical part in the FPGA itself.

@adim I see what you mean, you are saying that I should shift the signal to an intermediate frequency, sample it there and then do all the other stuff in software. My question is, wouldn’t an out of phase intermediate frequency shift also corrupt the signal and result in disproportionate I and Q values?

You might deal with the normal I/Q imbalances inherent to the system and maybe secondary mixing products if your signal is very strong, but you will not be interfered by the mixer LO as it would happen if you tuned the signal exactly on baseband. During the frequency translation you apply a filter around the wanted signal which removes the LO interference. This assumes of course that your signal is narrow enough to fit in half the ADC sample rate.

@adim So you’re saying that the problem I mentioned would not happen at intermediate frequency. That’s interesting. I couldn’t get my head around the theory of why this happens but surely I will try what you said. Also one last quick question: the signal I will be using will have center frequency of 64MHz so it can probably directly be sampled without any LO. Do you know how I can to this on lime? I thought about putting 0 as the center frequency but it surely would not allow me to do so since it is below the minimum freq.