Author Topic: I need a low cost VNA  (Read 4376 times)

0 Members and 1 Guest are viewing this topic.

Offline mark03

  • Frequent Contributor
  • **
  • Posts: 614
  • Country: us
Re: I need a low cost VNA
« Reply #50 on: October 15, 2019, 02:31:33 pm »
python is a .... bad :) it's better to use C for firmware and C# for PC GUI.
I don't think he was talking about the firmware (or the GUI) of the VNA itself, but rather how to interface with it.  VISA is a monstrosity which is 10^X times larger than anyone can possibly justify (X >= 2).  Python, by comparison, is a pure joy to use.  Take a look at this: http://hforsten.com/trl-measurements-with-homemade-vna-and-open-source-software.html and ask yourself how long it would take in C/C#, Labview, etc. to do the same analysis.  I have an old GPIB-connected VNA but I am happy to be able to use it directly in Python with a vxi11 interface layer, without needing any of that VISA crud.
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 1061
  • Country: ua
Re: I need a low cost VNA
« Reply #51 on: October 15, 2019, 03:03:24 pm »
VISA is a monstrosity which is 10^X times larger than anyone can possibly justify (X >= 2).  Python, by comparison, is a pure joy to use.  Take a look at this: http://hforsten.com/trl-measurements-with-homemade-vna-and-open-source-software.html and ask yourself how long it would take in C/C#, Labview, etc.

It will take much less time in C/C#, but there is no SKRF library in C/C#. The only pros of python and con of C/C# is that python has SKRF library. That's it. Without SKRF, python has only cons.

Just try to install python on windows xp and try to read SKRF code, you will understand why python is bad. :)
« Last Edit: October 15, 2019, 03:16:50 pm by radiolistener »
 

Offline mark03

  • Frequent Contributor
  • **
  • Posts: 614
  • Country: us
Re: I need a low cost VNA
« Reply #52 on: October 15, 2019, 06:32:06 pm »
VISA is a monstrosity which is 10^X times larger than anyone can possibly justify (X >= 2).  Python, by comparison, is a pure joy to use.  Take a look at this: http://hforsten.com/trl-measurements-with-homemade-vna-and-open-source-software.html and ask yourself how long it would take in C/C#, Labview, etc.

It will take much less time in C/C#, but there is no SKRF library in C/C#. The only pros of python and con of C/C# is that python has SKRF library. That's it. Without SKRF, python has only cons.

Just try to install python on windows xp and try to read SKRF code, you will understand why python is bad. :)

That is hard core.  Well, clearly there is no accounting for taste :)   (but why are you still using XP? :o)
 

Offline hendorog

  • Super Contributor
  • ***
  • Posts: 1479
  • Country: nz
Re: I need a low cost VNA
« Reply #53 on: October 15, 2019, 07:00:51 pm »
VISA is a monstrosity which is 10^X times larger than anyone can possibly justify (X >= 2).  Python, by comparison, is a pure joy to use.  Take a look at this: http://hforsten.com/trl-measurements-with-homemade-vna-and-open-source-software.html and ask yourself how long it would take in C/C#, Labview, etc.

It will take much less time in C/C#, but there is no SKRF library in C/C#. The only pros of python and con of C/C# is that python has SKRF library. That's it. Without SKRF, python has only cons.

Just try to install python on windows xp and try to read SKRF code, you will understand why python is bad. :)

Bloody-mindedness over languages is a pointless exercise. There is nothing inherently wrong with python. It's just different, and has different strengths and weaknesses. Anything new takes time to learn.

You are right about scikit-rf though. It has all of the VNA stuff you ever need built in. Writing a 'VNA' in python becomes a 5 minute job with only a few lines of code.

I had never programmed in python before writing scikit-rf code, and have no particular attachment to it, but to me that is an absolutely massive advantage, and well worth taking.

As an aside, there are people out there writing alternative VNA software for the nanovna, _in python_, who are not using scikit-rf. It takes them days/weeks to do what can be done in minutes. Reinventing the wheel is still a thing :-//


 

Offline virtualparticles

  • Contributor
  • Posts: 34
  • Country: us
Re: I need a low cost VNA
« Reply #54 on: October 15, 2019, 08:32:11 pm »
They tend to last a really long time and people won't give them up.  ;D
 

Offline virtualparticles

  • Contributor
  • Posts: 34
  • Country: us
Re: I need a low cost VNA
« Reply #55 on: October 15, 2019, 08:37:35 pm »
I haven't seen any used CMT VNAs. There are occasional refurbished demo units available on the website from time to time though.
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 1061
  • Country: ua
Re: I need a low cost VNA
« Reply #56 on: October 16, 2019, 05:26:47 am »
You are right about scikit-rf though. It has all of the VNA stuff you ever need built in. Writing a 'VNA' in python becomes a 5 minute job with only a few lines of code.

