Yes, need manually (this measures semi automatic) select range for good see both resonances on screen (on calculation i search resonances/phase shifts on current measured data), i use bilinear interpolation for get data between poins so bigger points count reduce errors (also selecting good range allow get more closest results)
Also better select bigger avg settings (Display->AVG = 10 for example)
w2aew made video:
How i made calculations:
I search Max linear value in S21 (k = |S21| at this point) value and get Fs frequency
k - linear value (not in dB, for dB value Rs = 2*Rl * (10^((S21 in dB)/20) - 1)
Rs = 2*Rl * (1/k - 1)
Reff = 2*Rl + Rs
Next i search pase shift -45 degree and get frequency f2 and pase shift +45 degree and get f1
After i correct measured Fs frequency by made geometry average
Fs =sqrtf(f2*f1)
dF = f2 - f1
Ls = Reff / (2 * Pi * dF)
Cs = dF / (2 * Pi * Fs * Fs * Reff)
Q = 2 * pi * Fs * Ls / Rs not remember why, need search (look like Need use Reff? not Rs, in this case Q = Fs / dF)
After i search min linear value in S21 and get Fp frequency
Cp = (C0 + Cstray)
There C0 is the holder capacitance, Cstray - shunting capacitance of the test fixture
Cp = Cs * Fs / (2*(Fp - Fs))
PS SHUNT LC measure allow measure XTAL connected as shunt, need also manually select range for see peak (this measure critical to good calibration)
![NanoVNA Custom Software 1360808-0](https://www.eevblog.com/forum/index.php?action=dlattach;topic=200196.0;attach=1360811;image)
PS need rename Rs to Rm, Ls to Lm and Cs to Cm
PS you store calibration in 0 slot (better use DONE in RAM for temporary calibrations, calibration reset after power off, if you change range calibration data interpolated), this slot loaded on startup and apply to sended to CPU data. After all experiments better clear all calibrations by CONFIG->EXPERT SETTINGS->CLEAR CONFIG. This reset device to default state.
I made this (apply internal calibration on sended to CPU data) as option on next.