Power reflection correction in Python and C#

35 views
Skip to first unread message

sle...@gmail.com

unread,
Mar 21, 2025, 7:03:28 AMMar 21
to VNA Tools
Hi,

I wrote a power reflection correction function in Python and C#, there is a very little (E-12 or E-07) difference in the standard uncertainty of corrected power.

The input parameters of the reflection are Magnitude, Phase and they uncertainty, and converted to complex number. I did not see any difference in the covariance matrix.

Python correction code:
pdbm_corr = ufloat(pdbm, u_pdbm) + (1.0 - s_gen * s_sen).abs().log10() * 20.0

C#:
var PdBmCorr = new UncNumber(PdBm, uPdBm) + Metas.UncLib.Core.Math.Log10(Metas.UncLib.Core.Math.Abs(1.0 - Sgen * Ssen)) * 20.0;

This difference between Python and C# is feature?

Regards
László


Reply all
Reply to author
Forward
0 new messages