that's not pros of python. That's pros of scikit-rf library. The main con of scikit-rf is that it is written in python. If it were written in C or C#, it will be much more powerful and more transparent.

I tried to port code from python and can say, python is very confusing language, it is not transparent and not intuitive. Often it hides logic and you may think that it works in such way, but it works in different way. That's the problem.

The main issue with python is a lack of good code readability. You may think that python is easy. But that's not the case. Just try to port some complex python library code (for example scikit-rf) to another language and you will find a lot of pitfalls with python.

Writing a 'VNA' in python becomes a 5 minute job with only a few lines of code.

and this python-VNA will works incorrectly. That's the main problem of these "simple VNA/TDR in python" articles spreaded over internet. You can easily check this with matlab.

The problem here is not with python itself. The problem here with a lack of understanding what is going on under the hood. But python make this problem more worse, due to a lack of code readability.
« Last Edit: October 16, 2019, 05:48:49 am by radiolistener »
 

Offline hendorog

  • Super Contributor
  • ***
  • Posts: 1479
  • Country: nz
Re: I need a low cost VNA
« Reply #57 on: October 16, 2019, 05:52:23 am »
You are right about scikit-rf though. It has all of the VNA stuff you ever need built in. Writing a 'VNA' in python becomes a 5 minute job with only a few lines of code.

that's not pros of python. That's pros of scikit-rf library. The main con of scikit-rf is that it is written in python. If it were written in C or C#, it will be much more powerful and more transparent.

I tried to port code from python and can say, python is very confusing language, it is not transparent and not intuitive. Often it hides logic and you may think that it works in such way, but it works in different way. That's the problem.

Well scikit-rf is only available in python. So it kinda is a pro of python in reality. I'm not convinced that changing the language would make it more awesome, but it's open source, so go for it.

But I was not advocating python. I just found it wasn't that hard to pick up enough of it, such that I could use scikit-rf. I don't agree that it is super complex compared to anything else around. I have remembered though that I have used python a couple of times in the past.

It is probably just that it is very different to what you are used to and so you have a learning curve. You think it works in a certain way based on what you know. Such is life in software. It keeps us humble.

Also, IIRC from a while back, you were trying to understand the workings of the library. In my experience, delving into mature libraries is generally quite hard.
Triply so when you don't know the language well. Better to start with just using the library and work your way from there.

I mean even scientists and engineers are starting to use python, and they know nothing about programming. All they care about is getting a result. So it can't be that hard.

All languages piss me off, so to me it is basically irrelevant :)
 

Offline hendorog

  • Super Contributor
  • ***
  • Posts: 1479
  • Country: nz
Re: I need a low cost VNA
« Reply #58 on: October 16, 2019, 06:01:15 am »

Writing a 'VNA' in python becomes a 5 minute job with only a few lines of code.

and this python-VNA will works incorrectly. That's the main problem of these "simple VNA/TDR in python" articles spreaded over internet. You can easily check this with matlab.


Bollocks. I found a bug in the nanovna-saver C# application that nobody else had noticed, using a 5 minute python scikit-rf calibration test.

The fact is, you can check it in many different ways. Nothing is bug free, but I think scikit-rf works pretty well.
Have you found any bugs in it? Serious question, I haven't used it that much but haven't had any reason to fault it so far.
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 1061
  • Country: ua
Re: I need a low cost VNA
« Reply #59 on: October 16, 2019, 06:15:59 am »
It is probably just that it is very different to what you are used to and so you have a learning curve. You think it works in a certain way based on what you know. Such is life in software. It keeps us humble.

yes, I know that. Previously I learned different languages, such as C, C++, C+, Java, SQL, R, JS, etc... And this is why I said that python is confusing and not intuitive. It's my opinion.

Also, IIRC from a while back, you were trying to understand the workings of the library. In my experience, delving into mature libraries is generally quite hard.
Triply so when you don't know the language well. Better to start with just using the library and work your way from there.

no, it depends on the language. I have experience with porting different math libraries from languages which I never heard before. And it's not so hard when a language is transparent and clean. This is not the case with python.

I mean even scientists and engineers are starting to use python, and they know nothing about programming. All they care about is getting a result. So it can't be that hard.

That's just marketing and hype. Many people use what marketing imposes on them. Nothing else. I already seen such things with javascript. This is just yet another hype temporary language for newbies :)

The same thing happens with NanoVNA. I see there are a lot of hype about it. There is definitely some "big player" support for this hype. I don't know what is the reason. But this device is really cool, despite on it's limitations :)

But again. Just try to install python environment on windows xp and you will have problems.
« Last Edit: October 16, 2019, 06:26:49 am by radiolistener »
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 1061
  • Country: ua
