Hi
can you help please!
yesterday we were in the field for some QSOs. Even it rained, I could measure some antennas with the RP VNA. After calibration (ShortOpenLoad, SOL), I saw how excellent our 80m loop antenna was.
I save the data with the "Write .csv" key.
Today I would like to recreate the diagram. The VNA software cannot reimport the data to show them, so I imported them to EXCEL. Unfortunately, only the raw data were saved (komplex calibration data with komplex impedance values).
But what ist the mathematics behind to recalculate the VSWR from Impedance Load Short an Open values? Are the saved Impedance values already corrected by SOL ?
Dieter
VNA SWR mathematics

 Posts: 550
 Joined: Sat May 23, 2015 5:22 pm
Re: VNA SWR mathematics
Only the cfg files can be reimported. So, I'd suggest to use the 'Write cfg.' button to save the data that you want to read using the VNA client.drdieter wrote: ↑Sun Sep 02, 2018 5:31 pmI save the data with the "Write .csv" key.
Today I would like to recreate the diagram. The VNA software cannot reimport the data to show them, so I imported them to EXCEL. Unfortunately, only the raw data were saved (komplex calibration data with komplex impedance values).
Here is a link to the code that calculates the SWR values:
https://github.com/paveldemin/redpita ... #L696L713
Here are the essential expressions:
Code: Select all
z = (50.0 * (open  load) * (dut  short)) / ((load  short) * (open  dut))
gamma = (z  50.0) / (z + 50.0)
swr = (1.0 + abs(gamma)) / (1.0  abs(gamma))
The csv file contains the open, short, load and dut values that can be used to calculate the SWR values.
To calculate SWR in Excel, you'll probably need the COMPLEX, IMABS and IMDIV functions described at the following links:
https://support.office.com/enus/articl ... 9362fa4128
https://support.office.com/enus/articl ... b351d765a1
https://support.office.com/enus/articl ... ec3d74d83f
Here is how these functions can be used to convert the columns read from the csv file to the complex numbers and then to calculate z, gamma and swr:
Code: Select all
open = COMPLEX(B1,C1)
short = COMPLEX(D1,E1)
load = COMPLEX(F1,G1)
dut = COMPLEX(H1,I1)
z = IMDIV(IMPRODUCT(50.0, IMSUB(open, load), IMSUB(dut, short)), IMPRODUCT(IMSUB(load, short), IMSUB(open, dut)))
gamma = IMDIV(IMSUB(z, 50.0), IMSUM(z, 50.0))
swr = (1.0 + IMABS(gamma)) / (1.0  IMABS(gamma))
Last edited by pavel on Mon Sep 03, 2018 8:47 am, edited 1 time in total.

 Posts: 550
 Joined: Sat May 23, 2015 5:22 pm
Re: VNA SWR mathematics
Looks like it's possible to change the names of the columns in Excel:
https://support.office.com/enus/articl ... d7ff379c64
So, it would be probably easier to rename the columns with the calculated values to open, short, load, dut, z, gamma, swr. This way the formulas from my previous post can be used unchanged.
https://support.office.com/enus/articl ... d7ff379c64
So, it would be probably easier to rename the columns with the calculated values to open, short, load, dut, z, gamma, swr. This way the formulas from my previous post can be used unchanged.

 Posts: 7
 Joined: Wed Jan 10, 2018 9:42 am
Re: VNA SWR mathematics
Hi Pavel
many thanks for your answer and explanation!
I will read the links and try the given formulars.
My problem is not on the EXCEL side, I'm very familar with that including the VBA.
I already tried the complex calculation bei using the simple formular
VSWR= (Z+50)+Z50)/(Z+50Z50) which didn't show what I measured the day before.
(including negative and huge numbers)
I also will doublecheck the data import because sometimes leading zeros or decimal indentifiers are critical.
Dieter
many thanks for your answer and explanation!
I will read the links and try the given formulars.
My problem is not on the EXCEL side, I'm very familar with that including the VBA.
I already tried the complex calculation bei using the simple formular
VSWR= (Z+50)+Z50)/(Z+50Z50) which didn't show what I measured the day before.
(including negative and huge numbers)
I also will doublecheck the data import because sometimes leading zeros or decimal indentifiers are critical.
Dieter

 Posts: 550
 Joined: Sat May 23, 2015 5:22 pm
Re: VNA SWR mathematics
In the VNA code the SWR value is constrained to the range [1.0, 99.99]. Here is a link to the code (line 713 in vna.py):
https://github.com/paveldemin/redpita ... na.py#L713
in Excel, you can try to use the MEDIAN function:
Code: Select all
=MEDIAN(swr, 1.0, 99.99)

 Posts: 7
 Joined: Wed Jan 10, 2018 9:42 am
Re: VNA SWR mathematics
Success!!
Hi Pavel, that was really helpful.
many , many thanks agian. So, I can send my friends the promised charts.
Things I made wrong:
I used the DUT value als the impedance.
For others locals who may use Pavels input:
Take care to use ; instead of ,
And I had to indroduce IMsub and IMsumme and IMprodukt instead of +,,*
(I have the english function names no more in mind)
Dieter
Hi Pavel, that was really helpful.
many , many thanks agian. So, I can send my friends the promised charts.
Things I made wrong:
I used the DUT value als the impedance.
For others locals who may use Pavels input:
Take care to use ; instead of ,
And I had to indroduce IMsub and IMsumme and IMprodukt instead of +,,*
(I have the english function names no more in mind)
Dieter

 Posts: 550
 Joined: Sat May 23, 2015 5:22 pm
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie
Who is online
Users browsing this forum: No registered users and 6 guests