From 23e377359468f54f24a9b46747bbe85b4656d24d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=A4berich?= Date: Sun, 25 Oct 2020 22:16:35 +0100 Subject: [PATCH] take two-way offset delay into account --- Software/PC_Application/Calibration/calkit.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Software/PC_Application/Calibration/calkit.cpp b/Software/PC_Application/Calibration/calkit.cpp index 09021c6..6f06f01 100644 --- a/Software/PC_Application/Calibration/calkit.cpp +++ b/Software/PC_Application/Calibration/calkit.cpp @@ -176,8 +176,8 @@ Calkit::SOLT Calkit::toSOLT(double frequency) ref.Open = (imp_open - complex(50.0)) / (imp_open + complex(50.0)); } // transform the delay into a phase shift for the given frequency - double open_phaseshift = -2 * M_PI * frequency * open_delay * 1e-12; - double open_att_db = open_loss * 1e9 * 4.3429 * open_delay * 1e-12 / open_Z0 * sqrt(frequency / 1e9); + double open_phaseshift = -2 * M_PI * frequency * 2 * open_delay * 1e-12; + double open_att_db = open_loss * 1e9 * 4.3429 * 2 * open_delay * 1e-12 / open_Z0 * sqrt(frequency / 1e9); double open_att = pow(10.0, -open_att_db / 10.0); auto open_correction = polar(open_att, open_phaseshift); ref.Open *= open_correction; @@ -192,8 +192,8 @@ Calkit::SOLT Calkit::toSOLT(double frequency) auto imp_short = complex(0, frequency * 2 * M_PI * Lseries); ref.Short = (imp_short - complex(50.0)) / (imp_short + complex(50.0)); // transform the delay into a phase shift for the given frequency - double short_phaseshift = -2 * M_PI * frequency * short_delay * 1e-12; - double short_att_db = short_loss * 1e9 * 4.3429 * short_delay * 1e-12 / short_Z0 * sqrt(frequency / 1e9);; + double short_phaseshift = -2 * M_PI * frequency * 2 * short_delay * 1e-12; + double short_att_db = short_loss * 1e9 * 4.3429 * 2 * short_delay * 1e-12 / short_Z0 * sqrt(frequency / 1e9);; double short_att = pow(10.0, -short_att_db / 10.0); auto short_correction = polar(short_att, short_phaseshift); ref.Short *= short_correction;