clean test for s-param conversion for complex char impedance for power-waves definition
@@ -230,9 +230,10 @@ class NetworkTestCase(unittest.TestCase):
npy.testing.assert_allclose(rf.t2s(rf.s2t(ntwk.s)), ntwk.s)
npy.testing.assert_allclose(rf.t2s(rf.s2t(self.Fix.s)), self.Fix.s)
- def test_conversion_complex_char_impedance(self):
- # Example based on scikit-rf issue #313
- # Renormalize a 2-port network wrt a complex characteristic impedance
+ def test_sparam_conversion_with_complex_char_impedance(self):
+ # Example based on scikit-rf issue #313:
+ # Renormalize a 2-port network wrt a complex characteristic impedances
+ # using power-waves definition of s-param
f0 = rf.Frequency(75.8, npoints=1, unit='GHz')
S0 = npy.array([
[-0.194 - 0.228j, -0.721 + 0.160j],
@@ -240,20 +241,18 @@ class NetworkTestCase(unittest.TestCase):
])
ntw = rf.Network(frequency=f0, s=S0, z0=50, name='dut')
- # complex characteristic impedance to renormalize to on port 2
+ # complex characteristic impedance to renormalize to
zdut = 100 + 10j
- # 1: 50, 2: zdut
- # reference solution from ANSYS Circuit
+ # reference solutions obtained from ANSYS Circuit or ADS (same res)
+ # case 1: z0=[50, zdut]
s_ref = npy.array([[
[-0.01629813-0.29764199j, -0.6726785 +0.24747539j],
[-0.6726785 +0.24747539j, -0.30104687-0.10693578j]]])
npy.testing.assert_allclose(rf.z2s(ntw.z, z0=[50, zdut]), s_ref)
npy.testing.assert_allclose(rf.renormalize_s(ntw.s, [50,50], [50,zdut]), s_ref)
-
- # 1: zdut, 2: zdut
- # reference solution from ANSYS Circuit
+ # case 2: z0=[zdut, zdut]
s_ref = npy.array([[
[-0.402829859501534 - 0.165007172677339j,-0.586542065592524 + 0.336098534178339j],
[-0.586542065592524 + 0.336098534178339j,-0.164707376748782 - 0.21617153431756j]]])
