Here is my take (or guess if you like) how NanoVNA operates, it requires no higher education, although it helps if you know quadrature signals.
For that you may check
https://dspguru.com/files/QuadSignals.pdf (it contains a lot more than needed here but it never hurts to know more).
I re-iterate that may be know already from elsewhere:
There is a clock chip with 3 outputs that beyond clocking the ADC and MCU chips (with the same clock) outputs 2 RF signals (one for downmixing, one for reference) with a small difference between them (that falls into audio range where the ADC can operate after mixing).
One of the RF signals is used to down mix to audio band and there are 3 double balanced mixers that share the same RF signal for downmixing:
- 1 mixer for the signal that is used to feed a resistor bridge (the reference RF signal)
- 1 mixer for the middle of the bridge (that measures unbalance)
- 1 mixer for the input of the VNA (RX)
In the resistor bridge instead one of the resistors the output of the VNA connected (TX).
If the VNA output is impedance matched (meaning pure resistive 50 Ohm), there is no signal in the middle of the bridge as it's balanced.
If the output is mismatched but still pure resistive there is signal in the middle of the bridge but it's phase aligned with the reference (that is feeding the bridge).
If the output is totally mismatched (meaning also reactive component) the middle of the bridge will show a phase shifted signal.
Checking in the source dsp.c file the ADC output of the downmixed signal is correlated with sine and cosine (5 periods in 48 samples, meaning like 5kHz difference between the RF signals with 48kSa/s that is my take or 10kHz with 96kSa/s with no practical difference) both for the signal being checked and the reference. The phasor difference between them is calculated and stored in rectangular form.
This is done for all the points in the scanned frequency range and plotted in the form that is desired (starting around line 430 of plot.c).
The same phasor difference is done for the input port in case of S21 measurement.
Like
Bicurico already wrote, with S11 you can check the frequency dependent characteristic of a component (antenna included) what resistive and reactive part it has at various frequencies.
With S21 you can check what transfer characteristic of a component like filter, amplifier etc. has again at various frequencies.
In the what could be enhanced part for me the range extension occurred first. The clock chip is just 200MHz that is extended with many already documented tricks till 900 MHz but that is still not that high and due to the extension dynamic range is compromised as well...
Luckily the whole thing is open source (and very far from worthless) so anyone can enhance, correct.
Note: there are different sources, one from the original Japanese author (trftech) and then who makes this product:
https://github.com/ttrftech/NanoVNA https://github.com/hugen79/NanoVNA-H