KX4PQ 2024/01/21 19:57

This Matlab script, VNA_2_touchstone_s2p_matlab.m takes two separate .s2p files from a NanoVNA V2 saved from within the nanovna-saver program and integrates
them into a single 2 port S-Parameter touchstone.s2p file.

The NanoVNA V2 is a single path VNA. That means it can measure S11 and S21 of a 2 port network. In order to obtain S12 and S22, the 2 port device (DUT)
must be reversed and a separate measurement obtained, these two separate measurements can then be merged to get the full set of 2 port S-Parameters.

There is also a similar Octave script, VNA_2_touchstone_s2p_octave.m that does the same thing if you don't have access to Matlab. Octave is a free, open source Matlab like program.
However, it is not 100% Matlab compatible, hence the 2 separate scripts.

*VNA_2_touchstone_s2p_octave.m*
and
*VNA_2_touchstone_s2p_matlab.m*

can both be found in the Files section.

Greg