Author Topic: NanoVNA Custom Software  (Read 524758 times)

0 Members and 2 Guests are viewing this topic.

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #300 on: September 12, 2019, 03:03:43 am »
The frequency spacing determines how long the time domain trace is.  The Nyquist frequency determines the sampling.  If you sweep to 900 MHz at 1 MHz spacing you have data for 1 microsecond.  If you pad the end of the frequency series to raise Nyquist to 2 GHz you will have 250 ps sampling.

Doing an FFT from time to frequency, padding with zeros and inverse transforming is the standard way to resample data to finer sampling rates.  There are other ways of doing it, but the FFT is the fastest.

.......

Have Fun!
Reg

I need to say, I owe you a big thanks for posting this little bread crumb.  This technique was shown in those last couple of plots.  I added it to my Nano program as well and tried it out with hardware.  The is a really nice improvement.  Google came through with the linked article.   
     
https://dspguru.com/dsp/howtos/how-to-interpolate-in-time-domain-by-zero-padding-in-frequency-domain/

Offline rhb

  • Super Contributor
  • ***
  • Posts: 3490
  • Country: us
Re: NanoVNA Custom Software
« Reply #301 on: September 12, 2019, 03:07:43 am »
The key to high quality scientific software is identifying cases for which a precise analytic answer is available.  Actually doing that can be staggeringly difficult.

I have spent many days wracking my brain looking for even one.  And I can think of many cases where none is known.  Wave propagation in anisotropic media is staggeringly difficult to verify correctness.

If you cannot solve the analytic equation, why should you trust the numerical solution?  This problem dominated my career in the oil industry.  Once in a great while you wake up in the morning and realize that there is a problem with a known answer that you can use to test a numerical simulation.  But such mornings are depressingly rare.  This is very seriously difficult.  A complete novice can pose a test case that an expert with many years of experience never thought of.

If you're trying to validate the results from a program on which a $100 million decision is going to be made it will drive you crazy.

Reg

BTW Joe,  that was a very basic breadcrumb.  I had the good fortune to be abused by several old men into learning it ;-)
 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3825
  • Country: ua
Re: NanoVNA Custom Software
« Reply #302 on: September 12, 2019, 03:37:34 am »
pad to ifft to lp to plot

I know that, but my question is what you're doing with data after IFFT?

This is just a sum of real and imaginary part?
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #303 on: September 12, 2019, 03:53:04 am »
I have no problem with it being basic for you.  Its still a very nice bit of information, at least for me.  So a big thanks for that one.    The only down side is that I didn't have it implement it before making any videos.     

Test jig for trying out some of these bones you're tossing out.

***
Resolution should be sub 0.001". 
« Last Edit: September 12, 2019, 11:24:40 am by joeqsmith »
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #304 on: September 12, 2019, 03:55:00 am »
pad to ifft to lp to plot

I know that, but my question is what you're doing with data after IFFT?

This is just a sum of real and imaginary part?

Note, it's backwards from what you had posted.    After LP, I just plot it.   

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3825
  • Country: ua
Re: NanoVNA Custom Software
« Reply #305 on: September 12, 2019, 07:19:02 am »
After LP, I just plot it.   

Could you please share S1P file for this screenshot?

Or just another S1P and screenshot with TDR impedance for this S1P...

For step, its the integral.  Found most of this in HP app notes.  Still could be wrong.
what HP app note exactly you're talking about?
« Last Edit: September 12, 2019, 07:22:08 am by radiolistener »
 

Offline in3otd

  • Contributor
  • Posts: 19
  • Country: it
Re: NanoVNA Custom Software
« Reply #306 on: September 12, 2019, 07:28:38 am »
I know that, but my question is what you're doing with data after IFFT?
This is just a sum of real and imaginary part?

After the IFFT you should have a purely real response, i.e. the imaginary part should be zero - so you will need to plot just the real part.
Your frequency-domain data (S-parameters) are complex data and when you do an IFFT on them you need to input also the negative frequencies part, as the complex conjugate of the positive frequency data you have, so that the IFFT results will be real.
 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3825
  • Country: ua
Re: NanoVNA Custom Software
« Reply #307 on: September 12, 2019, 09:06:33 am »
After the IFFT you should have a purely real response, i.e. the imaginary part should be zero - so you will need to plot just the real part.

Both input and output of FFT or IFFT are complex.

Your frequency-domain data (S-parameters) are complex data and when you do an IFFT on them you need to input also the negative frequencies part, as the complex conjugate of the positive frequency data you have, so that the IFFT results will be real.