Re: I need a low cost VNA
« Reply #60 on: October 16, 2019, 06:30:35 am »
Nothing is bug free, but I think scikit-rf works pretty well.
Have you found any bugs in it? Serious question, I haven't used it that much but haven't had any reason to fault it so far.

scikit-rf is really cool library for RF math. But this is just because it is written by people who knows all that math for RF very well. This is not because it is written in Python. If it were written in C it will be even more popular and more easy.
 

Offline hendorog

  • Super Contributor
  • ***
  • Posts: 1479
  • Country: nz
Re: I need a low cost VNA
« Reply #61 on: October 16, 2019, 06:37:01 am »
Nothing is bug free, but I think scikit-rf works pretty well.
Have you found any bugs in it? Serious question, I haven't used it that much but haven't had any reason to fault it so far.

scikit-rf is really cool library for RF math. But this is just because it is written by people who knows all that math for RF very well. This is not because it is written in Python. If it were written in C it will be even more popular and more easy.

If it was written in C it would suck at readability due to the lack of operator overloading to support complex arithmetic and the vector/matrix stuff.
Check out the nanovna firmware. That is written in C and it is not pretty. Then compare that with scikit-rf, which has way more features, and you have a very clear winner.

 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 1061
  • Country: ua
Re: I need a low cost VNA
« Reply #62 on: October 16, 2019, 07:46:31 am »
If it was written in C it would suck at readability due to the lack of operator overloading to support complex arithmetic and the vector/matrix stuff.

C supports complex arithmetic, for example:
Code: [Select]
#include <stdio.h>
#include <complex.h>

void main()
{
    complex float a = 3 + I*5;
    complex float b = 7 + I*11;

    complex float c = (a + b) / (a - b);

    printf("real: %f\n", creal(c));
    printf("imag: %f\n", cimag(c));
}

C language has very good code readability, because it uses math-based syntax.


Check out the nanovna firmware. That is written in C and it is not pretty. Then compare that with scikit-rf, which has way more features, and you have a very clear winner.

NanoVNA is written in C, but it doesn't use proper C language and really has code style problems. As example, for some unknown reason it doesn't use complex arithmetic in C (which can get better optimizations). But this is not related with C language, you can write in poor style with any language.

The problem with C language is that it is very powerful and flexible. This is bad for novice, who don't know how to write proper and readable code. Because C allows to do something in different ways. This is language for professional programmers.

If you want to learn object oriented programming, I can suggest C#. This is most beautiful and easy programming language with a bunch of all kind of modern language features. And it uses very clean and transparent C syntax.



That's not a joke, and not marketing. If you don't think that C is easy and transparent, then it means that you're just don't know C language well :)
« Last Edit: October 16, 2019, 08:18:48 am by radiolistener »
 

Offline hendorog

  • Super Contributor
  • ***
  • Posts: 1479
  • Country: nz
Re: I need a low cost VNA
« Reply #63 on: October 16, 2019, 08:21:27 am »
Yes fair point. I was not aware that feature was in C nowadays, and presumably neither was nanovna author.


 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 1061
  • Country: ua
Re: I need a low cost VNA
« Reply #64 on: October 16, 2019, 08:27:45 am »
Yes fair point. I was not aware that feature was in C nowadays

That is not nowadays feature, it is old feature added in C99 standard. I don't think that 20 years old feature can be named "nowadays feature" :)
 

Offline hendorog

  • Super Contributor
  • ***
  • Posts: 1479
  • Country: nz
Re: I need a low cost VNA
« Reply #65 on: October 16, 2019, 08:40:48 am »
Yes fair point. I was not aware that feature was in C nowadays

That is not nowadays feature, it is old feature added in C99 standard. I don't think that 20 years old feature can be named "nowadays feature" :)

Now this is moving outside my knowledge of C compilers, which is not current in any way as you have shown. Many here are experts an I am not.

But I do know that the compiler support lags the standard by a long long way. The compilers of 2000 would not have supported the standards of 1999.

Not to mention that writing portable code used to be a goal when I was writing C code a long time ago. And that meant ignoring new features.

Things have changed, but I haven't written much C at all for well over a decade.
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 1061
  • Country: ua
Re: I need a low cost VNA
« Reply #66 on: October 16, 2019, 08:48:29 am »
Nothing is bug free, but I think scikit-rf works pretty well.

did you tried to install scikit-rf into STM32 firmware to use it in the NanoVNA?  :-//
 

Offline hendorog

  • Super Contributor
  • ***
  • Posts: 1479
  • Country: nz
Re: I need a low cost VNA
« Reply #67 on: October 16, 2019, 08:51:49 am »
Nothing is bug free, but I think scikit-rf works pretty well.

did you tried to install scikit-rf into STM32 firmware to use it in the NanoVNA?  :-//

No, I am still waiting for you to change the STM32 code to support C99 complex number math  :-//

