Vector Network Analyzer

using these commands.
‘python r75’
‘python r75 plot’

is there any reason to use a noise source and the SNA scripts over the VNA scripts?

Calibration shorts are shorted within the plug and using a piece of coax with a short at the end is not going to be the same. It may measure 0 ohms at DC, but this doesn’t mean it will be any good for calibration.

1 Like

I think in the examples “docs” pdf they say to use a load and not short.
We should be able to use an Open and Load to do vna and sna

This is an example of what you need.


1 Like

GUI Please…

1 Like

I made a SNA code with html/javascript GUI, check out if you interested:


That looks fantastic, @nepe! Could you drop me a line on I’d love to ask you a few questions about it with a view to highlighting the project on Lime Micro’s Community hub.

That looks great!!!

Another test, sweep time was 73sec.

1 Like

Great work Nepe!
Can you add SWR markings?
Can you add progress bar, so we know when the sweep has finished?
Thanks for the effort!
Best Regards,

Yes, i can add a SWR measurement mode maybe in next week. Currently working on increasing the sample rate to reduce the sweep time.
The orange line shows the sweep position. See the screenshot above.

1 Like

Dear Nepe,
The orange line jumps around the screen all the time and i am not quite sure when to stop the measurement when i am calibrating with the short standard.
It will be nice if it is possible to have a “single sweep” option, so the software will do a single sweep for calibration and then stop.
Thanks again for the great work!

1 Like

Today i pushed a new version to the GitHub. Added sample rate selection, more visible sweep cursor, SWR display mode, sweep time improvements, modular sweeper, and bug fixes.

With 20MS/s 500KHz resolution(steps=40) a 100MHz sweep only takes about 6sec. I also tried a multi tone measurement method(, with the same settings the sweep time is halved but its highly reduced dynamic range so no ui options added for this right now.


Hi @dgrujic,

I just started to experiment with the SNA code (I noted it is quite different from the VNA code, a lot “simpler” I guess …) and I’m getting a bunch of error messages, some like the previous post and some additional ones:

e[1me[31m[ERROR] Tx Calibration: MCU error 5 (Loopback signal weak: not connected/insufficient gain?)e[0m

Do you think I can safely ignore all of these?

Also, could you please shed some light on how this code works? Since each entry of the spectrum is taken directly from a Fourier transform of the measured signal I assume the code sends out pulses centered on the respective frequencies?

My measured signals also have some oscillations with a period comparable to the sampleRate (expected, I guess) - so there should be some frequential averaging or similar to smooth these out, right?

Finally, regarding the values of rxGain and txGain:
I am using the function to measure |S21(f)|, e.g. to characterize a wireless channel rather than a DUT so I fix the gain to be the same for all frequencies and don’t do any calibration (I don’t care about offsets etc if they are the same in repeated measurements). What are the highest possible values for rxGain and txGain? Since free space propagation is very lossy, I think I’d better take the largest possible gain values in my case, right?

Hello, nepe, and thanks for your work. I’ve tried to launch your VNA, but got error:

sdr@sdr:~/Desktop/limeSNA-master$ sudo python3
Exception in thread Thread-1:
Traceback (most recent call last):
File “/usr/lib/python3.6/”, line 916, in _bootstrap_inner
File “/usr/lib/python3.6/”, line 864, in run
self._target(*self._args, **self._kwargs)
File “”, line 75, in snaThread
radio = pyLMS7002Soapy(1)
NameError: name ‘pyLMS7002Soapy’ is not defined

Original pyLMS7002Soapy examples works great with my pi mini, ive installed and tested all dependencies of your limeSNA - all of them importing successfully. I’m not a pro linux user, so i cant debug where is a problem, and will accept any help :slight_smile:

You are running it with python3.6, my SNA code is only working with python 2.7. I looked at the pyLMS7002Soapy github page, it looks like they updated it to python 3. Install python 2.7, install this version of the pyLMS7002Soapy lib that is for python 2.7:

If i have some time i will update the code to support python 3.

Thank You. I’ve reinstalled it and now its fine. But I have few questions.

  1. I have a same calibration error as [Time2Lime]. Is it matters for your code?
  2. Orange sweep line doesn’t work for me as it expected. Sometimes i have 2-3 normal sweeps and than line stops and full graph refreshes randomly, or it can just freeze. When it freezes i need to click any buttons on interface and it refresh some tomes more. (measurements in terminal works all time and my pc ispretty fast)
  3. When i short DUT output to run calibration sweep i have graph like on figure 1. But with original pyLMS7002Soapy works fine.
  4. Tell me, am i right on my measurements?
  • start
    -set freq. range and step.
  • put short plug to the coupler DUT output.
  • press start to sweep few times.
  • put antenna to the coupler DUT output.
  • press set relative button
  • press Run to sweep new charts with calibrated SWR.
    Am i right or maybe missing something?

Here is my config, btw.


Maybe try different browser?

Look at the y axes, the error is negligible. It looks big because of the graph auto scaling. The dips caused by the bandwidth of the radio at the edges of the band (20MHz in this case).

No, the correct procedure is:

  • start
    -set freq. range and step.
  • put short plug to the coupler DUT output.
  • press start to sweep few times.
  • press set relative button
  • put antenna to the coupler DUT output.

Nah, i’ve tried Vivaldi and Chrome, its same. Refreshes a full graph in one moment and randomly. Sooome times i see rinning orange line, but it can stop any place.
Any ideas where i need to dig?

You can try to slow down the sweep by changing
line 74
targetTime = int( + 1e6)
targetTime = int( + 10e6)

Dose this solves your problem?