The input (S-parameters) are complex, so the information about negative frequency is already present. And the output of IFFT is complex value with real and imaginary part.

Here is example of IFFT output for S1P that I shared here (LMR195-RG31605-LMR195-RG58-LOAD.s1p). This is measurement of three different piece of coax cable connected together through adapters and terminated with 50 Ohm at the end of transmission line.
« Last Edit: September 12, 2019, 09:10:32 am by radiolistener »
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #308 on: September 12, 2019, 11:52:22 am »
After LP, I just plot it.   

Could you please share S1P file for this screenshot?

Or just another S1P and screenshot with TDR impedance for this S1P...

For step, its the integral.  Found most of this in HP app notes.  Still could be wrong.
what HP app note exactly you're talking about?

See attached

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #309 on: September 12, 2019, 12:16:54 pm »
You may find this app note of interest as well. 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3825
  • Country: ua
Re: NanoVNA Custom Software
« Reply #310 on: September 12, 2019, 12:26:51 pm »
See attached

Thanks, but I'm failed to get the same result, I cannot get such picture like your from this s1p  ???

Could you please show also picture with IFFT result (before LPF and other processing) for this s1p file?  Just a plot of real and imaginary parts...

Also what is units along X axis on your picture? If these are nanoseconds, it seems that they are multiplied by two for some reason.

I see that the pulses in provided S1P file are located at 13.762 ns and 18.679 ns. Isn't it?
« Last Edit: September 12, 2019, 12:34:11 pm by radiolistener »
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #311 on: September 12, 2019, 04:41:41 pm »
There are many possible reasons for this.  There could be bugs on both sides and miscommunications on both sides....   Certainly what I am showing shouldn't be considered a gold standard.   We almost need someone with a known working setup to provide some test cases that people could then use to validate their math. 

The Touchstone file I provided was from the current setup which is different from the previous plots.  There is a phase trimmer between the Beatty standard and the Nano.  The Beatty standard was terminated to 50 ohms.   I assumed you just wanted to see the 50-25-50 ohm transitions which this file would have, assuming there isn't a bug.   

On previous plots, the X-axis is in samples or inches.  I'm not sure where the phase was set for the file I sent but is is not so long as to be outside of the window.  The Beatty is about 22ish inches of 25 ohm. 

Offline rhb

  • Super Contributor
  • ***
  • Posts: 3490
  • Country: us
Re: NanoVNA Custom Software
« Reply #312 on: September 12, 2019, 06:03:10 pm »
Real to complex and complex to real in place FFTs are very popular because the negative frequencies are the complex conjugate of the positive frequencies.  Back when  room size computer had 4 MB of memory and multiple users, these were essential to seismic processing.  But there are lots of FFTs which do *not* fill in the complex conjugate part.  So it matters what algorithm you use.

I'll post TDR to 20 GHz BW using an 11801 & SD-24 later.  Setup will be SMA-M to BNC-F cable open, same with Chinese 50 ohm BNC-M terminator, then SMA-F to BNC-F cable  to BNC-M to SMA-M cable to SMA-F to N-F adapter and Anritsu 50 ohm N-M calibrator load.  The cables are very high quality made for me by a friend.  So it will be a canonical test case.  I can also sweep them to 3 GHz on an 8560A w/ TG option in addition to my nanoVNA results.

The SMA to BNC cables are about 10-12" so it gives good separation in the time domain.

For testing software,  multiply a complex series with a real part of 1.0 and an imaginary part of 0.0 by exp(j*2*pi*f*t) for t equal to 1/2 the reciprocal of the frequency spacing.  Do this with the DC part [0,0]  and with the DC part [1.0,0].  In both cases you should get a spike in the middle of the TDR trace.  Without the DC, the base of the spike will be offset from zero.

Another canonical test is a cosine in frequency.  That will be a pure real spike in time.  A sine wave will be a pure imaginary spike in time.

I've got some headaches to take care of, so it might be a day or two before I have time to do the physical tests.

Attached below are a few pages from Bracewell with pictures of important transforms in both domains.  Most of these are excellent test cases as both domains are obvious.  Some are more complex, but I thought I'd leave them.

What matters are impulse, sine, cosine, "boxcar" (sinc) and some of the variations.
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #313 on: September 12, 2019, 06:30:16 pm »
Ran a quick check to try out the stage with the added math.   showing 0.1" increments and a total travel of 2.0".   It may be basic but it sure is impressive. 