However, I did pull data from the nano and use scikit-rf with it on the PC. Worked great.
Truth be told I am primarily interested in using the nanovna with a PC. Using that tiny UI is not something I can see myself doing very much.
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 1061
  • Country: ua
Re: I need a low cost VNA
« Reply #68 on: October 16, 2019, 08:55:57 am »
However, I did pull data from the nano and use scikit-rf with it on the PC. Worked great.
Truth be told I am primarily interested in using the nanovna with a PC. Using that tiny UI is not something I can see myself doing very much.

now try the same on PC with Window XP  :popcorn:
 

Offline hendorog

  • Super Contributor
  • ***
  • Posts: 1479
  • Country: nz
Re: I need a low cost VNA
« Reply #69 on: October 16, 2019, 09:01:09 am »
However, I did pull data from the nano and use scikit-rf with it on the PC. Worked great.
Truth be told I am primarily interested in using the nanovna with a PC. Using that tiny UI is not something I can see myself doing very much.

now try the same on PC with Window XP  :popcorn:

Windows XP - from 2001?

That's not far off  20 years old...  :popcorn:
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 1061
  • Country: ua
Re: I need a low cost VNA
« Reply #70 on: October 16, 2019, 09:05:22 am »
Windows XP - from 2001?

That's not far off  20 years old...  :popcorn:

But it works faster than novadays widnows, it can works with 1-2 GB RAM and it don't requires internet connection and installing a bunch of gigabyte updates.

For example NanoVNASharp works great under Windows XP with NanoVNA. Can you do the same with Python? Is it really so easy as you said before?  ;)
 

Offline hendorog

  • Super Contributor
  • ***
  • Posts: 1479
  • Country: nz
Re: I need a low cost VNA
« Reply #71 on: October 16, 2019, 09:19:09 am »
Windows XP - from 2001?

That's not far off  20 years old...  :popcorn:

But it works faster than novadays widnows, it can works with 1-2 GB RAM and it don't requires internet connection and installing a bunch of gigabyte updates.

For example NanoVNASharp works great under Windows XP with NanoVNA. Can you do the same with Python? Is it really so easy as you said before?  ;)

I have no idea. I dont have any XP boxes anymore. I have one rarely used window 7 box on a laptop which wont run win10 and i keep meaning to install linux on.

But I think your general point is that C# will be compatible with more windows versions than python. That is reasonable. Microsofts single greatest achievement is their backward compatibility. It is outstanding and is better than any other OS AFAIK.
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 1061
  • Country: ua
Re: I need a low cost VNA
« Reply #72 on: October 16, 2019, 09:46:14 am »
I have no idea. I dont have any XP boxes anymore.

it won't work, I tried to run it on XP with no success.

I got the following error at startup time on win xp:


The latest Python also cannot be installed on Windows XP. The very old one can run, but it's libraries are not compatible with scikit-rf. So you cannot use scikit-rf either.


I don't want to buy expensive notebook with tens gigabytes of RAM and buy internet connection for gigabyte updates just to communicate with VNA  :horse:

For comparison, NanoVNASharp works great on an old notebook running windows xp with no need for gigabytes update through internet :)

That's the real life usage  :popcorn:
« Last Edit: October 16, 2019, 09:57:17 am by radiolistener »
 

Offline hendorog

  • Super Contributor
  • ***
  • Posts: 1479
  • Country: nz
Re: I need a low cost VNA
« Reply #73 on: October 16, 2019, 05:49:45 pm »
I have no idea. I dont have any XP boxes anymore.

it won't work, I tried to run it on XP with no success.

I got the following error at startup time on win xp:
(Attachment Link)

The latest Python also cannot be installed on Windows XP. The very old one can run, but it's libraries are not compatible with scikit-rf. So you cannot use scikit-rf either.


I don't want to buy expensive notebook with tens gigabytes of RAM and buy internet connection for gigabyte updates just to communicate with VNA  :horse:

For comparison, NanoVNASharp works great on an old notebook running windows xp with no need for gigabytes update through internet :)

That's the real life usage  :popcorn:

Such is life in software. Version hell is painful. Old stuff gets discarded very quickly unless there is some commercial user who pays to keep it alive.

Of course python is cross platform so you can easily avoid Windows 10 if it gives you heartburn. But that whole thing has been beaten to death everywhere, so lets not go there.




 

Offline 5q5r

  • Contributor
  • Posts: 16
  • Country: dk
Re: I need a low cost VNA
« Reply #74 on: October 17, 2019, 08:15:41 pm »
Bollocks. I found a bug in the nanovna-saver C# application that nobody else had noticed, using a 5 minute python scikit-rf calibration test.

Which "nanovna-saver C# application": NanoVNA-Sharp, or NanoVNA-Saver (which is a Python application)?

Did you report it? I don't remember seeing a bug report from you for NanoVNA-Saver, but I do get a lot of them. ;)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf