This example demonstrates how to use skrf to renormalize a Network’s s-parameters to new port impedances. Although trivial, this example creates a matched load in 50ohms and then re-normalizes to a 25ohm environment, producing a reflection coefficient of 1/3.
Ok lets do it¶
import skrf as rf %matplotlib inline from pylab import * rf.stylely() # this is just for plotting junk kw = dict(draw_labels=True, marker = 'o', markersize = 10)
/home/docs/checkouts/readthedocs.org/user_builds/scikit-rf/conda/latest/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 return f(*args, **kwds)
Create a one-port ideal match Network, (using the premade media class wr10 as a dummy)
match_at_50 = rf.wr10.match()
Note that the z0 for this Network defaults to a constant 50ohm
1-Port Network: '', 75.0-110.0 GHz, 1001 pts, z0=[50.+0.j]
Plotting its reflection coefficient on the smith chart, shows its a match
Now, renormalize the port impedance from 50 -> 25, thus the previous 50ohm load now produces a reflection coefficient of
Plotting the renormalized response on the Smith Chart
You could also renormalize to a complex port impedance if you’re crazy
match_at_50 = rf.wr10.match() match_at_50.renormalize(50j) match_at_50.plot_s_smith(**kw)
minusj_at_50 = rf.wr10.load(-1j, z0 = 50) minusj_at_50.renormalize(20+20j) minusj_at_50.plot_s_smith(r=2,**kw)
Zl= 1j z0_imag,z0_real = mgrid[-1:1:101j,-1:1:101j] z0 = z0_real + 1j*z0_imag s = (Zl+z0)/(Zl-z0)
/home/docs/checkouts/readthedocs.org/user_builds/scikit-rf/conda/latest/lib/python3.5/site-packages/ipykernel_launcher.py:4: RuntimeWarning: divide by zero encountered in true_divide after removing the cwd from sys.path. /home/docs/checkouts/readthedocs.org/user_builds/scikit-rf/conda/latest/lib/python3.5/site-packages/ipykernel_launcher.py:4: RuntimeWarning: invalid value encountered in true_divide after removing the cwd from sys.path.