Offline jluu

  • Newbie
  • Posts: 3
  • Country: fr
Re: NanoVNA Custom Software
« Reply #314 on: September 12, 2019, 11:27:01 pm »
 

Offline jluu

  • Newbie
  • Posts: 3
  • Country: fr
 

Offline rhb

  • Super Contributor
  • ***
  • Posts: 3490
  • Country: us
Re: NanoVNA Custom Software
« Reply #316 on: September 13, 2019, 01:43:16 am »
Ran a quick check to try out the stage with the added math.   showing 0.1" increments and a total travel of 2.0".   It may be basic but it sure is impressive.

Very nice.  That's the way to do it.  I'm planning on making  a picosecond level stage once I get all my machine tools set up for such work.  Rather fiddly if you want a clean response.
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #317 on: September 13, 2019, 03:06:59 am »
I'm not too concerned with the absolute numbers.  40 steps, 0.050" per step.  The top is showing the histogram.   It moves around a bit too much but certainly proves the concept.   

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3825
  • Country: ua
Re: NanoVNA Custom Software
« Reply #318 on: September 13, 2019, 10:01:53 am »
joeqsmith, it's better to use nanoseconds. It doesn't depends on cable type :)
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #319 on: September 13, 2019, 11:57:07 am »
joeqsmith, it's better to use nanoseconds. It doesn't depends on cable type :)
No doubt people have their opinions.       

Currently my software supports metric, English, time and samples for the graphing units.  Most likely it will include phase as well.  Much like the filter settings,  the units are hard coded and changed depending on the test I am running.  In this case, I am working with a stage where I am dealing with distance.  Being from the USA where we can't seem to make the leap to metric, I normally work in English.     

If I had a desire to make the software public, it would include a way to change the units and also store the default settings.  At the present time, I'm more interested in experimenting with the Nano than making polished bit of software for public use.   The software evolves as my requirements change.

That said, the time/distance will have the same profiles.  No matter what units you like, the error is still the same.

Offline jMachina

  • Newbie
  • Posts: 2
  • Country: us
Re: NanoVNA Custom Software
« Reply #320 on: September 13, 2019, 07:20:57 pm »
I know this thread is for complaining about not getting free software when there is free software and complaining about not having your questions answered even though they are answered  :-DD, I thought I'd add this interesting write-up that takes pains to explain some of the math that I found to be a useful refresher.

https://mightydevices.com/index.php/2019/08/complex-impedance-matching-using-scalar-measurements-math-and-resistors/

I have ordered both the least expensive and most expensive nanoVNA clones on Amazon and will post some photos of the PCBs, etc. at a later date.

Thank you Joe for your videos, I am watching my way through all of them and learning a lot!

- Joshua
 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #321 on: September 14, 2019, 03:52:54 am »
I know this thread is for complaining about not getting free software when there is free software and complaining about not having your questions answered even though they are answered  :-DD,
....
It does seem like this from time to time.   


I thought I'd add this interesting write-up that takes pains to explain some of the math that I found to be a useful refresher.

https://mightydevices.com/index.php/2019/08/complex-impedance-matching-using-scalar-measurements-math-and-resistors/

I have ordered both the least expensive and most expensive nanoVNA clones on Amazon and will post some photos of the PCBs, etc. at a later date.

Thank you Joe for your videos, I am watching my way through all of them and learning a lot!

- Joshua

You are very welcome.  I'm glad to hear a few people have found them helpful.

I still only have the one Nano.  If they produce the gen 2 unit that's been mentioned, I may pick one up to help quench my thirst. 

Looking at the error, I discovered a major problem (race condition) with my software design that I have now corrected.  This could cause the data to be corrupt.  Sadly, it didn't help with the error.  What's interesting is plotting the change in distance during the test, we get this sort of U shape.  This is reproducible. 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #322 on: September 14, 2019, 03:56:46 am »
Using the same setup but not moving the stage, the signal is very stable.   I suspect the home made phase trimmer is the cause of the majority of my problems.   

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #323 on: September 14, 2019, 04:24:13 am »
Replacing the home made trimmer with a commercial one made by Sage and manually adjusting it. 

Offline joeqsmithTopic starter

  • Super Contributor
  • ***
  • Posts: 11715
  • Country: us
Re: NanoVNA Custom Software
« Reply #324 on: September 14, 2019, 04:42:46 am »
Going back to the home made phase trimmer with the Beatty cable I show with the Sage, and using roughly the same step size.   


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf