Scikit RF PDF
Scikit RF PDF
Scikit RF PDF
scikit-rf Documentation
Release dev
Alex Arsenovic
1 Installation 3
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 skrf Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Testing Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 Introduction 7
2.1 Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3 Plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4 NetworkSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.5 Virtual Instruments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.6 Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.7 Media . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3 Networks 17
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2 Creating Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.3 Network Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.4 Network Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.5 Connecting Multi-ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.6 Interpolation and Stitching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.7 Reading and Writing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.8 Impedance and Admittance Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.9 Creating Networks ‘From Scratch’ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.10 Sub-Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.11 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4 Plotting 29
4.1 Plotting Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.2 Complex Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.3 Rectangular Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.4 Customizing Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.5 Saving Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
i
4.6 Misc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5 NetworkSet 39
5.1 Creating a NetworkSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5.2 Accesing Network Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.3 Statistical Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.4 Plotting Uncertainty Bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.5 Reading and Writing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6 Virtual Instruments 47
7 Calibration 49
7.1 Intro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
7.2 Creating a Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
7.3 Saving and Recalling a Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.4 One-Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.5 Concise One-port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
7.6 Two-port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
7.7 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
8 Media 55
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
8.2 Creating Media Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
8.3 Working with Media’s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
8.4 Network Synthesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
8.5 Building Cicuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
8.6 Design Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
8.7 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
9 Examples 63
9.1 Visualizing a Single Stub Matching Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
9.2 One-Port Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
10 Reference 69
10.1 frequency (skrf.frequency) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
10.2 network (skrf.network) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
10.3 networkSet (skrf.networkSet) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
10.4 plotting (skrf.plotting) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
10.5 mathFunctions (skrf.mathFunctions) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
10.6 tlineFunctions (skrf.tlineFunctions) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
10.7 constants (skrf.constants) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
10.8 util (skrf.util) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
10.9 io (skrf.io) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
10.10 calibration (skrf.calibration) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
10.11 media (skrf.media) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
10.12 vi (skrf.vi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
ii
scikit-rf Documentation, Release dev
These tutorials are meant to give an overview of how skrf can be used. Each page can be followed along in a browser,
or downloaded as an ipython notebook
Contents 1
scikit-rf Documentation, Release dev
2 Contents
CHAPTER 1
Installation
1.1 Introduction
The requirements to run skrf are basically a Python environment setup to do numerical/scientific computing. If you
are new to development, you may want to install a pre-built scientific python IDE like Enthought’s Canopy. This will
install most requirements, as well as provide a nice environment to get started in. If you dont want use Canopy then
see Requirements.
Note: If you want to use skrf for instrument control you will need to install pyvisa as well as the NI-GPIB drivers.
Once the requirements are installed, there are two choices for installing skrf:
• windows installer
• python source package
These can be found at http://scikit-rf.org/download.html
If you dont know how to install a python module and dont care to learn how, you want the windows installer.
The current version can be accessed through github. This is mainly of interest for developers.
If you can import skrf and dont recieve an error, then installation was succesful.
In [1]: import skrf as rf
3
scikit-rf Documentation, Release dev
<ipython-input-1-41c4ee663aa9> in <module>()
----> 1 import skrf as rf
\
ImportError: No module named skrf
Then installation was unsuccesful. If you need help post to the mailing list.
1.4 Requirements
1.4.1 Necessary
1.4.2 Optional
For debian-based linux users who dont want to install pythonxy, here is a one-shot line to install all requirements,
sudo apt-get install python-pyvisa python-numpy python-scipy python-matplotlib ipython python python-
4 Chapter 1. Installation
CHAPTER 2
Introduction
This is a brief introduction to skrf which highlights a range of features without going into detail on any single one.
At the end of each section there are links to other tutorials, that provide more information about a given feature. The
intended audience are those who have a working python stack, and are somewhat familiar with python. If you are
completely new to python, see scipy’s Getting Started
These tutorials are most easily followed by using the ipython shell with the –pylab flag,
>ipython --pylab
In [1]:
or with the ipython notebook. Using ipython with the pylab flag imports several commonly used functions, and turns
on interactive plotting mode which causes plots to display immediately.
Throughout this tutorial, and the rest of the scikit-rf documentation, it is assumed that skrf has been imported as rf.
Whether or not you follow this convention in your own code is up to you.
from pylab import *
import skrf as rf
2.1 Details
skrf has a function which updates your matplotlib rcParams so that plots appear like the ones shown in these tutorials.
#rf.stylely({’savefig.dpi’:120})
The example code in these tutorials make use of files that are distributed with the source package. The working
directory for these code snippets is scikit-rf/doc/, hence all data files are referenced relative to that directory. If you do
not have the source package, then you may access these files through the skrf.data module (ie from skrf.data import
ring_slot)
5
scikit-rf Documentation, Release dev
2.2 Networks
The Network object represents a N-port microwave Network. A Network can be created in a number of ways.
One way is from data stored in a touchstone file. Lets load one from the directory skrf/data/.
import os
touchstone_file = os.path.join(rf.data.pwd,’ring slot.s2p’)
ring_slot = rf.Network(touchstone_file)
A short description of the network will be printed out if entered onto the command line
ring_slot
2-Port Network: ’ring slot’, 75-110 GHz, 201 pts, z0=[ 50.+0.j 50.+0.j]
The basic attributes of a microwave Network are provided by the following properties
• Network.s : Scattering Parameter matrix.
• Network.z0 : Port Characterisic Impedance matrix.
• Network.frequency : Frequency Object.
All of the network parameters are complex numpy.ndarray ‘s of shape FxNxN, where F is the number of frequency
points and N is the number of ports. The Network object has numerous other properties and methods which can found
in the Network docstring. If you are using IPython, then these properties and methods can be ‘tabbed’ out on the
command line.
In [1]: short.s<TAB>
rf.data.line.s rf.data.line.s_arcl rf.data.line.s_im
rf.data.line.s11 rf.data.line.s_arcl_unwrap rf.data.line.s_mag
...
Element-wise mathematical operations on the scattering parameter matrices are accessible through overloaded opera-
tors. To illustrate their usage, load a couple Networks stored in the data module.
short = rf.data.wr2p2_short
delayshort = rf.data.wr2p2_delayshort
short - delayshort
short + delayshort
Cascading and de-embeding 2-port Networks can also be done though operators. The cascade() function can
be called through the power operator, **. To calculate a new network which is the cascaded connection of the two
individual Networks line and short,
6 Chapter 2. Introduction
scikit-rf Documentation, Release dev
short = rf.data.wr2p2_short
line = rf.data.wr2p2_line
delayshort = line ** short
De-embedding can be accomplished by cascading the inverse of a network. The inverse of a network is accessed
through the property Network.inv. To de-embed the short from delay_short,
short = line.inv ** delayshort
For more information on the functionality provided by the Network object, such as interpolation, stitching, n-port
connections, and IO support see the Networks tutorial.
2.3 Plotting
Amongst other things, the methods of the Network class provide convenient ways to plot components of the network
parameters,
• Network.plot_s_db : plot magnitude of s-parameters in log scale
• Network.plot_s_deg : plot phase of s-parameters in degrees
• Network.plot_s_smith : plot complex s-parameters on Smith Chart
• ...
To plot all four s-parameters of the ring_slot in Mag, Phase, and on the Smith Chart.
ring_slot.plot_s_db()
ring_slot.plot_s_deg()
2.3. Plotting 7
scikit-rf Documentation, Release dev
ring_slot.plot_s_smith()
For more detailed information about plotting see the Plotting tutorial
2.4 NetworkSet
The NetworkSet object represents an unordered set of networks and provides methods for calculating statistical
quantities and displaying uncertainty bounds.
A NetworkSet is created from a list or dict of Network‘s. This can be done quickly with read_all() , which
8 Chapter 2. Introduction
scikit-rf Documentation, Release dev
loads all skrf-readable objects in a directory. The argument contains is used to load only files which match a given
substring.
rf.read_all(rf.data.pwd, contains=’ro’)
{’ro,1’: 1-Port Network: ’ro,1’, 500-750 GHz, 201 pts, z0=[ 50.+0.j],
’ro,2’: 1-Port Network: ’ro,2’, 500-750 GHz, 201 pts, z0=[ 50.+0.j],
’ro,3’: 1-Port Network: ’ro,3’, 500-750 GHz, 201 pts, z0=[ 50.+0.j]}
A NetworkSet of length 3
Statistical quantities can be calculated by accessing properties of the NetworkSet. For example, to calculate the
complex average of the set, access the mean_s property
ro_ns.mean_s
1-Port Network: ’ro set’, 500-750 GHz, 201 pts, z0=[ 50.+0.j]
1-Port Network: ’ro set’, 500-750 GHz, 201 pts, z0=[ 50.+0.j]
These methods return a Network object, so the results can be saved or plotted in the same way as you would with a
Network. To plot the magnitude of the standard deviation of the set,
ro_ns.std_s.plot_s_mag()
ylabel(’Standard Deviation’)
title(’Standard Deviation of RO’);
2.4. NetworkSet 9
scikit-rf Documentation, Release dev
Uncertainty bounds on any network parameter can be plotted through the methods
figure();
ro_ns.plot_uncertainty_bounds_s_db();
10 Chapter 2. Introduction
scikit-rf Documentation, Release dev
...warning:
The vi module is not well written or tested at this point.
The vi module holds classes for GPIB/VISA instruments that are intricately related to skrf, mostly VNA’s. The VNA
classes were created for the sole purpose of retrieving data so that calibration and measurements could be carried out
offline by skrf, control of most other VNA capabilities is neglected.
• To use the virtual instrument classes you must have pyvisa installed.
A list of VNA’s that have been are partially supported.
* :class:‘~vna.HP8510C‘
* :class:‘~vna.HP8720‘
* :class:‘~vna.PNA‘
* :class:‘~vna.ZVA40‘
dut_1 = my_vna.s11
dut_2 = my_vna.s21
dut_3 = my_vna.two_port
Unfortunately, the syntax is different for every VNA class, so the above example wont directly translate to other VNA’s.
Re-writing all of the VNA classes to follow the same convention is on the [TODO list] (https://github.com/scikit-
rf/scikit-rf/blob/develop/TODO.rst)
See the virtualInstruments tutorial for more information.
2.6 Calibration
skrf has support for one and two-port calibration. skrf‘s default calibration algorithms are generic in that they will
work with any set of standards. If you supply more calibration standards than is needed, skrf will implement a simple
least-squares solution. skrf does not currently support TRL.
Calibrations are performed through a Calibration class. Creating a Calibration object requires at least two
pieces of information:
• a list of measured Network‘s
• a list of ideal Network‘s
The Network elements in each list must all be similar (same #ports, frequency info, etc) and must be aligned to each
other, meaning the first element of ideals list must correspond to the first element of measured list.
Optionally, other information can be provided when relevent such as,
• calibration algorithm
• enforce eciprocity of embedding networks
• etc
When this information is not provided skrf will determine it through inspection, or use a default value.
Below is an example script illustrating how to create a Calibration . See the Calibration tutorial for more details
and examples.
import skrf as rf
from skf.calibration import OnePort
my_ideals = rf.read_all(’ideals/’)
my_measured = rf.read_all(’measured/’)
duts = rf.read_all(’measured/’)
2.7 Media
skrf supports the microwave network synthesis based on transmission line models. Network creation is accomplished
through methods of the Media class, which represents a transmission line object for a given medium. Once constructed,
12 Chapter 2. Introduction
scikit-rf Documentation, Release dev
a Media object contains the neccesary properties such as propagation constant and characteristic impedance, that are
needed to generate microwave circuits.
The basic usage looks something like this,
freq = rf.Frequency(75,110,101,’ghz’)
cpw = rf.media.CPW(freq, w=10e-6, s=5e-6, ep_r=10.6)
cpw.line(100*1e-6, name = ’100um line’)
2-Port Network: ’100um line’, 75-110 GHz, 101 pts, z0=[ 50.06074662+0.j 50.06074662+0.j]
Warning: The network creation and connection syntax of skrf are cumbersome if you need to doing complex
circuit design. For a this type of application, you may be interested in using QUCS_ instead. skrf‘s synthesis
cabilities lend themselves more to scripted applications such as Design Optimization or batch processing.
Specific instances of Media objects can be created from relevant physical and electrical properties. Below is a list of
mediums types supported by skrf,
• CPW
• RectangularWaveguide
• Freespace
• DistributedCircuit
• Media
2-Port Network: ’line’, 75-110 GHz, 101 pts, z0=[ 50.06074662+0.j 50.06074662+0.j]
See Media for more information about the Media object and network creation.
2.7. Media 13
scikit-rf Documentation, Release dev
http://www.qucs.sourceforge.net
Introduction.ipynb
14 Chapter 2. Introduction
CHAPTER 3
Networks
#.. contents:
.. ipython::
suppress
In [144]: from pylab import *
In [145]: ion()
In [146]: rcParams[’savefig.dpi’] =120
In [147]: rcParams[’figure.figsize’] = [4,3]
In [147]: rcParams[’figure.subplot.left’] = 0.15
In [147]: clf()
3.1 Introduction
For this tutorial, and the rest of the scikit-rf documentation, it is assumed that skrf has been imported as rf. Whether
or not you follow this convention in your own code is up to you.
In [1]: import skrf as rf
If this produces an error, please see Installation. The code in this tutorial assumes that you are in the directory scikit-
rf/doc.
skrf provides an object for a N-port microwave Network. A Network can be created in a number of ways. One
way is from data stored in a touchstone file.
In [1]: ring_slot = rf.Network(’../skrf/data/ring slot.s2p’)
---------------------------------------------------------------------------
IOError Traceback (most recent call last)
<ipython-input-1-98e45ed389ab> in <module>()
----> 1 ring_slot = rf.Network(’../skrf/data/ring slot.s2p’)
15
scikit-rf Documentation, Release dev
/home/docs/checkouts/readthedocs.org/user_builds/scikit-rf/envs/new-docs/local/lib/python2.7/site-pac
408 # open file in ’binary’ mode because we are going to try and
409 # upickle it first
--> 410 fid = get_fid(file,’rb’)
411
412 try:
/home/docs/checkouts/readthedocs.org/user_builds/scikit-rf/envs/new-docs/local/lib/python2.7/site-pac
133 ’’’
134 if isinstance(file, basestring):
--> 135 return open(file, *args, **kwargs)
136 else:
137 return file
A short description of the network will be printed out if entered onto the command line
In [1]: ring_slot
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-5c1cb2d95a36> in <module>()
----> 1 ring_slot
/home/docs/checkouts/readthedocs.org/user_builds/scikit-rf/envs/new-docs/local/lib/python2.7/site-pac
408 # open file in ’binary’ mode because we are going to try and
409 # upickle it first
--> 410 fid = get_fid(file,’rb’)
411
412 try:
/home/docs/checkouts/readthedocs.org/user_builds/scikit-rf/envs/new-docs/local/lib/python2.7/site-pac
133 ’’’
134 if isinstance(file, basestring):
--> 135 return open(file, *args, **kwargs)
136 else:
137 return file
or from directly passing values for the frequency, s-paramters and z0.
In [1]: custom_ntwk = rf.Network(f = [1,2,3], s= [-1, 1j, 0], z0=50)
16 Chapter 3. Networks
scikit-rf Documentation, Release dev
The basic attributes of a microwave Network are provided by the following properties :
• Network.s : Scattering Parameter matrix.
• Network.z0 : Port Characteristic Impedance matrix.
• Network.frequency : Frequency Object.
All of the network parameters are represented internally as complex numpy.ndarray ‘s of shape FxNxN, where F
is the number of frequency points and N is the number of ports.
In [1]: shape(ring_slot.s)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-d3f838fde0d4> in <module>()
----> 1 shape(ring_slot.s)
Note that the indexing starts at 0, so the first 10 values of S11 can be accessed with
In [1]: ring_slot.s[:10,0,0]
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-8675dfeb1617> in <module>()
----> 1 ring_slot.s[:10,0,0]
The Network object has numerous other properties and methods which can found in the Network docstring. If you
are using IPython, then these properties and methods can be ‘tabbed’ out on the command line.
In [1]: short.s<TAB>
rf.data.line.s rf.data.line.s_arcl rf.data.line.s_im
rf.data.line.s11 rf.data.line.s_arcl_unwrap rf.data.line.s_mag
...
Note: Although this tutorial focuses on s-parametes, other network representations such as Impedance (Network.z)
and Admittance Parameters (Network.y) are available as well, see Impedance and Admittance Parameters .
Amongst other things, the methods of the Network class provide convenient ways to plot components of the network
parameters,
• Network.plot_s_db() : plot magnitude of s-parameters in log scale
• Network.plot_s_deg() : plot phase of s-parameters in degrees
• Network.plot_s_smith() : plot complex s-parameters on Smith Chart
• ...
To plot all four s-parameters of the ring_slot on the Smith Chart.
In [1]: ring_slot.plot_s_smith();
18 Chapter 3. Networks
scikit-rf Documentation, Release dev
Element-wise mathematical operations on the scattering parameter matrices are accessible through overloaded opera-
tors. To illustrate their usage, load a couple Networks stored in the data module.
In [1]: short = rf.data.wr2p2_short
All of these operations return Network types, so the methods and properties of a Network are available on the
result. For example, to plot the complex difference between short and delay_short,
In [1]: figure();
In [3]: difference.plot_s_mag()
Another common application is calculating the phase difference using the division operator,
In [1]: figure();
In [2]: (delayshort/short).plot_s_deg()
Linear operators can also be used with scalars or an numpy.ndarray that ais the same length as the Network.
In [1]: open = (short*-1)
In [2]: open.s[:3,...]
Out[2]:
array([[[ 1.-0.j]],
[[ 1.-0.j]],
[[ 1.-0.j]]])
20 Chapter 3. Networks
scikit-rf Documentation, Release dev
In [4]: rando.s[:3,...]
Out[4]:
array([[[ 0.44559823+0.j]],
[[ 0.82269825+0.j]],
[[ 0.15599348+0.j]]])
Note that if you multiply a Network by an numpy.ndarray be sure to place the array on right side.
Cascading and de-embeding 2-port Networks can also be done though operators. The cascade() function can
be called through the power operator, **. To calculate a new network which is the cascaded connection of the two
individual Networks line and short,
In [1]: short = rf.data.wr2p2_short
De-embedding can be accomplished by cascading the inverse of a network. The inverse of a network is accessed
through the property Network.inv. To de-embed the short from delay_short,
In [1]: short = line.inv ** delayshort
skrf supports the connection of arbitrary ports of N-port networks. It accomplishes this using an algorithm called
sub-network growth 1 , available through the function connect(). Terminating one port of an ideal 3-way splitter
can be done like so,
In [1]: tee = rf.Network(’../skrf/data/tee.s3p’)
---------------------------------------------------------------------------
IOError Traceback (most recent call last)
<ipython-input-1-7ef027af4bd0> in <module>()
----> 1 tee = rf.Network(’../skrf/data/tee.s3p’)
/home/docs/checkouts/readthedocs.org/user_builds/scikit-rf/envs/new-docs/local/lib/python2.7/site-pac
408 # open file in ’binary’ mode because we are going to try and
409 # upickle it first
--> 410 fid = get_fid(file,’rb’)
411
412 try:
/home/docs/checkouts/readthedocs.org/user_builds/scikit-rf/envs/new-docs/local/lib/python2.7/site-pac
133 ’’’
134 if isinstance(file, basestring):
--> 135 return open(file, *args, **kwargs)
1 Compton, R.C.; , “Perspectives in microwave circuit analysis,” Circuits and Systems, 1989., Proceedings of the 32nd Midwest Symposium on
136 else:
137 return file
/home/docs/checkouts/readthedocs.org/user_builds/scikit-rf/envs/new-docs/local/lib/python2.7/site-pac
2527 ’’’
2528 # some checking
-> 2529 check_frequency_equal(ntwkA,ntwkB)
2530
2531 # create output Network, from copy of input
/home/docs/checkouts/readthedocs.org/user_builds/scikit-rf/envs/new-docs/local/lib/python2.7/site-pac
3836 ’’’
3837 if assert_frequency_equal(ntwkA,ntwkB) == False:
-> 3838 raise IndexError(’Networks dont have matching frequency. See ‘Network.interpolate‘’)
3839
3840 def check_z0_equal(ntwkA,ntwkB):
Note that this function takes into account port impedances, and if connecting ports have different port impedances an
appropriate impedance mismatch is inserted.
A common need is to change the number of frequency points of a Network. For instance, to use the operators and
cascading functions the networks involved must have matching frequencies. If two networks have different frequency
information, then an error will be raised,
In [1]: line = rf.data.wr2p2_line.copy()
In [3]: line1
Out[3]: 2-Port Network: ’wr2p2,line1’, 330-500 GHz, 101 pts, z0=[ 50.+0.j 50.+0.j]
In [4]: line
Out[4]: 2-Port Network: ’wr2p2,line’, 330-500 GHz, 201 pts, z0=[ 50.+0.j 50.+0.j]
In [5]: line1+line
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-5-82040f7eab08> in <module>()
----> 1 line1+line
/home/docs/checkouts/readthedocs.org/user_builds/scikit-rf/envs/new-docs/local/lib/python2.7/site-pac
513
22 Chapter 3. Networks
scikit-rf Documentation, Release dev
/home/docs/checkouts/readthedocs.org/user_builds/scikit-rf/envs/new-docs/local/lib/python2.7/site-pac
641 ’’’
642 if other.frequency != self.frequency:
--> 643 raise IndexError(’Networks must have same frequency. See ‘Network.interpolate‘’)
644
645 if other.s.shape != self.s.shape:
In [2]: line1.resample(201)
In [3]: line1
Out[3]: 2-Port Network: ’wr2p2,line1’, 330-500 GHz, 201 pts, z0=[ 50.+0.j 50.+0.j]
In [4]: line1+line
Out[4]: 2-Port Network: ’wr2p2,line1’, 330-500 GHz, 201 pts, z0=[ 50.+0.j 50.+0.j]
A related application is the need to combine Networks which cover different frequency ranges. Two Netwoks can
be stitched together using stitch(), which concatenates their s-parameter matrices along their frequency axis. To
combine a WR-2.2 Network with a WR-1.5 Network,
In [1]: from skrf.data import wr2p2_line, wr1p5_line
In [3]: line
Out[3]: 2-Port Network: ’wr2p2,line’, 330-750 GHz, 402 pts, z0=[ 50.+0.j 50.+0.j]
While skrf supports reading and writing the touchstone file format, it also provides native IO capabilities for any
skrf object through the functions read() and write(). These functions can also be called through the Network
methods Network.read() and Network.write(). The Network constructor (Network.__init__() )
calls read() implicitly if a skrf file is passed.
In [1]: line = rf.Network(’../skrf/data/line.s2p’)
---------------------------------------------------------------------------
IOError Traceback (most recent call last)
<ipython-input-1-6b24e2842934> in <module>()
----> 1 line = rf.Network(’../skrf/data/line.s2p’)
/home/docs/checkouts/readthedocs.org/user_builds/scikit-rf/envs/new-docs/local/lib/python2.7/site-pac
408 # open file in ’binary’ mode because we are going to try and
409 # upickle it first
--> 410 fid = get_fid(file,’rb’)
411
412 try:
/home/docs/checkouts/readthedocs.org/user_builds/scikit-rf/envs/new-docs/local/lib/python2.7/site-pac
133 ’’’
134 if isinstance(file, basestring):
--> 135 return open(file, *args, **kwargs)
136 else:
137 return file
Frequently there is an entire directory of files that need to be analyzed. The function read_all() is used to create
objects from all files in a directory quickly. Given a directory of skrf-readable files, read_all() returns a dict
with keys equal to the filenames, and values equal to objects. To load all skrf files in the skrf/data/ directory which
contain the string ‘wr2p2’.
In [1]: dict_o_ntwks = rf.read_all(’../skrf/data/’, contains = ’wr2p2’)
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-1-fe2c0eb22851> in <module>()
----> 1 dict_o_ntwks = rf.read_all(’../skrf/data/’, contains = ’wr2p2’)
/home/docs/checkouts/readthedocs.org/user_builds/scikit-rf/envs/new-docs/local/lib/python2.7/site-pac
261
262 out={}
--> 263 for filename in os.listdir(dir):
264 if contains is not None and contains not in filename:
265 continue
In [2]: dict_o_ntwks
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-2-c353202a1b92> in <module>()
----> 1 dict_o_ntwks
read_all() has a companion function, write_all() which takes a dictionary of skrf objects, and writes each
object to an individual file.
In [1]: rf.write_all(dict_o_ntwks, dir = ’.’)
In [2]: ls
wr2p2,delayshort.ntwk wr2p2,line.ntwk wr2p2,short.ntwk
In [2]: ls
dict_o_ntwk.p
24 Chapter 3. Networks
scikit-rf Documentation, Release dev
A similar function save_sesh(), can be used to save all skrf objects in the current namespace.
This tutorial focuses on s-parameters, but other network represenations are available as well. Impedance and
Admittance Parameters can be accessed through the parameters Network.z and Network.y, respectively.
Scalar components of complex parameters, such as Network.z_re, Network.z_im and plotting methods like
Network.plot_z_mag() are available as well.
In [1]: ring_slot.z[:3,...]
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-7f10ec33de02> in <module>()
----> 1 ring_slot.z[:3,...]
In [2]: figure();
In [3]: ring_slot.plot_z_im(m=1,n=0)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-3-404fa4ed4520> in <module>()
----> 1 ring_slot.plot_z_im(m=1,n=0)
A Network can be created from scratch by passing values of relevant properties as keyword arguments to the con-
structor,
In [1]: frequency = rf.Frequency(75,110,101,’ghz’)
In [2]: s = -1*ones(101)
For more information creating Networks representing transmission line and lumped components, see the media
module.
3.10 Sub-Networks
Frequently, the one-port s-parameters of a multiport network’s are of interest. These can be accessed by the sub-
network properties, which return one-port Network objects,
In [1]: port1_return = line.s11
In [2]: port1_return
Out[2]: 1-Port Network: ’wr2p2,line’, 330-750 GHz, 402 pts, z0=[ 50.+0.j]
3.11 References
26 Chapter 3. Networks
CHAPTER 4
Plotting
Contents
• Plotting
– Plotting Methods
– Complex Plots
* Smith Chart
* Complex Plane
– Rectangular Plots
* Log-Magnitude
* Phase
* Impedance, Admittance
– Customizing Plots
– Saving Plots
– Misc
* Adding Markers to Lines
* Formating Plots
Network plotting abilities are implemented as methods of the Network class. Some of the plotting functions of
network s-parameters are,
• Network.plot_s_re()
• Network.plot_s_im()
• Network.plot_s_mag()
• Network.plot_s_db()
• Network.plot_s_deg()
• Network.plot_s_deg_unwrap()
• Network.plot_s_rad()
• Network.plot_s_rad_unwrap()
• Network.plot_s_smith()
• Network.plot_s_complex()
Similar methods exist for Impedance (Network.z) and Admittance Parameters (Network.y),
27
scikit-rf Documentation, Release dev
• Network.plot_z_re()
• Network.plot_z_im()
• ...
• Network.plot_y_re()
• Network.plot_z_im()
• ...
Step-by-step examples of how to create and customize plots are given below.
As a first example, load a Network from the data module, and plot all four s-parameters on the Smith chart.
In [1]: import skrf as rf
In [3]: ring_slot
Out[3]: 2-Port Network: ’ring slot’, 75-110 GHz, 501 pts, z0=[ 50.+0.j 50.+0.j]
In [4]: ring_slot.plot_s_smith()
Note: If you dont see any plots after issuing these commands, then you may not have started ipython with the –pylab
flag. Try from pylab import * to import the matplotlib commands and ion() to turn on interactive plotting. See this
page , for more info on ipython’s pylab mode.
The smith chart can be drawn with some impedance values labeled through the draw_labels argument.
28 Chapter 4. Plotting
scikit-rf Documentation, Release dev
In [1]: figure();
In [2]: ring_slot.plot_s_smith(draw_labels=True)
Another common option is to draw addmitance contours, instead of impedance. This is controled through the
chart_type argument.
In [1]: figure();
In [2]: ring_slot.plot_s_smith(chart_type=’y’)
Note: If more than one plot_s_smith() command is issued on a single figure, you may need to call draw() to refresh
the chart.
Network parameters can also be plotted in the complex plane without a Smith Chart through
Network.plot_s_complex().
In [1]: figure();
In [2]: ring_slot.plot_s_complex();
4.3.1 Log-Magnitude
Scalar components of the complex network parameters can be plotted vs frequency as well. To plot the log-magnitude
of the s-parameters vs. frequency,
In [1]: figure();
In [2]: ring_slot.plot_s_db()
30 Chapter 4. Plotting
scikit-rf Documentation, Release dev
When no arguments are passed to the plotting methods, all parameters are plotted. Single parameters can be plotted
by passing indecies m and n to the plotting commands (indexing start from 0). Comparing the simulated reflection
coefficient off the ring slot to a measurement,
In [1]: from skrf.data import ring_slot_meas
In [2]: figure();
4.3.2 Phase
Plot phase,
In [1]: figure();
In [2]: ring_slot.plot_s_deg()
Or unwrapped phase,
In [1]: figure();
In [2]: ring_slot.plot_s_deg_unwrap()
The components the Impendanc and Admittance parameters can be plotted similarly,
In [1]: figure();
In [2]: ring_slot.plot_z_im()
32 Chapter 4. Plotting
scikit-rf Documentation, Release dev
In [1]: figure();
In [2]: ring_slot.plot_y_re()
The legend entries are automatically filled in with the Network’s name. The entry can be overidden by passing the
label argument to the plot method.
In [1]: figure();
The frequency unit used on the x-axis is automatically filled in from the Networks frequency attribute. To change
the label, change the frequency’s unit.
In [1]: ring_slot.frequency.unit = ’mhz’
Other key word arguments given to the plotting methods are passed through to the matplotlib plot() function.
In [1]: figure();
34 Chapter 4. Plotting
scikit-rf Documentation, Release dev
In [2]: ring_slot.plot_s_smith()
In [6]: draw();
Plots can be saved in various file formats using the GUI provided by the matplotlib. However, skrf provides a conve-
nience function, called save_all_figs(), that allows all open figures to be saved to disk in multiple file formats,
with filenames pulled from each figure’s title:
>>> rf.save_all_figs(’.’, format=[’eps’,’pdf’])
./WR-10 Ringslot Array Simulated vs Measured.eps
./WR-10 Ringslot Array Simulated vs Measured.pdf
4.6 Misc
A common need is to make a color plot, interpretable in greyscale print. There is a convenient function,
add_markers_to_lines(), which adds markers each line in a plots after the plot has been made. In this way,
adding markers to an already written set of plotting commands is easy.
In [1]: figure();
In [2]: ring_slot.plot_s_db(m=0,n=0)
In [3]: ring_slot_meas.plot_s_db(m=0,n=0)
In [4]: rf.add_markers_to_lines()
It is likely that your plots dont look exactly like the ones in this tutorial. This is because matplotlib supports a
vast amount of customization. Formating options can be customized on-the-fly by modifying values of the rcParams
dictionary. Once these are set to your liking they can be saved to your .matplotlibrc file.
Here are some relevant parameters which should get your plots looking close to the ones in this tutorial:
my_params = {
’figure.dpi’: 120,
’figure.figsize’: [4,3],
’figure.subplot.left’ : 0.15,
’figure.subplot.right’ : 0.9,
’figure.subplot.bottom’ : 0.12,
’axes.titlesize’ : ’medium’,
’axes.labelsize’ : 10 ,
’ytick.labelsize’ :’small’,
’xtick.labelsize’ :’small’,
’legend.fontsize’ : 8 #small,
’legend.loc’ : ’best’,
’font.size’ : 10.0,
’font.family’ : ’serif’,
’text.usetex’ : True, # if you have latex
}
rcParams.update(my_params)
The project mpltools provides a way to switch between pre-defined styles, and contains other useful plotting-related
features.
36 Chapter 4. Plotting
CHAPTER 5
NetworkSet
Contents
• NetworkSet
– Creating a NetworkSet
– Accesing Network Methods
– Statistical Properties
– Plotting Uncertainty Bounds
– Reading and Writing
The NetworkSet object represents an unordered set of networks and provides methods for calculating statistical
quantities and displaying uncertainty bounds.
For this example, assume that numerous measurements of a single network are made. These measurements have been
retrieved from a VNA and are in the form of touchstone files. A set of example data can be found in scikit-rf/skrf/data/,
with naming convention ro,*.s1p,
In [9]: import skrf as rf
In [10]: ls ../skrf/data/ro*
ls: cannot access ../skrf/data/ro*: No such file or directory
The files ro,1.s1p , ro,2.s1p, ... are redundant measurements on which we would like to calculate statistics using the
NetworkSet class.
A NetworkSet is created from a list or dict of Network‘s. So first we need to load all of the touchstone files. This
can be done quickly with read_all() , which loads all skrf-readable objects in a directory. The argument contains
is used to load only files which match a given substring.
In [11]: rf.read_all(’../skrf/data/’, contains=’ro’)
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-11-97a3022ebf44> in <module>()
----> 1 rf.read_all(’../skrf/data/’, contains=’ro’)
37
scikit-rf Documentation, Release dev
/home/docs/checkouts/readthedocs.org/user_builds/scikit-rf/envs/new-docs/local/lib/python2.7/site-pac
261
262 out={}
--> 263 for filename in os.listdir(dir):
264 if contains is not None and contains not in filename:
265 continue
/home/docs/checkouts/readthedocs.org/user_builds/scikit-rf/envs/new-docs/local/lib/python2.7/site-pac
261
262 out={}
--> 263 for filename in os.listdir(dir):
264 if contains is not None and contains not in filename:
265 continue
In [14]: ro_ns
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-14-3e1af8578b16> in <module>()
----> 1 ro_ns
A NetworkSet can also be constructed from zipfile of touchstones through the class method
NetworkSet.from_zip()
The Network elements in a NetworkSet can be accessed like the elements of list,
In [15]: ro_ns[0]
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-15-b0862044ecb9> in <module>()
----> 1 ro_ns[0]
38 Chapter 5. NetworkSet
scikit-rf Documentation, Release dev
Most Network methods are also methods of NetworkSet. These methods are called on each Network element
individually. For example to plot the log-magnitude of the s-parameters of each Network, (see Plotting for details on
Network ploting methods).
In [16]: ro_ns.plot_s_db(label=’Mean Response’)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-16-951799c60e50> in <module>()
----> 1 ro_ns.plot_s_db(label=’Mean Response’)
Statistical quantities can be calculated by accessing properties of the NetworkSet. For example, to calculate the
complex average of the set, access the mean_s property
In [17]: ro_ns.mean_s
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-17-855108637269> in <module>()
----> 1 ro_ns.mean_s
Note: Because the statistical operator methods are generated upon initialization they are not explicitly documented
in this manual.
The naming convention of the statistical operator properties are NetworkSet.function_parameter, where function is
the name of the statistical function, and parameter is the Network parameter to operate on. These methods return
a Network object, so they can be saved or plotted in the same way as you would with a Network. To plot the
log-magnitude of the complex mean response
In [18]: figure();
In [19]: ro_ns.mean_s.plot_s_db(label=’ro’)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-19-27acef3161cc> in <module>()
----> 1 ro_ns.mean_s.plot_s_db(label=’ro’)
40 Chapter 5. NetworkSet
scikit-rf Documentation, Release dev
Using these properties it is possible to calculate statistical quantities on the scalar components of the complex network
parameters. To calculate the mean of the phase component,
In [22]: figure();
In [23]: ro_ns.mean_s_deg.plot_s_re()
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-23-8bebd802d3ba> in <module>()
----> 1 ro_ns.mean_s_deg.plot_s_re()
In [24]: figure();
In [25]: ro_ns.plot_uncertainty_bounds_s_db()
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-25-db9f85fbe2b3> in <module>()
----> 1 ro_ns.plot_uncertainty_bounds_s_db()
In [26]: figure();
In [27]: ro_ns.plot_uncertainty_bounds_s_deg()
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-27-b5201c9bf074> in <module>()
----> 1 ro_ns.plot_uncertainty_bounds_s_deg()
42 Chapter 5. NetworkSet
scikit-rf Documentation, Release dev
NetworkSets can be saved to disk using skrf’s native IO capabilities. This can be ccomplished through the
NetworkSet.write() method.
In [28]: ro_set.write()
In [29]: ls
ro set.ns
Note: Note that if the NetworkSet’s name attribute is not assigned, then you must provide a filename to
NetworkSet.write().
Alternatively, you can write the Network set by directly calling the write() function. In either case, the resultant
file can be read back into memory using read().
In [30]: ro_ns = rf.read(’ro set.ns’)
44 Chapter 5. NetworkSet
CHAPTER 6
Virtual Instruments
Contents
• Virtual Instruments
The vi module holds classes for GPIB/VISA instruments that are intricately related to skrf. Most of the classes were
created for the sole purpose of retrieving data so that calibration and measurements could be carried out offline with
skrf, therefore most other instrument capabilities are neglected.
Note: To use the virtual instrument classes you must have pyvisa installed, and a working VISA installation.
#if an error is thrown at this point there is most likely a problem with your visa setup
In [3]: dut_1 = my_vna.s11
Unfortunately, the syntax is different for every VNA class, so the above example wont directly translate to other
VNA’s. Re-writing all of the VNA classes to follow the same convention is on the TODO list
45
scikit-rf Documentation, Release dev
Calibration
Contents
• Calibration
– Intro
– Creating a Calibration
– Saving and Recalling a Calibration
– One-Port
– Concise One-port
– Two-port
* Switch-terms
– Example
* Using one-port ideals in two-port Calibration
7.1 Intro
This tutorial illustrates how to use skrf to calibrate data taken from a VNA. The explanation of calibration theory and
calibration kit design is beyond the scope of this tutorial. Instead, this tutorial describes how to calibrate a device under
test (DUT), assuming you have measured an acceptable set of standards, and have a coresponding set ideal responses.
skrf‘s default calibration algorithms are generic in that they will work with any set of standards. If you supply more
calibration standards than is needed, skrf will implement a simple least-squares solution.
Calibrations are performed through a Calibration class. Creating a Calibration object requires at least two
pieces of information:
• a list of measured Network‘s
• a list of ideal Network‘s
The Network elements in each list must all be similar (same #ports, frequency info, etc) and must be aligned to each
other, meaning the first element of ideals list must correspond to the first element of measured list.
47
scikit-rf Documentation, Release dev
Like other skrf objects, Calibration‘s can be written-to and read-from disk. Writing can be accomplished by
using Calibration.write(), or rf.write(), and reading is done with rf.read().
7.4 One-Port
# apply it to a dut
dut = rf.Network(’my_dut.s1p’)
dut_caled = cal.apply_cal(dut)
# plot results
dut_caled.plot_s_db()
48 Chapter 7. Calibration
scikit-rf Documentation, Release dev
# save results
dut_caled.write_touchstone()
my_ideals = rf.load_all_touchstones_in_dir(’ideals/’)
my_measured = rf.load_all_touchstones_in_dir(’measured/’)
7.6 Two-port
Two-port calibration is more involved than one-port. skrf supports two-port calibration using a 8-term error model
based on the algorithm described in 1 , by R.A. Speciale.
Like the one-port algorithm, the two-port calibration can handle any number of standards, providing that some fun-
damental constraints are met. In short, you need three two-port standards; one must be transmissive, and one must
provide a known impedance and be reflective.
One draw-back of using the 8-term error model formulation (which is the same formulation used in TRL) is that
switch-terms may need to be measured in order to achieve a high quality calibration (this was pointed out to me by
Dylan Williams).
7.6.1 Switch-terms
Originally described by Roger Marks 2 , switch-terms account for the fact that the error networks change slightly
depending on which port is being excited. This is due to the internal switch within the VNA.
Switch terms can be measured with a custom measurement configuration on the VNA itself. skrf has support for switch
terms for the HP8510C class, which you can use or extend to different VNA. Without switch-term measurements, your
calibration quality will vary depending on properties of you VNA.
1 Speciale, R.A.; , “A Generalization of the TSD Network-Analyzer Calibration Procedure, Covering n-Port Scattering-Parameter Measurements,
Affected by Leakage Errors,” Microwave Theory and Techniques, IEEE Transactions on , vol.25, no.12, pp. 1100- 1115, Dec 1977. URL:
http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=1129282&isnumber=25047
2 Marks, Roger B.; , “Formulations of the Basic Vector Network Analyzer Error Model including Switch-Terms,” ARFTG Conference Digest-
7.7 Example
Two-port calibration is accomplished in an identical way to one-port, except all the standards are two-port networks.
This is even true of reflective standards (S21=S12=0). So if you measure reflective standards you must measure two of
them simultaneously, and store information in a two-port. For example, connect a short to port-1 and a load to port-2,
and save a two-port measurement as ‘short,load.s2p’ or similar:
import skrf as rf
# apply it to a dut
dut = rf.Network(’my_dut.s2p’)
dut_caled = cal.apply_cal(dut)
# plot results
dut_caled.plot_s_db()
# save results
dut_caled.write_touchstone()
Commonly, you have data for ideal data for reflective standards in the form of one-port touchstone files (ie s1p). To
use this with skrf’s two-port calibration method you need to create a two-port network that is a composite of the two
networks. There is a function in the WorkingBand Class which will do this for you, called two_port_reflect.:
short = rf.Network(’ideals/short.s1p’)
load = rf.Network(’ideals/load.s1p’)
50 Chapter 7. Calibration
scikit-rf Documentation, Release dev
Bibliography
7.7. Example 51
scikit-rf Documentation, Release dev
52 Chapter 7. Calibration
CHAPTER 8
Media
Contents
• Media
– Introduction
* Media’s Supported by skrf
– Creating Media Objects
* Coplanar Waveguide
* Freespace
* Rectangular Waveguide
– Working with Media’s
– Network Synthesis
– Building Cicuits
– Design Optimization
– References
8.1 Introduction
skrf supports the microwave network synthesis based on transmission line models. Network creation is accomplished
through methods of the Media class, which represents a transmission line object for a given medium. Once constructed,
a Media object contains the neccesary properties such as propagation constant and characteristic impedance, that are
needed to generate microwave circuits.
This tutorial illustrates how created Networks using several different Media objects. The basic usage is,
In [1]: import skrf as rf
More detailed examples illustrating how to create various kinds of Media objects are given below.
53
scikit-rf Documentation, Release dev
Warning: The network creation and connection syntax of skrf are cumbersome if you need to doing complex
circuit design. For a this type of application, you may be interested in using QUCS instead. skrf‘s synthesis
cabilities lend themselves more to scripted applications such as Design Optimization or batch processing.
The base-class, Media, is constructed directly from values of propagation constant and characteristic impedance.
Specific instances of Media objects can be created from relevant physical and electrical properties. Below is a list of
mediums types supported by skrf,
• CPW
• RectangularWaveguide
• Freespace
• DistributedCircuit
• Media
Typically, network analysis is done within a given frequency band. When a Media object is created, it must be given
a Frequency object. This prevent having to repitously provide frequency information for each new network created.
Here is an example of how to initialize a coplanar waveguide 1 media. The instance has a 10um center conductor, gap
of 5um, and substrate with relative permativity of 10.6,
In [1]: import skrf as rf
In [4]: cpw
Out[4]:
Coplanar Waveguide Media. 75-110 GHz. 101 points
W= 1.00e-05m, S= 5.00e-06m
8.2.2 Freespace
Here is another example, this time constructing a plane-wave in freespace from 10-20GHz
In [1]: freq = rf.Frequency(10,20,101,’ghz’)
In [2]: fs = rf.media.Freespace(freq)
1 http://www.microwaves101.com/encyclopedia/coplanarwaveguide.cfm
54 Chapter 8. Media
scikit-rf Documentation, Release dev
In [3]: fs
Out[3]: Freespace Media. 10-20 GHz. 101 points
In [3]: wg
Out[3]:
Rectangular Waveguide Media. 75-110 GHz. 101 points
a= 2.54e-03m, b= 1.27e-03m
Note: The z0 argument in the Rectangular Waveguide constructor is used to force a specifc port impedance.
This is commonly used to match the port impedance to what a VNA stores in a touchstone file. See
media.Media.__init__() for more information.
Once constructed, the pertinent wave quantities of the media such as propagation constant and characteristic impedance
can be accessed through the properties propagation_constant and characteristic_impedance. These
properties return complex numpy.ndarray‘s,
In [1]: cpw.propagation_constant[:3]
Out[1]: array([ 0.+3785.59740815j, 0.+3803.26352939j, 0.+3820.92965062j])
In [2]: cpw.characteristic_impedance[:3]
Out[2]: array([ 50.06074662+0.j, 50.06074662+0.j, 50.06074662+0.j])
Because the wave quantities are dynamic they change when the attributes of the cpw line change. To illustrate this,
plot the propagation constant of the cpw for various values of substrated permativity,
In [1]: figure();
In [5]: legend();
56 Chapter 8. Media
scikit-rf Documentation, Release dev
Networks are created through methods of a Media object. Here is a brief list of some generic network components
skrf supports,
• match()
• short()
• open()
• load()
• line()
• thru()
• tee()
• delay_short()
• shunt_delay_open()
Usage of these methods can is demonstrated below.
To create a 1-port network for a rectangular waveguide short,
In [1]: wg.short(name = ’short’)
Out[1]: 1-Port Network: ’short’, 75-110 GHz, 101 pts, z0=[ 50.+0.j]
Note: Simple circuits like short() and open() are ideal short and opens with Γ = −1 and Γ = 1, i.e. they dont
take into account sophisticated effects of the discontinuties. Effects of discontinuities are implemented as methods
specific to a given Media, like CPW.cpw_short.
By connecting a series of simple circuits, more complex circuits can be made. To build a the 90◦ delay short, in the
rectangular waveguide media defined above.
In [1]: delay_short = wg.line(d=90,unit=’deg’) ** wg.short()
In [3]: delay_short
Out[3]: 1-Port Network: ’delay short’, 75-110 GHz, 101 pts, z0=[ 50.+0.j]
When Networks with more than 2 ports need to be connected together, use rf.connect(). To create a two-port
network for a shunted delayed open, you can create an ideal 3-way splitter (a ‘tee’) and conect the delayed open to one
of its ports,
In [1]: tee = cpw.tee()
If a specific circuit is created frequenctly, it may make sense to use a function to create the circuit. This can be done
most quickly using lamba
In [1]: delay_short = lambda d: wg.line(d,’deg’)**wg.short()
In [2]: delay_short(90)
Out[2]: 1-Port Network: ’’, 75-110 GHz, 101 pts, z0=[ 50.+0.j]
This is how many of skrf‘s network creation methods are made internally.
A more useful example may be to create a function for a shunt-stub tuner, that will work for any media object
In [1]: def shunt_stub(med, d0, d1):
...: return med.line(d0,’deg’)**med.shunt_delay_open(d1,’deg’)
...:
In [2]: shunt_stub(cpw,10,90)
Out[2]: 2-Port Network: ’’, 75-110 GHz, 101 pts, z0=[ 50.06074662+0.j 50.06074662+0.j]
The abilities of scipy‘s optimizers can be used to automate network design. In this example, skrf is used to automate
the single stub design. First, we create a ‘cost’ function which returns somthing we want to minimize, such as the
reflection coefficient magnitude at band center. Then, one of scipy’s minimization algorithms is used to determine the
optimal parameters of the stub lengths to minimize this cost.
In [1]: from scipy.optimize import fmin
# define the cost function we want to minimize (this uses sloppy namespace)
In [4]: def cost(d):
...: return (shunt_stub(cpw,d[0],d[1]) ** load)[100].s_mag.squeeze()
...:
In [7]: d_opt
Out[7]: array([ 1.74945025e+02, -9.55405994e-08])
58 Chapter 8. Media
scikit-rf Documentation, Release dev
8.7 References
8.7. References 59
scikit-rf Documentation, Release dev
60 Chapter 8. Media
CHAPTER 9
Examples
9.1.1 Introduction
This example illustrates a way to visualize the design space for a single stub matching network. The matching Network
consists of a shunt and series stub arranged as shown below, (image taken from R.M. Weikle’s Notes).
A single stub matching network can be designed to produce maximum power transfer to the load, ZL at a single
frequency. The matching network has two design parameters:
• length of series tline
• length of shunt tline
This script illustrates how to create a plot of reflection coefficient magnitude, vs series and shunt line lengths. The
optimal designs are then seen as the minima of a 2D surface.
9.1.2 Script
import skrf as rf
from pylab import *
# Inputs
wg = rf.wr10 # The Media class
f0 = 90 # Design Frequency in GHz
d_start, d_stop = 0,180 # span of tline lengths [degrees]
n = 21 # number of points
Gamma0 = .5 # the reflection coefficient off the load we are matching
61
scikit-rf Documentation, Release dev
62 Chapter 9. Examples
scikit-rf Documentation, Release dev
# loop through all line-lengths for series and shunt tlines, and store
# reflection coefficient magnitude in array
output = array([[ (single_stub(wg, [d0,d1])**load).s_mag[0,0,0] \
for d0 in d_range] for d1 in d_range] )
### Plots
fig=figure()
ax = Axes3D(fig)
x,y = meshgrid(d_range, d_range)
ax.plot_surface(x,y,output, rstride=1, cstride=1,cmap=cm.jet)
ax.set_xlabel(’Series T-line [deg]’)
ax.set_ylabel(’Shunt T-line[deg]’)
ax.set_zlabel(’Return Loss Magnitude’)
ax.set_title(r’Series-Shunt Stub Matching Network Design Space (3D)’)
show()
72.0
0.6
0.5
108.0
0.4
144.0 0.3
0.2
180.0 0.1
0.0 36.0 72.0 108.0 144.0 180.0
Series T-line [deg]
64 Chapter 9. Examples
scikit-rf Documentation, Release dev
1.0
0.6
0.4
0.2
0.0
180
160
140
120 g]
0 20 100 e
40 60 80 line[d
60 T-
Series T80 100 120 40 hunt
-line [d 20 S
eg] 140 160 180 0
9.2.1 Instructive
# apply it to a dut
dut = rf.Network(’my_dut.s1p’)
dut_caled = cal.apply_cal(dut)
# plot results
dut_caled.plot_s_db()
# save results
dut_caled.write_touchstone()
9.2.2 Concise
This example is meant to be the same as the first except more concise:
import skrf as rf
my_ideals = rf.load_all_touchstones_in_dir(’ideals/’)
my_measured = rf.load_all_touchstones_in_dir(’measured/’)
66 Chapter 9. Examples
CHAPTER 10
Reference
skrf.frequency.Frequency
Attributes
67
scikit-rf Documentation, Release dev
skrf.frequency.Frequency.center
Frequency.center
Center frequency in Hz
Returns center : number
the exact center frequency in units of unit
skrf.frequency.Frequency.f
Frequency.f
Frequency vector in Hz
Returns f : numpy.ndarray
The frequency vector in Hz
See Also:
skrf.frequency.Frequency.f_scaled
Frequency.f_scaled
Frequency vector in units of unit
Returns f_scaled : numpy.ndarray
A frequency vector in units of unit
See Also:
f frequency vector in Hz
w frequency vector in rad/s
skrf.frequency.Frequency.multiplier
Frequency.multiplier
Multiplier for formating axis
This accesses the internal dictionary multiplier_dict using the value of unit
Returns multiplier : number
multiplier for this Frequencies unit
skrf.frequency.Frequency.multiplier_dict
Frequency.multiplier_dict = {‘hz’: 1, ‘khz’: 1000.0, ‘mhz’: 1000000.0, ‘thz’: 1000000000000.0, ‘ghz’: 1000000000.0}
skrf.frequency.Frequency.npoints
Frequency.npoints
starting frequency in Hz
skrf.frequency.Frequency.span
Frequency.span
the frequency span
skrf.frequency.Frequency.start
Frequency.start
starting frequency in Hz
skrf.frequency.Frequency.step
Frequency.step
the inter-frequency step size
skrf.frequency.Frequency.stop
Frequency.stop
starting frequency in Hz
skrf.frequency.Frequency.t
Frequency.t
time vector in s.
t_period = 1/f_step
skrf.frequency.Frequency.t_ns
Frequency.t_ns
time vector in ns.
t_period = 1/f_step
skrf.frequency.Frequency.unit
Frequency.unit
Unit of this frequency band.
Possible strings for this attribute are: ‘hz’, ‘khz’, ‘mhz’, ‘ghz’, ‘thz’
Setting this attribute is not case sensitive.
Returns unit : string
lower-case string representing the frequency units
skrf.frequency.Frequency.unit_dict
Frequency.unit_dict = {‘hz’: ‘Hz’, ‘khz’: ‘KHz’, ‘mhz’: ‘MHz’, ‘thz’: ‘THz’, ‘ghz’: ‘GHz’}
skrf.frequency.Frequency.w
Frequency.w
Frequency vector in radians/s
The frequency vector in rad/s
Returns w : numpy.ndarray
The frequency vector in rad/s
See Also:
Methods
skrf.frequency.Frequency.__init__
Notes
The attribute unit sets the property freqMultiplier, which is used to scale the frequency when f_scaled is refer-
enced.
Examples
skrf.frequency.Frequency.copy
Frequency.copy()
returns a new copy of this frequency
skrf.frequency.Frequency.from_f
Examples
>>> f = np.linspace(75,100,101)
>>> rf.Frequency.from_f(f, unit=’ghz’)
skrf.frequency.Frequency.labelXAxis
Frequency.labelXAxis(ax=None)
Label the x-axis of a plot.
Sets the labels of a plot using matplotlib.x_label() with string containing the frequency unit.
Parameters ax : matplotlib.Axes, optional
Axes on which to label the plot, defaults what is returned by matplotlib.gca()
skrf.frequency.Frequency.overlap
Frequency.overlap(f2)
Calculates overlapping frequency between self and f2
See Also:
overlap_freq
skrf.frequency.Frequency.round_to
Frequency.round_to(val=’hz’)
Round off frequency values to a specfied precision.
This is useful for dealing with finite precision limitations of VNA’s and/or other software
Parameters val : string or number
if val is a string it should be a frequency unit (ie ‘hz’, ‘mhz’,etc). if its a number, then
this returns f = f-f%val
Examples
10.1.2 Functions
skrf.frequency.overlap_freq
skrf.frequency.overlap_freq(f1, f2)
Calculates overlapping frequency between f1 and f2.
Or, put more accurately, this returns a Frequency that is the part of f1 that is overlapped by f2. The resultant start
frequency is the smallest f1.f that is greater than f2.f.start, and likewise for the the stop-frequency. This way the
new frequency overlays onto f1.
Parameters f1 : Frequency
a frequency object
f2 : Frequency
a frequency object
Returns f3 : Frequency
part of f1 that is overlapped by f2
skrf.network.Network
Property Meaning
s_re real part of the s-matrix
s_im imaginary part of the s-matrix
s_mag magnitude of the s-matrix
s_db magnitude in log scale of the s-matrix
s_deg phase of the s-matrix in degrees
The following operations act on the networks s-matrix.
Operator Function
+ element-wise addition of the s-matrix
- element-wise difference of the s-matrix
* element-wise multiplication of the s-matrix
/ element-wise division of the s-matrix
** cascading (only for 2-ports)
// de-embedding (for 2-ports, see inv)
Different components of the Network can be visualized through various plotting methods. These methods can
be used to plot individual elements of the s-matrix or all at once. For more info about plotting see the Plotting
tutorial.
Method Meaning
plot_s_smith() plot complex s-parameters on smith chart
plot_s_re() plot real part of s-parameters vs frequency
plot_s_im() plot imaginary part of s-parameters vs frequency
plot_s_mag() plot magnitude of s-parameters vs frequency
plot_s_db() plot magnitude (in dB) of s-parameters vs frequency
plot_s_deg() plot phase of s-parameters (in degrees) vs frequency
plot_s_deg_unwrap() plot phase of s-parameters (in unwrapped degrees) vs frequency
Network objects can be created from a touchstone or pickle file (see __init__()), by a Media object, or
manually by assigning the network properties directly. Network objects can be saved to disk in the form of
touchstone files with the write_touchstone() method.
An exhaustive list of Network Methods and Properties (Attributes) are given below
References
Attributes
skrf.network.Network.a
Network.a
Active scattering parameter matrix.
Active scattering parameters are simply inverted s-parameters, defined as a = 1/s. Useful in analysis of active
networks. The a-matrix is a 3-dimensional numpy.ndarray which has shape fxnxn, where f is frequency axis
and n is number of ports. Note that indexing starts at 0, so a11 can be accessed by taking the slice a[:,0,0].
Returns a : complex numpy.ndarray of shape fxnxn
the active scattering parameter matrix.
See Also:
s, y, z, t, a
skrf.network.Network.a_arcl
Network.a_arcl
The arcl component of the a-matrix
See Also:
a
skrf.network.Network.a_arcl_unwrap
Network.a_arcl_unwrap
The arcl_unwrap component of the a-matrix
See Also:
a
skrf.network.Network.a_db
Network.a_db
The db component of the a-matrix
See Also:
a
skrf.network.Network.a_db10
Network.a_db10
The db10 component of the a-matrix
See Also:
a
skrf.network.Network.a_deg
Network.a_deg
The deg component of the a-matrix
See Also:
a
skrf.network.Network.a_deg_unwrap
Network.a_deg_unwrap
The deg_unwrap component of the a-matrix
See Also:
a
skrf.network.Network.a_im
Network.a_im
The im component of the a-matrix
See Also:
a
skrf.network.Network.a_mag
Network.a_mag
The mag component of the a-matrix
See Also:
a
skrf.network.Network.a_passivity
Network.a_passivity
The passivity component of the a-matrix
See Also:
a
skrf.network.Network.a_rad
Network.a_rad
The rad component of the a-matrix
See Also:
a
skrf.network.Network.a_rad_unwrap
Network.a_rad_unwrap
The rad_unwrap component of the a-matrix
See Also:
a
skrf.network.Network.a_re
Network.a_re
The re component of the a-matrix
See Also:
a
skrf.network.Network.a_reciprocity
Network.a_reciprocity
The reciprocity component of the a-matrix
See Also:
a
skrf.network.Network.a_time
Network.a_time
The time component of the a-matrix
See Also:
a
skrf.network.Network.a_time_db
Network.a_time_db
The time_db component of the a-matrix
See Also:
a
skrf.network.Network.a_time_mag
Network.a_time_mag
The time_mag component of the a-matrix
See Also:
a
skrf.network.Network.a_vswr
Network.a_vswr
The vswr component of the a-matrix
See Also:
a
skrf.network.Network.f
Network.f
the frequency vector for the network, in Hz.
Returns f : numpy.ndarray
frequency vector in Hz
See Also:
skrf.network.Network.frequency
Network.frequency
frequency information for the network.
This property is a Frequency object. It holds the frequency vector, as well frequency unit, and provides other
properties related to frequency information, such as start, stop, etc.
Returns frequency : Frequency object
frequency information for the network.
See Also:
skrf.network.Network.inv
Network.inv
a Network object with ‘inverse’ s-parameters.
This is used for de-embeding. It is defined so that the inverse of a Network cascaded with itself is unity.
Returns inv : a Network object
a Network object with ‘inverse’ s-parameters.
See Also:
skrf.network.Network.nports
Network.nports
the number of ports the network has.
Returns number_of_ports : number
the number of ports the network has.
skrf.network.Network.number_of_ports
Network.number_of_ports
the number of ports the network has.
Returns number_of_ports : number
the number of ports the network has.
skrf.network.Network.passivity
Network.passivity
passivity metric for a multi-port network.
This returns a matrix who’s diagonals are equal to the total power received at all ports, normalized to the power
at a single excitement port.
mathmatically, this is a test for unitary-ness of the s-parameter matrix 2 .
2 http://en.wikipedia.org/wiki/Scattering_parameters#Lossless_networks
in general it is
SH · S
References
skrf.network.Network.port_tuples
Network.port_tuples
Returns a list of tuples, for each port index pair
A convenience function for the common task fo iterating over all s-parameters index pairs
This just calls: [(y,x) for x in range(self.nports) for y in range(self.nports)]
skrf.network.Network.reciprocity
Network.reciprocity
reciprocity metric for a multi-port network.
This returns the difference between the s-parameter matrix and its transpose.
for two port this is
S − ST
where T is transpose of S
Returns reciprocity : numpy.ndarray of shape fxnxn
skrf.network.Network.s
Network.s
Scattering parameter matrix.
The s-matrix[#]_ is a 3-dimensional numpy.ndarray which has shape fxnxn, where f is frequency axis and
n is number of ports. Note that indexing starts at 0, so s11 can be accessed by taking the slice s[:,0,0].
Returns s : complex numpy.ndarray of shape fxnxn
the scattering parameter matrix.
See Also:
s, y, z, t, a
References
skrf.network.Network.s11
Network.s11
one-port sub-network.
skrf.network.Network.s12
Network.s12
one-port sub-network.
skrf.network.Network.s21
Network.s21
one-port sub-network.
skrf.network.Network.s22
Network.s22
one-port sub-network.
skrf.network.Network.s_arcl
Network.s_arcl
The arcl component of the s-matrix
See Also:
s
skrf.network.Network.s_arcl_unwrap
Network.s_arcl_unwrap
The arcl_unwrap component of the s-matrix
See Also:
s
skrf.network.Network.s_db
Network.s_db
The db component of the s-matrix
See Also:
s
skrf.network.Network.s_db10
Network.s_db10
The db10 component of the s-matrix
See Also:
s
skrf.network.Network.s_deg
Network.s_deg
The deg component of the s-matrix
See Also:
s
skrf.network.Network.s_deg_unwrap
Network.s_deg_unwrap
The deg_unwrap component of the s-matrix
See Also:
s
skrf.network.Network.s_im
Network.s_im
The im component of the s-matrix
See Also:
s
skrf.network.Network.s_mag
Network.s_mag
The mag component of the s-matrix
See Also:
s
skrf.network.Network.s_passivity
Network.s_passivity
The passivity component of the s-matrix
See Also:
s
skrf.network.Network.s_rad
Network.s_rad
The rad component of the s-matrix
See Also:
s
skrf.network.Network.s_rad_unwrap
Network.s_rad_unwrap
The rad_unwrap component of the s-matrix
See Also:
s
skrf.network.Network.s_re
Network.s_re
The re component of the s-matrix
See Also:
s
skrf.network.Network.s_reciprocity
Network.s_reciprocity
The reciprocity component of the s-matrix
See Also:
s
skrf.network.Network.s_time
Network.s_time
The time component of the s-matrix
See Also:
s
skrf.network.Network.s_time_db
Network.s_time_db
The time_db component of the s-matrix
See Also:
s
skrf.network.Network.s_time_mag
Network.s_time_mag
The time_mag component of the s-matrix
See Also:
s
skrf.network.Network.s_vswr
Network.s_vswr
The vswr component of the s-matrix
See Also:
s
skrf.network.Network.t
Network.t
Scattering transfer parameters
The t-matrix 3 is a 3-dimensional numpy.ndarray which has shape fx2x2, where f is frequency axis. Note
that indexing starts at 0, so t11 can be accessed by taking the slice t[:,0,0].
The t-matrix, also known as the wave cascading matrix, is only defined for a 2-port Network.
Returns t : complex numpy.ndarry of shape fx2x2
t-parameters, aka scattering transfer parameters
See Also:
s, y, z, t, a
References
skrf.network.Network.y
Network.y
Admittance parameter matrix.
The y-matrix 4 is a 3-dimensional numpy.ndarray which has shape fxnxn, where f is frequency axis and n is
number of ports. Note that indexing starts at 0, so y11 can be accessed by taking the slice y[:,0,0].
Returns y : complex numpy.ndarray of shape fxnxn
the admittance parameter matrix.
See Also:
s, y, z, t, a
3 http://en.wikipedia.org/wiki/Scattering_parameters#Scattering_transfer_parameters
4 http://en.wikipedia.org/wiki/Admittance_parameters
References
skrf.network.Network.y_arcl
Network.y_arcl
The arcl component of the y-matrix
See Also:
y
skrf.network.Network.y_arcl_unwrap
Network.y_arcl_unwrap
The arcl_unwrap component of the y-matrix
See Also:
y
skrf.network.Network.y_db
Network.y_db
The db component of the y-matrix
See Also:
y
skrf.network.Network.y_db10
Network.y_db10
The db10 component of the y-matrix
See Also:
y
skrf.network.Network.y_deg
Network.y_deg
The deg component of the y-matrix
See Also:
y
skrf.network.Network.y_deg_unwrap
Network.y_deg_unwrap
The deg_unwrap component of the y-matrix
See Also:
y
skrf.network.Network.y_im
Network.y_im
The im component of the y-matrix
See Also:
y
skrf.network.Network.y_mag
Network.y_mag
The mag component of the y-matrix
See Also:
y
skrf.network.Network.y_passivity
Network.y_passivity
The passivity component of the y-matrix
See Also:
y
skrf.network.Network.y_rad
Network.y_rad
The rad component of the y-matrix
See Also:
y
skrf.network.Network.y_rad_unwrap
Network.y_rad_unwrap
The rad_unwrap component of the y-matrix
See Also:
y
skrf.network.Network.y_re
Network.y_re
The re component of the y-matrix
See Also:
y
skrf.network.Network.y_reciprocity
Network.y_reciprocity
The reciprocity component of the y-matrix
See Also:
y
skrf.network.Network.y_time
Network.y_time
The time component of the y-matrix
See Also:
y
skrf.network.Network.y_time_db
Network.y_time_db
The time_db component of the y-matrix
See Also:
y
skrf.network.Network.y_time_mag
Network.y_time_mag
The time_mag component of the y-matrix
See Also:
y
skrf.network.Network.y_vswr
Network.y_vswr
The vswr component of the y-matrix
See Also:
y
skrf.network.Network.z
Network.z
Impedance parameter matrix.
The z-matrix 5 is a 3-dimensional numpy.ndarray which has shape fxnxn, where f is frequency axis and n is
number of ports. Note that indexing starts at 0, so z11 can be accessed by taking the slice z[:,0,0].
Returns z : complex numpy.ndarray of shape fxnxn
5 http://en.wikipedia.org/wiki/impedance_parameters
References
skrf.network.Network.z0
Network.z0
Characteristic impedance[s] of the network ports.
This property stores the characteristic impedance of each port of the network. Because it is possible that each
port has a different characteristic impedance each varying with frequency, z0 is stored internally as a fxn array.
However because z0 is frequently simple (like 50ohm), it can be set with just number as well.
Returns z0 : numpy.ndarray of shape fxn
characteristic impedance for network
skrf.network.Network.z_arcl
Network.z_arcl
The arcl component of the z-matrix
See Also:
z
skrf.network.Network.z_arcl_unwrap
Network.z_arcl_unwrap
The arcl_unwrap component of the z-matrix
See Also:
z
skrf.network.Network.z_db
Network.z_db
The db component of the z-matrix
See Also:
z
skrf.network.Network.z_db10
Network.z_db10
The db10 component of the z-matrix
See Also:
skrf.network.Network.z_deg
Network.z_deg
The deg component of the z-matrix
See Also:
z
skrf.network.Network.z_deg_unwrap
Network.z_deg_unwrap
The deg_unwrap component of the z-matrix
See Also:
z
skrf.network.Network.z_im
Network.z_im
The im component of the z-matrix
See Also:
z
skrf.network.Network.z_mag
Network.z_mag
The mag component of the z-matrix
See Also:
z
skrf.network.Network.z_passivity
Network.z_passivity
The passivity component of the z-matrix
See Also:
z
skrf.network.Network.z_rad
Network.z_rad
The rad component of the z-matrix
See Also:
z
skrf.network.Network.z_rad_unwrap
Network.z_rad_unwrap
The rad_unwrap component of the z-matrix
See Also:
z
skrf.network.Network.z_re
Network.z_re
The re component of the z-matrix
See Also:
z
skrf.network.Network.z_reciprocity
Network.z_reciprocity
The reciprocity component of the z-matrix
See Also:
z
skrf.network.Network.z_time
Network.z_time
The time component of the z-matrix
See Also:
z
skrf.network.Network.z_time_db
Network.z_time_db
The time_db component of the z-matrix
See Also:
z
skrf.network.Network.z_time_mag
Network.z_time_mag
The time_mag component of the z-matrix
See Also:
z
skrf.network.Network.z_vswr
Network.z_vswr
The vswr component of the z-matrix
See Also:
z
Methods
skrf.network.Network.__init__
Examples
From a touchstone
>>> n = rf.Network(’ntwk1.s2p’)
skrf.network.Network.add_noise_polar
skrf.network.Network.add_noise_polar_flatband
skrf.network.Network.copy
Network.copy()
Returns a copy of this Network
Needed to allow pass-by-value for a Network instead of pass-by-reference
skrf.network.Network.copy_from
Network.copy_from(other)
Copies the contents of another Network into self
Uses copy, so that the data is passed-by-value, not reference
Examples
>>> a = rf.N()
>>> b = rf.N(’my_file.s2p’)
>>> a.copy_from (b)
skrf.network.Network.crop
Network.crop(f_start, f_stop)
Crop Network based on start and stop frequencies.
No interpolation is done.
Parameters f_start : number
start frequency of crop range, in units of self.frequency.unit
f_stop : number
stop frequency of crop range, in units of self.frequency.unit
skrf.network.Network.cropped
Network.cropped(f_start, f_stop)
returns a cropped network, leaves self alone.
See Also:
crop
skrf.network.Network.flip
Network.flip()
swaps the ports of a two port Network
skrf.network.Network.flipped
Network.flipped()
returns a flipped network, leaves self alone.
See Also:
flip
skrf.network.Network.func_on_parameter
This is useful for functions that can only operate on 2d arrays, like numpy.linalg.inv. This loops over f and calls
func(ntwkA.s[f,:,:], *args, **kwargs)
Parameters func : func
function to apply to s-parameters, on a single-freqency slice. (ie func(ntwkA.s[0,:,:],
*args, **kwargs)
*args, **kwargs : :
passed to the func
Examples
skrf.network.Network.interpolate
Network.interpolate(new_frequency, **kwargs)
Return an interpolated network, from a new :class:’~skrf.frequency.Frequency’.
Interpolate the networks s-parameters linearly in real and imaginary components. Other interpolation types
can be used by passing appropriate **kwargs. This function returns an interpolated Network. Alternatively
interpolate_self() will interpolate self.
Parameters new_frequency : Frequency
frequency information to interpolate
**kwargs : keyword arguments
passed to scipy.interpolate.interp1d() initializer.
Returns result : Network
an interpolated Network
See Also:
resample, interpolate_self, interpolate_from_f
Notes
Examples
In [2]: n = rf.data.ring_slot
In [3]: n
Out[3]: 2-Port Network: ’ring slot’, 75-110 GHz, 201 pts, z0=[ 50.+0.j 50.+0.j]
skrf.network.Network.interpolate_from_f
Notes
This creates a new Frequency, object using the method from_f(), and then calls
interpolate_self().
skrf.network.Network.interpolate_self
Network.interpolate_self(new_frequency, **kwargs)
Interpolates s-parameters given a new :class:’~skrf.frequency.Frequency’ object.
See interpolate() for more information.
Parameters new_frequency : Frequency
frequency information to interpolate at
**kwargs : keyword arguments
passed to scipy.interpolate.interp1d() initializer.
See Also:
resample, interpolate, interpolate_from_f
skrf.network.Network.interpolate_self_npoints
Network.interpolate_self_npoints(npoints, **kwargs)
Interpolate network based on a new number of frequency points
Parameters npoints : int
number of frequency points
**kwargs : keyword arguments
passed to scipy.interpolate.interp1d() initializer.
See Also:
Notes
Examples
In [2]: n = rf.data.ring_slot
In [3]: n
Out[3]: 2-Port Network: ’ring slot’, 75-110 GHz, 201 pts, z0=[ 50.+0.j 50.+0.j]
In [5]: n
Out[5]: 2-Port Network: ’ring slot’, 75-110 GHz, 501 pts, z0=[ 50.+0.j 50.+0.j]
skrf.network.Network.multiply_noise
skrf.network.Network.nonreciprocity
Network.nonreciprocity(m, n, normalize=False)
Normalized non-reciprocity metrica
This is a port-by-port measure of how non-reciprocal a n-port network is. It is defined by,
p
(Smn − Snm )/ (Smn Snm )
skrf.network.Network.nudge
Network.nudge(amount=1e-12)
Perturb s-parameters by small amount.
This is useful to work-around numerical bugs.
Parameters amount : number,
amount to add to s parameters
Notes
skrf.network.Network.plot_a_arcl
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_a_arcl(m=1,n=0,color=’r’)
skrf.network.Network.plot_a_arcl_unwrap
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_a_arcl_unwrap(m=1,n=0,color=’r’)
skrf.network.Network.plot_a_complex
show_legend : Boolean
draw legend or not
attribute : string
Network attribute to plot
y_label : string, optional
the y-axis label
*args,**kwargs : arguments, keyword arguments
passed to matplotlib.plot()
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_a(m=1,n=0,color=’r’)
skrf.network.Network.plot_a_db
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_a_db(m=1,n=0,color=’r’)
skrf.network.Network.plot_a_db10
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_a_db10(m=1,n=0,color=’r’)
skrf.network.Network.plot_a_deg
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_a_deg(m=1,n=0,color=’r’)
skrf.network.Network.plot_a_deg_unwrap
show_legend : Boolean
draw legend or not
attribute : string
Network attribute to plot
y_label : string, optional
the y-axis label
*args,**kwargs : arguments, keyword arguments
passed to matplotlib.plot()
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_a_deg_unwrap(m=1,n=0,color=’r’)
skrf.network.Network.plot_a_im
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_a_im(m=1,n=0,color=’r’)
skrf.network.Network.plot_a_mag
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_a_mag(m=1,n=0,color=’r’)
skrf.network.Network.plot_a_passivity
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_a_passivity(m=1,n=0,color=’r’)
skrf.network.Network.plot_a_polar
show_legend : Boolean
draw legend or not
attribute : string
Network attribute to plot
y_label : string, optional
the y-axis label
*args,**kwargs : arguments, keyword arguments
passed to matplotlib.plot()
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_a(m=1,n=0,color=’r’)
skrf.network.Network.plot_a_rad
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_a_rad(m=1,n=0,color=’r’)
skrf.network.Network.plot_a_rad_unwrap
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_a_rad_unwrap(m=1,n=0,color=’r’)
skrf.network.Network.plot_a_re
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_a_re(m=1,n=0,color=’r’)
skrf.network.Network.plot_a_reciprocity
show_legend : Boolean
draw legend or not
attribute : string
Network attribute to plot
y_label : string, optional
the y-axis label
*args,**kwargs : arguments, keyword arguments
passed to matplotlib.plot()
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_a_reciprocity(m=1,n=0,color=’r’)
skrf.network.Network.plot_a_time
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_a_time(m=1,n=0,color=’r’)
skrf.network.Network.plot_a_time_db
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_a_time_db(m=1,n=0,color=’r’)
skrf.network.Network.plot_a_time_mag
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_a_time_mag(m=1,n=0,color=’r’)
skrf.network.Network.plot_a_vswr
show_legend : Boolean
draw legend or not
attribute : string
Network attribute to plot
y_label : string, optional
the y-axis label
*args,**kwargs : arguments, keyword arguments
passed to matplotlib.plot()
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_a_vswr(m=1,n=0,color=’r’)
skrf.network.Network.plot_it_all
Network.plot_it_all(*args, **kwargs)
skrf.network.Network.plot_s_arcl
passed to matplotlib.plot()
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_s_arcl(m=1,n=0,color=’r’)
skrf.network.Network.plot_s_arcl_unwrap
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_s_arcl_unwrap(m=1,n=0,color=’r’)
skrf.network.Network.plot_s_complex
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_s(m=1,n=0,color=’r’)
skrf.network.Network.plot_s_db
show_legend : Boolean
draw legend or not
attribute : string
Network attribute to plot
y_label : string, optional
the y-axis label
*args,**kwargs : arguments, keyword arguments
passed to matplotlib.plot()
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_s_db(m=1,n=0,color=’r’)
skrf.network.Network.plot_s_db10
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_s_db10(m=1,n=0,color=’r’)
skrf.network.Network.plot_s_db_time
Network.plot_s_db_time(*args, **kwargs)
skrf.network.Network.plot_s_deg
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_s_deg(m=1,n=0,color=’r’)
skrf.network.Network.plot_s_deg_unwrap
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_s_deg_unwrap(m=1,n=0,color=’r’)
skrf.network.Network.plot_s_im
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_s_im(m=1,n=0,color=’r’)
skrf.network.Network.plot_s_mag
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_s_mag(m=1,n=0,color=’r’)
skrf.network.Network.plot_s_passivity
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_s_passivity(m=1,n=0,color=’r’)
skrf.network.Network.plot_s_polar
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_s(m=1,n=0,color=’r’)
skrf.network.Network.plot_s_rad
show_legend : Boolean
draw legend or not
attribute : string
Network attribute to plot
y_label : string, optional
the y-axis label
*args,**kwargs : arguments, keyword arguments
passed to matplotlib.plot()
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_s_rad(m=1,n=0,color=’r’)
skrf.network.Network.plot_s_rad_unwrap
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_s_rad_unwrap(m=1,n=0,color=’r’)
skrf.network.Network.plot_s_re
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_s_re(m=1,n=0,color=’r’)
skrf.network.Network.plot_s_reciprocity
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_s_reciprocity(m=1,n=0,color=’r’)
skrf.network.Network.plot_s_smith
Examples
>>> myntwk.plot_s_smith()
>>> myntwk.plot_s_smith(m=0,n=1,color=’b’, marker=’x’)
skrf.network.Network.plot_s_time
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_s_time(m=1,n=0,color=’r’)
skrf.network.Network.plot_s_time_db
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_s_time_db(m=1,n=0,color=’r’)
skrf.network.Network.plot_s_time_mag
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_s_time_mag(m=1,n=0,color=’r’)
skrf.network.Network.plot_s_vswr
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_s_vswr(m=1,n=0,color=’r’)
skrf.network.Network.plot_y_arcl
passed to matplotlib.plot()
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_y_arcl(m=1,n=0,color=’r’)
skrf.network.Network.plot_y_arcl_unwrap
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_y_arcl_unwrap(m=1,n=0,color=’r’)
skrf.network.Network.plot_y_complex
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_y(m=1,n=0,color=’r’)
skrf.network.Network.plot_y_db
show_legend : Boolean
draw legend or not
attribute : string
Network attribute to plot
y_label : string, optional
the y-axis label
*args,**kwargs : arguments, keyword arguments
passed to matplotlib.plot()
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_y_db(m=1,n=0,color=’r’)
skrf.network.Network.plot_y_db10
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_y_db10(m=1,n=0,color=’r’)
skrf.network.Network.plot_y_deg
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_y_deg(m=1,n=0,color=’r’)
skrf.network.Network.plot_y_deg_unwrap
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_y_deg_unwrap(m=1,n=0,color=’r’)
skrf.network.Network.plot_y_im
show_legend : Boolean
draw legend or not
attribute : string
Network attribute to plot
y_label : string, optional
the y-axis label
*args,**kwargs : arguments, keyword arguments
passed to matplotlib.plot()
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_y_im(m=1,n=0,color=’r’)
skrf.network.Network.plot_y_mag
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_y_mag(m=1,n=0,color=’r’)
skrf.network.Network.plot_y_passivity
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_y_passivity(m=1,n=0,color=’r’)
skrf.network.Network.plot_y_polar
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_y(m=1,n=0,color=’r’)
skrf.network.Network.plot_y_rad
show_legend : Boolean
draw legend or not
attribute : string
Network attribute to plot
y_label : string, optional
the y-axis label
*args,**kwargs : arguments, keyword arguments
passed to matplotlib.plot()
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_y_rad(m=1,n=0,color=’r’)
skrf.network.Network.plot_y_rad_unwrap
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_y_rad_unwrap(m=1,n=0,color=’r’)
skrf.network.Network.plot_y_re
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_y_re(m=1,n=0,color=’r’)
skrf.network.Network.plot_y_reciprocity
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_y_reciprocity(m=1,n=0,color=’r’)
skrf.network.Network.plot_y_time
show_legend : Boolean
draw legend or not
attribute : string
Network attribute to plot
y_label : string, optional
the y-axis label
*args,**kwargs : arguments, keyword arguments
passed to matplotlib.plot()
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_y_time(m=1,n=0,color=’r’)
skrf.network.Network.plot_y_time_db
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_y_time_db(m=1,n=0,color=’r’)
skrf.network.Network.plot_y_time_mag
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_y_time_mag(m=1,n=0,color=’r’)
skrf.network.Network.plot_y_vswr
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_y_vswr(m=1,n=0,color=’r’)
skrf.network.Network.plot_z_arcl
show_legend : Boolean
draw legend or not
attribute : string
Network attribute to plot
y_label : string, optional
the y-axis label
*args,**kwargs : arguments, keyword arguments
passed to matplotlib.plot()
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_z_arcl(m=1,n=0,color=’r’)
skrf.network.Network.plot_z_arcl_unwrap
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_z_arcl_unwrap(m=1,n=0,color=’r’)
skrf.network.Network.plot_z_complex
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_z(m=1,n=0,color=’r’)
skrf.network.Network.plot_z_db
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_z_db(m=1,n=0,color=’r’)
skrf.network.Network.plot_z_db10
show_legend : Boolean
draw legend or not
attribute : string
Network attribute to plot
y_label : string, optional
the y-axis label
*args,**kwargs : arguments, keyword arguments
passed to matplotlib.plot()
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_z_db10(m=1,n=0,color=’r’)
skrf.network.Network.plot_z_deg
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_z_deg(m=1,n=0,color=’r’)
skrf.network.Network.plot_z_deg_unwrap
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_z_deg_unwrap(m=1,n=0,color=’r’)
skrf.network.Network.plot_z_im
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_z_im(m=1,n=0,color=’r’)
skrf.network.Network.plot_z_mag
show_legend : Boolean
draw legend or not
attribute : string
Network attribute to plot
y_label : string, optional
the y-axis label
*args,**kwargs : arguments, keyword arguments
passed to matplotlib.plot()
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_z_mag(m=1,n=0,color=’r’)
skrf.network.Network.plot_z_passivity
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_z_passivity(m=1,n=0,color=’r’)
skrf.network.Network.plot_z_polar
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_z(m=1,n=0,color=’r’)
skrf.network.Network.plot_z_rad
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_z_rad(m=1,n=0,color=’r’)
skrf.network.Network.plot_z_rad_unwrap
show_legend : Boolean
draw legend or not
attribute : string
Network attribute to plot
y_label : string, optional
the y-axis label
*args,**kwargs : arguments, keyword arguments
passed to matplotlib.plot()
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_z_rad_unwrap(m=1,n=0,color=’r’)
skrf.network.Network.plot_z_re
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_z_re(m=1,n=0,color=’r’)
skrf.network.Network.plot_z_reciprocity
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_z_reciprocity(m=1,n=0,color=’r’)
skrf.network.Network.plot_z_time
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_z_time(m=1,n=0,color=’r’)
skrf.network.Network.plot_z_time_db
show_legend : Boolean
draw legend or not
attribute : string
Network attribute to plot
y_label : string, optional
the y-axis label
*args,**kwargs : arguments, keyword arguments
passed to matplotlib.plot()
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_z_time_db(m=1,n=0,color=’r’)
skrf.network.Network.plot_z_time_mag
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_z_time_mag(m=1,n=0,color=’r’)
skrf.network.Network.plot_z_vswr
Notes
This function is dynamically generated upon Network initialization. This is accomplished by calling
plot_vs_frequency_generic()
Examples
>>> myntwk.plot_z_vswr(m=1,n=0,color=’r’)
skrf.network.Network.read
Network.read(*args, **kwargs)
Read a Network from a ‘ntwk’ file
A ntwk file is written with write(). It is just a pickled file.
Parameters *args, **kwargs : args and kwargs
passed to skrf.io.general.write()
See Also:
write, skrf.io.general.write, skrf.io.general.read
Notes
Examples
>>> rf.read(’myfile.ntwk’)
>>> rf.read(’myfile.p’)
skrf.network.Network.read_touchstone
Network.read_touchstone(filename)
loads values from a touchstone file.
The work of this function is done through the touchstone class.
Parameters filename : str or file-object
touchstone file name.
Notes
skrf.network.Network.renumber
Network.renumber(from_ports, to_ports)
renumbers some ports of a two port Network
Parameters from_ports : list-like
to_ports: list-like :
Examples
To flip the ports of a 2-port network ‘foo’: >>> foo.renumber( [0,1], [1,0] )
To rotate the ports of a 3-port network ‘bar’ so that port 0 becomes port 1: >>> bar.renumber( [0,1,2], [1,2,0] )
To swap the first and last ports of a network ‘duck’: >>> duck.renumber( [0,-1], [-1,0] )
skrf.network.Network.resample
Network.resample(npoints, **kwargs)
Interpolate network based on a new number of frequency points
Parameters npoints : int
number of frequency points
**kwargs : keyword arguments
passed to scipy.interpolate.interp1d() initializer.
See Also:
Notes
Examples
In [2]: n = rf.data.ring_slot
In [3]: n
Out[3]: 2-Port Network: ’ring slot’, 75-110 GHz, 501 pts, z0=[ 50.+0.j 50.+0.j]
In [5]: n
Out[5]: 2-Port Network: ’ring slot’, 75-110 GHz, 501 pts, z0=[ 50.+0.j 50.+0.j]
skrf.network.Network.time_gate
skrf.network.Network.to_dataframe
Network.to_dataframe(*args, **kwargs)
Convert attributes of a Network to a pandas DataFrame
See Also:
skrf.io.general.network_2_dataframe
skrf.network.Network.windowed
References
Examples
skrf.network.Network.write
Notes
If the self.name is not None and file is can left as None and the resultant file will have the .ntwk extension
appended to the filename.
Examples
skrf.network.Network.write_spreadsheet
Network.write_spreadsheet(*args, **kwargs)
Write contents of network to a spreadsheet, for your boss to use.
See Also:
skrf.io.general.network_2_spreadsheet
skrf.network.Network.write_touchstone
Notes
The functionality of this function should take place in the touchstone class.
skrf.network.connect
Notes
the effect of mis-matched port impedances is handled by inserting a 2-port ‘mismatch’ network between the two
connected ports. This mismatch Network is calculated with the impedance_mismatch() function.
Examples
skrf.network.innerconnect
skrf.network.innerconnect(ntwkA, k, l, num=1)
connect ports of a single n-port network.
this results in a (n-2)-port network. remember port indices start from 0.
Parameters ntwkA : Network
network ‘A’
k,l : int
starting port indices on ntwkA ( port indices start from 0 )
num : int
number of consecutive ports to connect
Returns ntwkC : Network
new network of rank (ntwkA.nports - 2*num)
See Also:
Notes
a 2-port ‘mismatch’ network is inserted between the connected ports if their impedances are not equal.
Examples
skrf.network.cascade
skrf.network.cascade(ntwkA, ntwkB)
Cascade two 2-port Networks together
Connects port 1 of ntwkA to port 0 of ntwkB. This calls connect(ntwkA,1, ntwkB,0), which is a more general
function.
Parameters ntwkA : Network
network ntwkA
ntwkB : Network
network ntwkB
Returns C : Network
the resultant network of ntwkA cascaded with ntwkB
See Also:
skrf.network.de_embed
skrf.network.de_embed(ntwkA, ntwkB)
De-embed ntwkA from ntwkB.
This calls ntwkA.inv ** ntwkB. The syntax of cascading an inverse is more explicit, it is recomended that it be
used instead of this function.
Parameters ntwkA : Network
network ntwkA
ntwkB : Network
network ntwkB
Returns C : Network
the resultant network of ntwkB de-embeded from ntwkA
See Also:
skrf.network.flip
skrf.network.flip(a)
invert the ports of a networks s-matrix, ‘flipping’ it over
Parameters a : numpy.ndarray
scattering parameter matrix. shape should be should be 2x2, or fx2x2
Returns a’ : numpy.ndarray
flipped scattering parameter matrix, ie interchange of port 0 and port 1
skrf.network.stitch
Examples
skrf.network.overlap
skrf.network.overlap(ntwkA, ntwkB)
Returns the overlapping parts of two Networks, interpolating if needed.
If frequency vectors for each ntwk dont perfectly overlap, then ntwkB is interpolated so that the resultant net-
works have identical frequencies.
Parameters ntwkA : Network
a ntwk which overlaps ntwkB. (the dominant network)
ntwkB : Network
a ntwk which overlaps ntwkA.
Returns ntwkA_new : Network
part of ntwkA that overlapped ntwkB
ntwkB_new : Network
part of ntwkB that overlapped ntwkA, possibly interpolated
See Also:
skrf.frequency.overlap_freq()
skrf.network.Network.resample
Network.resample(npoints, **kwargs)
Interpolate network based on a new number of frequency points
Parameters npoints : int
number of frequency points
**kwargs : keyword arguments
passed to scipy.interpolate.interp1d() initializer.
See Also:
interpolate same functionality but takes a Frequency object and returns a new Network, instead of updat-
ing itself.
Notes
Examples
In [2]: n = rf.data.ring_slot
In [3]: n
Out[3]: 2-Port Network: ’ring slot’, 75-110 GHz, 501 pts, z0=[ 50.+0.j 50.+0.j]
In [5]: n
Out[5]: 2-Port Network: ’ring slot’, 75-110 GHz, 501 pts, z0=[ 50.+0.j 50.+0.j]
skrf.network.Network.interpolate
Network.interpolate(new_frequency, **kwargs)
Return an interpolated network, from a new :class:’~skrf.frequency.Frequency’.
Interpolate the networks s-parameters linearly in real and imaginary components. Other interpolation types
can be used by passing appropriate **kwargs. This function returns an interpolated Network. Alternatively
interpolate_self() will interpolate self.
Parameters new_frequency : Frequency
frequency information to interpolate
**kwargs : keyword arguments
passed to scipy.interpolate.interp1d() initializer.
Returns result : Network
an interpolated Network
See Also:
resample, interpolate_self, interpolate_from_f
Notes
Examples
In [2]: n = rf.data.ring_slot
In [3]: n
Out[3]: 2-Port Network: ’ring slot’, 75-110 GHz, 201 pts, z0=[ 50.+0.j 50.+0.j]
skrf.network.Network.interpolate_self
Network.interpolate_self(new_frequency, **kwargs)
Interpolates s-parameters given a new :class:’~skrf.frequency.Frequency’ object.
See interpolate() for more information.
Parameters new_frequency : Frequency
frequency information to interpolate at
**kwargs : keyword arguments
passed to scipy.interpolate.interp1d() initializer.
See Also:
resample, interpolate, interpolate_from_f
skrf.network.Network.interpolate_from_f
Notes
This creates a new Frequency, object using the method from_f(), and then calls
interpolate_self().
10.2.4 IO
10.2.5 Noise
skrf.network.Network.add_noise_polar
skrf.network.Network.add_noise_polar_flatband
skrf.network.Network.multiply_noise
skrf.network.inv
skrf.network.inv(s)
Calculates ‘inverse’ s-parameter matrix, used for de-embeding
This is not literally the inverse of the s-parameter matrix. Instead, it is defined such that the inverse of the
s-matrix cascaded with itself is unity.
−1
inv(s) = t2s(s2t(s) )
where x−1 is the matrix inverse. In words, this is the inverse of the scattering transfer parameters matrix
transformed into a scattering parameters matrix.
Parameters s : numpy.ndarray (shape fx2x2)
scattering parameter matrix.
Returns s’ : numpy.ndarray
inverse scattering parameter matrix.
See Also:
skrf.network.connect_s
skrf.network.connect_s(A, k, B, l)
connect two n-port networks’ s-matricies together.
specifically, connect port k on network A to port l on network B. The resultant network has nports = (A.rank +
B.rank-2). This function operates on, and returns s-matricies. The function connect() operates on Network
types.
Parameters A : numpy.ndarray
S-parameter matrix of A, shape is fxnxn
k : int
port index on A (port indices start from 0)
B : numpy.ndarray
S-parameter matrix of B, shape is fxnxn
l : int
port index on B
Returns C : numpy.ndarray
new S-parameter matrix
See Also:
Notes
internally, this function creates a larger composite network and calls the innerconnect_s() function. see
that function for more details about the implementation
skrf.network.innerconnect_s
skrf.network.innerconnect_s(A, k, l)
connect two ports of a single n-port network’s s-matrix.
Specifically, connect port k to port l on A. This results in a (n-2)-port network. This function operates on, and
returns s-matricies. The function innerconnect() operates on Network types.
Parameters A : numpy.ndarray
S-parameter matrix of A, shape is fxnxn
k : int
port index on A (port indices start from 0)
l : int
port index on A
Returns C : numpy.ndarray
new S-parameter matrix
Notes
The algorithm used to calculate the resultant network is called a ‘sub-network growth’, can be found in 7 . The
original paper describing the algorithm is given in 8 .
7 Compton, R.C.; , “Perspectives in microwave circuit analysis,” Circuits and Systems, 1989., Proceedings of the 32nd Midwest Symposium on
References
skrf.network.s2z
skrf.network.s2z(s, z0=50)
Convert scattering parameters 9 to impedance parameters 10
√ √
z= z0 · (I + s)(I − s)−1 · z0
References
skrf.network.s2y
skrf.network.s2y(s, z0=50)
convert scattering parameters 11 to admittance parameters 12
√ √
y= y0 · (I − s)(I + s)−1 · y0
References
skrf.network.s2t
skrf.network.s2t(s)
Converts scattering parameters 13 to scattering transfer parameters 14 .
transfer parameters are also refered to as ‘wave cascading matrix’, this function only operates on 2-port net-
works.
Parameters s : numpy.ndarray (shape fx2x2)
scattering parameter matrix
Returns t : numpy.ndarray
scattering transfer parameters (aka wave cascading matrix)
See Also:
s2z, s2y, s2t, z2s, z2y, z2t, y2s, y2z, y2z, t2s, t2z, t2y, Network.s, Network.y, Network.z,
Network.t
References
skrf.network.z2s
skrf.network.z2s(z, z0=50)
convert impedance parameters 15 to scattering parameters 16
√ √ √ √
s = ( y0 · z · y0 − I)( y0 · z · y0 + I)−1
References
skrf.network.z2y
skrf.network.z2y(z)
convert impedance parameters 17 to admittance parameters 18
y = z −1
References
skrf.network.z2t
skrf.network.z2t(z)
Not Implemented yet
convert impedance parameters 19 to scattering transfer parameters 20
Parameters z : complex array-like or number
impedance parameters
Returns s : complex array-like or number
scattering parameters
See Also:
s2z, s2y, s2t, z2s, z2y, z2t, y2s, y2z, y2z, t2s, t2z, t2y, Network.s, Network.y, Network.z,
Network.t
17 http://en.wikipedia.org/wiki/impedance_parameters
18 http://en.wikipedia.org/wiki/Admittance_parameters
19 http://en.wikipedia.org/wiki/impedance_parameters
20 http://en.wikipedia.org/wiki/Scattering_transfer_parameters#Scattering_transfer_parameters
References
skrf.network.y2s
skrf.network.y2s(y, z0=50)
convert admittance parameters 21 to scattering parameters 22
√ √ √ √
s = (I − z0 · y · z0 )(I + z0 · y · z0 )−1
References
skrf.network.y2z
skrf.network.y2z(y)
convert admittance parameters 23 to impedance parameters 24
z = y −1
References
skrf.network.y2t
skrf.network.y2t(y)
Not Implemented Yet
convert admittance parameters 25 to scattering-transfer parameters 26
Parameters y : complex array-like or number
impedance parameters
Returns t : complex array-like or number
scattering parameters
See Also:
s2z, s2y, s2t, z2s, z2y, z2t, y2s, y2z, y2z, t2s, t2z, t2y, Network.s, Network.y, Network.z,
Network.t
References
skrf.network.t2s
skrf.network.t2s(t)
converts scattering transfer parameters 27 to scattering parameters 28
transfer parameters are also refered to as ‘wave cascading matrix’, this function only operates on 2-port net-
works. this function only operates on 2-port scattering parameters.
Parameters t : numpy.ndarray (shape fx2x2)
scattering transfer parameters
Returns s : numpy.ndarray
scattering parameter matrix.
See Also:
s2z, s2y, s2t, z2s, z2y, z2t, y2s, y2z, y2z, t2s, t2z, t2y, Network.s, Network.y, Network.z,
Network.t
References
skrf.network.t2z
skrf.network.t2z(t)
Not Implemented Yet
25 http://en.wikipedia.org/wiki/Admittance_parameters
26 http://en.wikipedia.org/wiki/Scattering_transfer_parameters#Scattering_transfer_parameters
27 http://en.wikipedia.org/wiki/Scattering_transfer_parameters#Scattering_transfer_parameters
28 http://en.wikipedia.org/wiki/S-parameters
References
skrf.network.t2y
skrf.network.t2y(t)
Not Implemented Yet
Convert scattering transfer parameters to admittance parameters 31
Parameters t : complex array-like or number
t-parameters
Returns y : complex array-like or number
admittance parameters
See Also:
s2z, s2y, s2t, z2s, z2y, z2t, y2s, y2z, y2z, t2s, t2z, t2y, Network.s, Network.y, Network.z,
Network.t
References
skrf.network.average
skrf.network.average(list_of_networks)
Calculates the average network from a list of Networks.
This is complex average of the s-parameters for a list of Networks.
Parameters list_of_networks : list of Network objects
the list of networks to average
Returns ntwk : Network
29 http://en.wikipedia.org/wiki/Scattering_transfer_parameters#Scattering_transfer_parameters
30 http://en.wikipedia.org/wiki/impedance_parameters
31 http://en.wikipedia.org/wiki/Scattering_transfer_parameters#Scattering_transfer_parameters
Notes
Examples
skrf.network.Network.nudge
Network.nudge(amount=1e-12)
Perturb s-parameters by small amount.
This is useful to work-around numerical bugs.
Parameters amount : number,
amount to add to s parameters
Notes
skrf.networkSet.NetworkSet
objects.
This class also provides methods which can be used to plot uncertainty bounds for a set of Network.
The names of the NetworkSet properties are generated dynamically upon ititialization, and thus documenta-
tion for individual properties and methods is not available. However, the properties do follow the convention:
>>> my_network_set.function_name_network_property_name
For example, the complex average (mean) Network for a NetworkSet is:
>>> my_network_set.mean_s
This accesses the property ‘s’, for each element in the set, and then calculates the ‘mean’ of the resultant set.
The order of operations is important.
Results are returned as Network objects, so they may be plotted or saved in the same way as for Network
objects:
>>> my_network_set.mean_s.plot_s_mag()
>>> my_network_set.mean_s.write_touchstone(’mean_response’)
If you are calculating functions that return scalar variables, then the result is accessable through the Network
property .s_re. For example:
>>> std_s_deg = my_network_set.std_s_deg
The operators, properties, and methods of NetworkSet object are dynamically generated by private methods
•__add_a_operator()
•__add_a_func_on_property()
•__add_a_element_wise_method()
•__add_a_plot_uncertainty()
thus, documentation on the individual methods and properties are not available.
Attributes
inv
mean_s_db the mean magnitude in dB.
std_s_db the mean magnitude in dB.
skrf.networkSet.NetworkSet.inv
NetworkSet.inv
skrf.networkSet.NetworkSet.mean_s_db
NetworkSet.mean_s_db
the mean magnitude in dB.
note:
the mean is taken on the magnitude before convertedto db, so magnitude_2_db( mean(s_mag))
which is NOT the same as mean(s_db)
skrf.networkSet.NetworkSet.std_s_db
NetworkSet.std_s_db
the mean magnitude in dB.
note:
the mean is taken on the magnitude before convertedto db, so magnitude_2_db( mean(s_mag))
which is NOT the same as mean(s_db)
Methods
skrf.networkSet.NetworkSet.__init__
NetworkSet.__init__(ntwk_set, name=None)
Initializer for NetworkSet
Parameters ntwk_set : list of Network objects
the set of Network objects
name : string
the name of the NetworkSet, given to the Networks returned from properties of this
class.
skrf.networkSet.NetworkSet.add_polar_noise
NetworkSet.add_polar_noise(ntwk)
skrf.networkSet.NetworkSet.animate
Notes
using label=None will speed up animation significantly, because it prevents the legend from drawing
Examples
>>>ns.animate(‘s_deg’, ylims=(-5,5),label=None)
skrf.networkSet.NetworkSet.copy
NetworkSet.copy()
copies each network of the network set.
skrf.networkSet.NetworkSet.element_wise_method
skrf.networkSet.NetworkSet.from_dir
Examples
skrf.networkSet.NetworkSet.from_zip
Examples
skrf.networkSet.NetworkSet.ntwk_attr_2_df
Examples
skrf.networkSet.NetworkSet.plot_logsigma
skrf.networkSet.NetworkSet.plot_minmax_bounds_component
returns: None
Note: for phase uncertainty you probably want s_deg_unwrap, or similar. uncerainty for wrapped phase blows
up at +-pi.
skrf.networkSet.NetworkSet.plot_minmax_bounds_s_db
NetworkSet.plot_minmax_bounds_s_db(*args, **kwargs)
this just calls plot_uncertainty_bounds(attribute= ‘s_mag’,’ppf’:mf.magnitude_2_db*args,**kwargs)
see plot_uncertainty_bounds for help
skrf.networkSet.NetworkSet.plot_minmax_bounds_s_time_db
NetworkSet.plot_minmax_bounds_s_time_db(*args, **kwargs)
this just calls plot_uncertainty_bounds(attribute= ‘s_mag’,’ppf’:mf.magnitude_2_db*args,**kwargs)
see plot_uncertainty_bounds for help
skrf.networkSet.NetworkSet.plot_uncertainty_bounds_component
returns: None
Note: for phase uncertainty you probably want s_deg_unwrap, or similar. uncerainty for wrapped phase blows
up at +-pi.
skrf.networkSet.NetworkSet.plot_uncertainty_bounds_s
skrf.networkSet.NetworkSet.plot_uncertainty_bounds_s_db
NetworkSet.plot_uncertainty_bounds_s_db(*args, **kwargs)
this just calls plot_uncertainty_bounds(attribute= ‘s_mag’,’ppf’:mf.magnitude_2_db*args,**kwargs)
see plot_uncertainty_bounds for help
skrf.networkSet.NetworkSet.plot_uncertainty_bounds_s_time_db
NetworkSet.plot_uncertainty_bounds_s_time_db(*args, **kwargs)
this just calls plot_uncertainty_bounds(attribute= ‘s_mag’,’ppf’:mf.magnitude_2_db*args,**kwargs)
see plot_uncertainty_bounds for help
skrf.networkSet.NetworkSet.plot_uncertainty_decomposition
NetworkSet.plot_uncertainty_decomposition(m=0, n=0)
plots the total and component-wise uncertainty
Parameters m : int
first s-parameters index
n::
second s-parameter index
skrf.networkSet.NetworkSet.set_wise_function
skrf.networkSet.NetworkSet.signature
operation to apply between each network and the reference network, which is either the
mean, or the initial ntwk.
component : [’s_mag’,’s_db’,’s_deg’ ..]
scalar component of Network to plot on the imshow. should be a property of the Net-
work object.
vmax : number
sets upper limit of colorbar, if None, will be set to 3*mean of the magnitude of the
complex difference
*args,**kwargs : arguments, keyword arguments
passed to imshow()
skrf.networkSet.NetworkSet.to_dict
NetworkSet.to_dict()
Returns a dictionary representation of the NetworkSet
The returned dictionary has the Network names for keys, and the Networks as values.
skrf.networkSet.NetworkSet.uncertainty_ntwk_triplet
NetworkSet.uncertainty_ntwk_triplet(attribute, n_deviations=3)
returns a 3-tuple of Network objects which contain the mean, upper_bound, and lower_bound for the given
Network attribute.
Used to save and plot uncertainty information data
skrf.networkSet.NetworkSet.write
Notes
If the self.name is not None and file is can left as None and the resultant file will have the .ns extension appended
to the filename.
Examples
skrf.networkSet.NetworkSet.write_spreadsheet
NetworkSet.write_spreadsheet(*args, **kwargs)
Write contents of network to a spreadsheet, for your boss to use.
See Also:
skrf.io.general.network_2_spreadsheet
smith([smithR, chart_type, draw_labels, ...]) plots the smith chart of a given radius
plot_smith(z[, smith_r, chart_type, ...]) plot complex data on smith chart
plot_rectangular(x, y[, x_label, y_label, ...]) plots rectangular data and optionally label axes.
plot_polar(theta, r[, x_label, y_label, ...]) plots polar data on a polar plot and optionally label axes.
plot_complex_rectangular(z[, x_label, ...]) plot complex data on the complex plane
plot_complex_polar(z[, x_label, y_label, ...]) plot complex data in polar format.
skrf.plotting.smith
skrf.plotting.plot_smith
skrf.plotting.plot_rectangular
skrf.plotting.plot_polar
skrf.plotting.plot_complex_rectangular
skrf.plotting.plot_complex_polar
x_label : string
x-axis label
y_label : string
y-axis label
title : string
plot title
show_legend : Boolean
controls the drawing of the legend
ax : matplotlib.axes.AxesSubplot object
axes to draw on
*args,**kwargs : passed to pylab.plot
See Also:
skrf.plotting.save_all_figs
skrf.plotting.add_markers_to_lines
skrf.plotting.legend_off
skrf.plotting.legend_off(ax=None)
turn off the legend for a given axes.
if no axes is given then it will use current axes.
Parameters ax : matplotlib.Axes object
axes to operate on
skrf.plotting.func_on_all_figs
Examples
>>> rf.func_on_all_figs(grid,alpha=.3)
complex_2_reim(z) takes:
complex_2_magnitude(input) returns the magnitude of a complex number.
complex_2_db(input) returns the magnitude in dB of a complex number.
complex_2_radian(input) returns the angle complex number in radians.
complex_2_degree(input) returns the angle complex number in radians.
complex_2_magnitude(input) returns the magnitude of a complex number.
skrf.mathFunctions.complex_2_reim
skrf.mathFunctions.complex_2_reim(z)
takes: input: complex number or array
return: real: real part of input imag: imaginary part of input
note: this just calls ‘complex_components’
skrf.mathFunctions.complex_2_magnitude
skrf.mathFunctions.complex_2_magnitude(input)
returns the magnitude of a complex number.
skrf.mathFunctions.complex_2_db
skrf.mathFunctions.complex_2_db(input)
returns the magnitude in dB of a complex number.
returns: 20*log10(|z|)
where z is a complex number
skrf.mathFunctions.complex_2_radian
skrf.mathFunctions.complex_2_radian(input)
returns the angle complex number in radians.
skrf.mathFunctions.complex_2_degree
skrf.mathFunctions.complex_2_degree(input)
returns the angle complex number in radians.
skrf.mathFunctions.complex_2_magnitude
skrf.mathFunctions.complex_2_magnitude(input)
returns the magnitude of a complex number.
Continued on next page
skrf.mathFunctions.unwrap_rad
skrf.mathFunctions.unwrap_rad(input)
unwraps a phase given in radians
skrf.mathFunctions.sqrt_phase_unwrap
skrf.mathFunctions.sqrt_phase_unwrap(input)
takes the square root of a complex number with unwraped phase
this idea came from Lihan Chen
radian_2_degree(rad)
degree_2_radian(deg)
np_2_db(x) converts a value in dB to neper’s
db_2_np(x) converts a value in nepers to dB
skrf.mathFunctions.radian_2_degree
skrf.mathFunctions.radian_2_degree(rad)
skrf.mathFunctions.degree_2_radian
skrf.mathFunctions.degree_2_radian(deg)
skrf.mathFunctions.np_2_db
skrf.mathFunctions.np_2_db(x)
converts a value in dB to neper’s
skrf.mathFunctions.db_2_np
skrf.mathFunctions.db_2_np(x)
converts a value in nepers to dB
These conversions are useful for wrapping other functions that dont support complex numbers.
complex2Scalar(input)
scalar2Complex(input)
skrf.mathFunctions.complex2Scalar
skrf.mathFunctions.complex2Scalar(input)
skrf.mathFunctions.scalar2Complex
skrf.mathFunctions.scalar2Complex(input)
skrf.mathFunctions.dirac_delta
skrf.mathFunctions.dirac_delta(x)
the dirac function.
can take numpy arrays or numbers returns 1 or 0
skrf.mathFunctions.neuman
skrf.mathFunctions.neuman(x)
neumans number
2-dirac_delta(x)
skrf.mathFunctions.null
skrf.mathFunctions.null(A, eps=1e-15)
calculates the null space of matrix A. i found this on stack overflow.
These functions relate basic tranmission line quantities such as characteristic impedance, input impedance, reflection
coefficient, etc. Each function has two names. One is a long-winded but readable name and the other is a short-hand
variable-like names. Below is a table relating these two names with each other as well as common mathematical
symbols.
Symbol Variable Name Long Name
Zl z_l load_impedance
Zin z_in input_impedance
Γ0 Gamma_0 reflection_coefficient
Γin Gamma_in reflection_coefficient_at_theta
θ theta electrical_length
There may be a bit of confusion about the difference between the load impedance the input impedance. This is because
the load impedance is the input impedance at the load. An illustration may provide some useful reference.
Below is a (bad) illustration of a section of uniform transmission line of characteristic impedance Z0 , and electrical
length θ. The line is terminated on the right with some load impedance, Zl . The input impedance Zin and input
reflection coefficient Γin are looking in towards the load from the distance θ from the load.
Z0 , θ
o===============o=[Zl ]
→ →
Zin , Γin Z l , Γ0
Zin = Zl , Γin = Γl at θ = 0
Short names
theta(gamma, f, d[, deg]) Calculates the electrical length of a section of transmission line.
zl_2_Gamma0(z0, zl) Returns the reflection coefficient for a given load impedance, and characteristic impedanc
Gamma0_2_zl(z0, Gamma) calculates the input impedance given a reflection coefficient and
zl_2_zin(z0, zl, theta) input impedance of load impedance zl at a given electrical length,
zl_2_Gamma_in(z0, zl, theta)
Gamma0_2_Gamma_in(Gamma0, theta) reflection coefficient at a given electrical length.
Gamma0_2_zin(z0, Gamma0, theta) calculates the input impedance at electrical length theta, given a
skrf.tlineFunctions.theta
skrf.tlineFunctions.theta(gamma, f, d, deg=False)
Calculates the electrical length of a section of transmission line.
θ = γ(f ) · d
l : number or array-like
length of line, in meters
f : number or array-like
frequency at which to calculate
deg : Boolean
return in degrees or not.
Returns theta : number or array-like
electrical length in radians or degrees, depending on value of deg.
See Also:
Notes
the convention has been chosen that forward propagation is represented by the positive imaginary part of the
value returned by the gamma function
skrf.tlineFunctions.zl_2_Gamma0
skrf.tlineFunctions.zl_2_Gamma0(z0, zl)
Returns the reflection coefficient for a given load impedance, and characteristic impedance.
For a transmission line of characteristic impedance Z0 terminated with load impedance Zl , the complex reflec-
tion coefficient is given by,
Zl − Z0
Γ=
Zl + Z0
Notes
skrf.tlineFunctions.Gamma0_2_zl
skrf.tlineFunctions.Gamma0_2_zl(z0, Gamma)
calculates the input impedance given a reflection coefficient and characterisitc impedance
1+Γ
Z0 ( )
1−Γ
skrf.tlineFunctions.zl_2_zin
skrf.tlineFunctions.zl_2_Gamma_in
skrf.tlineFunctions.Gamma0_2_Gamma_in
skrf.tlineFunctions.Gamma0_2_Gamma_in(Gamma0, theta)
reflection coefficient at a given electrical length.
Γin = Γ0 e−2jθ
skrf.tlineFunctions.Gamma0_2_zin
Long-names
skrf.tlineFunctions.distance_2_electrical_length
skrf.tlineFunctions.distance_2_electrical_length(gamma, f, d, deg=False)
Calculates the electrical length of a section of transmission line.
θ = γ(f ) · d
Notes
the convention has been chosen that forward propagation is represented by the positive imaginary part of the
value returned by the gamma function
skrf.tlineFunctions.electrical_length_2_distance
θ
d=
γ(f0 )
Notes
the convention has been chosen that forward propagation is represented by the positive imaginary part of the
value returned by the gamma function
skrf.tlineFunctions.reflection_coefficient_at_theta
skrf.tlineFunctions.reflection_coefficient_at_theta(Gamma0, theta)
reflection coefficient at a given electrical length.
Γin = Γ0 e−2jθ
skrf.tlineFunctions.reflection_coefficient_2_input_impedance
skrf.tlineFunctions.reflection_coefficient_2_input_impedance(z0, Gamma)
calculates the input impedance given a reflection coefficient and characterisitc impedance
1+Γ
Z0 ( )
1−Γ
skrf.tlineFunctions.reflection_coefficient_2_input_impedance_at_theta
skrf.tlineFunctions.reflection_coefficient_2_input_impedance_at_theta(z0,
Gamma0,
theta)
calculates the input impedance at electrical length theta, given a reflection coefficient and characterisitc
impedance of the medium Parameters ———-
z0 - characteristic impedance. Gamma: reflection coefficient theta: electrical length of the line, (may
be complex)
skrf.tlineFunctions.input_impedance_at_theta
skrf.tlineFunctions.load_impedance_2_reflection_coefficient
skrf.tlineFunctions.load_impedance_2_reflection_coefficient(z0, zl)
Returns the reflection coefficient for a given load impedance, and characteristic impedance.
For a transmission line of characteristic impedance Z0 terminated with load impedance Zl , the complex reflec-
tion coefficient is given by,
Zl − Z0
Γ=
Zl + Z0
Notes
skrf.tlineFunctions.load_impedance_2_reflection_coefficient_at_theta
skrf.tlineFunctions.load_impedance_2_reflection_coefficient_at_theta(z0, zl,
theta)
skrf.tlineFunctions.distributed_circuit_2_propagation_impedance
skrf.tlineFunctions.distributed_circuit_2_propagation_impedance(distributed_admittance,
dis-
tributed_impedance)
Converts distrubuted circuit values to wave quantities.
This converts complex distributed impedance and admittance to propagation constant and characteristic
impedance. The relation is
√
r 0
Z
Z0 = 0 γ = Z0 Y 0
Y
skrf.tlineFunctions.propagation_impedance_2_distributed_circuit
skrf.tlineFunctions.propagation_impedance_2_distributed_circuit(propagation_constant,
characteris-
tic_impedance)
Converts wave quantities to distrubuted circuit values.
Converts complex propagation constant and characteristic impedance to distributed impedance and admittance.
The relation is,
0 0 γ
Z = γZ0 Y =
Z0
skrf.tlineFunctions.skin_depth
skrf.tlineFunctions.surface_resistivity
Frequency Objects
These are predefined Frequency objects that correspond to standard waveguide bands. This information is taken
from the VDI Application Note 1002 32 .
Object Name Description
f_wr10 WR-10, 75-110 GHz
f_wr3 WR-3, 220-325 GHz
f_wr2p2 WR-2.2, 330-500 GHz
f_wr1p5 WR-1.5, 500-750 GHz
f_wr1 WR-1, 750-1100 GHz
... ...
32 VDI Application Note: VDI Waveguide Band Designations (VDI-1002) http://vadiodes.com/VDI/pdf/waveguidechart200908.pdf
RectangularWaveguide Objects
Below is a list of shorthand object names which can be use to save some typing. These names are defined in the main
__init__ module.
Shorthand Full Object Name
F Frequency
N Network
NS NetworkSet
M Media
C Calibration
The following are shorthand names for commonly used, but unfortunately longwinded functions.
Shorthand Full Object Name
saf save_all_figs()
10.7.3 References
10.8.1 General
skrf.util.now_string
skrf.util.now_string()
returns a unique sortable string, representing the current time
nice for generating date-time stamps to be used in file-names, the companion function now_string_2_dt()
can be used to read these string back into datetime objects.
See Also:
now_string_2_dt
skrf.util.find_nearest
skrf.util.find_nearest(array, value)
find nearest value in array.
taken from http://stackoverflow.com/questions/2566412/find-nearest-value-in-numpy-array
Parameters array : numpy.ndarray
array we are searching for a value in
value : element of the array
value to search for
Returns found_value : an element of the array
the value that is numerically closest to value
skrf.util.find_nearest_index
skrf.util.find_nearest_index(array, value)
find nearest value in array.
Parameters array : numpy.ndarray
array we are searching for a value in
value : element of the array
value to search for
Returns found_index : int
the index at which the numerically closest element to value was found at
taken from http://stackoverflow.com/questions/2566412/find-nearest-value-in-numpy-
array :
skrf.util.get_fid
skrf.util.get_extn
skrf.util.get_extn(filename)
Get the extension from a filename.
The extension is defined as everything passed the last ‘.’. Returns None if it aint got one
Parameters filename : string
the filename
Returns ext : string, None
either the extension (not including ‘.’) or None if there isnt one
10.9 io (skrf.io)
skrf.io.general.read
Notes
if file is a file-object it is left open, if it is a filename then a file-object is opened and closed. If file is a file-object
and reading fails, then the position is reset back to 0 using seek if possible.
Examples
>>> n = rf.Network(f=[1,2,3],s=[1,1,1],z0=50)
>>> n.write(’my_ntwk.ntwk’)
>>> n_2 = rf.read(’my_ntwk.ntwk’)
skrf.io.general.read_all
Examples
>>> rf.read_all(’skrf/data/’)
{’delay_short’: 1-Port Network: ’delay_short’, 75-110 GHz, 201 pts, z0=[ 50.+0.j],
’line’: 2-Port Network: ’line’, 75-110 GHz, 201 pts, z0=[ 50.+0.j 50.+0.j],
’ntwk1’: 2-Port Network: ’ntwk1’, 1-10 GHz, 91 pts, z0=[ 50.+0.j 50.+0.j],
’one_port’: one port Calibration: ’one_port’, 500-750 GHz, 201 pts, 4-ideals/4-measured,
...
skrf.io.general.read_all_networks
skrf.io.general.read_all_networks(*args, **kwargs)
Read all networks in a directory.
This is a convenience function. It just calls:
read_all(*args,obj_type=’Network’, **kwargs)
See Also:
read_all
skrf.io.general.write
Notes
If file is a str, but doesnt contain a suffix, one is chosen automatically. Here are the extensions
skrf object extension
Frequency ‘.freq’
Network ‘.ntwk’
NetworkSet ‘.ns’
Calibration ‘.cal’
Media ‘.med’
other ‘.p’
To make file written by this method cross-platform, the pickling protocol 2 is used. See pickle for more info.
Examples
skrf.io.general.write_all
Notes
Examples
skrf.io.general.save_sesh
Examples
network_2_spreadsheet(ntwk[, file_name, ...]) Write a Network object to a spreadsheet, for your boss
networkset_2_spreadsheet(ntwkset[, ...]) Write a NetworkSet object to a spreadsheet, for your boss
skrf.io.general.network_2_spreadsheet
Notes
skrf.io.general.networkset_2_spreadsheet
file_type : [’csv’,’excel’,’html’]
the type of file to write. See pandas.DataFrame.to_??? functions.
form : ‘db’,’ma’,’ri’
format to write data, * db = db, deg * ma = mag, deg * ri = real, imag
*args, **kwargs : :
passed to pandas.DataFrame.to_??? functions.
See Also:
Notes
Touchstone class
skrf.io.touchstone.Touchstone
class skrf.io.touchstone.Touchstone(file)
class to read touchstone s-parameter files
The reference for writing this class is the draft of the Touchstone(R) File Format Specification Rev 2.0 33
Methods
__init__ constructor
get_comments Returns the comments which appear anywhere in the file.
get_format returns the file format string used for the given format.
get_noise_data TODO: NIY
get_noise_names TODO: NIY
get_sparameter_arrays returns the sparameters as a tuple of arrays, where the first element is
get_sparameter_data get the data of the sparameter with the given format.
get_sparameter_names generate a list of column names for the s-parameter data
load_file Load the touchstone file into the interal data structures
skrf.io.touchstone.Touchstone.__init__
Touchstone.__init__(file)
constructor
Parameters file : str or file-object
33 http://www.eda-stds.org/ibis/adhoc/interconnect/touchstone_spec2_draft.pdf
Examples
From filename
>>> t = rf.Touchstone(’network.s2p’)
From file-object
>>> file = open(’network.s2p’)
>>> t = rf.Touchstone(file)
skrf.io.touchstone.Touchstone.get_comments
skrf.io.touchstone.Touchstone.get_format
Touchstone.get_format(format=’ri’)
returns the file format string used for the given format. This is usefull to get some informations.
skrf.io.touchstone.Touchstone.get_noise_data
Touchstone.get_noise_data()
TODO: NIY
skrf.io.touchstone.Touchstone.get_noise_names
Touchstone.get_noise_names()
TODO: NIY
skrf.io.touchstone.Touchstone.get_sparameter_arrays
Touchstone.get_sparameter_arrays()
returns the sparameters as a tuple of arrays, where the first element is the frequency vector (in Hz) and the
s-parameters are a 3d numpy array. The values of the sparameters are complex number. usage:
f,a = self.sgetparameter_arrays() s11 = a[:,0,0]
skrf.io.touchstone.Touchstone.get_sparameter_data
Touchstone.get_sparameter_data(format=’ri’)
get the data of the sparameter with the given format. supported formats are:
orig: unmodified s-parameter data ri: data in real/imaginary ma: data in magnitude and angle (degree)
db: data in log magnitute and angle (degree)
skrf.io.touchstone.Touchstone.get_sparameter_names
Touchstone.get_sparameter_names(format=’ri’)
generate a list of column names for the s-parameter data The names are different for each format. posible format
parameters:
ri, ma, db, orig (where orig refers to one of the three others)
returns a list of strings.
skrf.io.touchstone.Touchstone.load_file
Touchstone.load_file(fid)
Load the touchstone file into the interal data structures
Functions related to reading/writing touchstones.
skrf.io.touchstone.hfss_touchstone_2_gamma_z0
skrf.io.touchstone.hfss_touchstone_2_gamma_z0(filename)
Extracts Z0 and Gamma comments from touchstone file
Takes a HFSS-style touchstone file with Gamma and Z0 comments and extracts a triplet of arrays being: (fre-
quency, Gamma, Z0)
Parameters filename : string
the HFSS-style touchstone file
Returns f : numpy.ndarray
frequency vector (in Hz)
gamma : complex numpy.ndarray
complex propagation constant
z0 : numpy.ndarray
complex port impedance
Examples
skrf.io.touchstone.hfss_touchstone_2_media
skrf.io.touchstone.hfss_touchstone_2_media(filename, f_unit=’ghz’)
Creates a Media object from a a HFSS-style touchstone file with Gamma and Z0 comments
Examples
read_pna_csv(filename, *args, **kwargs) Reads data from a csv file written by an Agilient PNA.
pna_csv_2_ntwks(filename) Reads a PNAX csv file, and returns a list of one-port Networks
skrf.io.csv.read_pna_csv
Examples
skrf.io.csv.pna_csv_2_ntwks
skrf.io.csv.pna_csv_2_ntwks(filename)
Reads a PNAX csv file, and returns a list of one-port Networks
Note this only works if csv is save in Real/Imaginary format for now
Parameters filename : str
filename
Returns out : list of Network objects
list of Networks representing the data contained in column pairs
This Package provides a high-level class representing a calibration instance, as well as calibration algorithms and
supporting functions.
Both one and two port calibrations are supported. These calibration algorithms allow for redundant measurements, by
using a simple least squares estimator to solve for the embedding network.
10.10.1 Modules
calibration (skrf.calibration.calibration)
Calibration Class
skrf.calibration.calibration.Calibration
class skrf.calibration.calibration.Calibration(measured, ideals, type=None,
is_reciprocal=False, name=None,
sloppy_input=False, switch_terms=None,
**kwargs)
An object to represent a VNA calibration instance.
A Calibration object is used to perform a calibration given a set meaurements and ideals responses. It can run a
calibration, store results, and apply the results to calculate corrected measurements.
Attributes
skrf.calibration.calibration.Calibration.Ts
Calibration.Ts
T-matricies used for de-embeding, a two-port calibration.
skrf.calibration.calibration.Calibration.caled_ntwk_sets
Calibration.caled_ntwk_sets
returns a NetworkSet for each caled_ntwk, based on their names
skrf.calibration.calibration.Calibration.caled_ntwks
Calibration.caled_ntwks
list of the calibrated, calibration standards.
skrf.calibration.calibration.Calibration.calibration_algorithm_dict
Calibration.calibration_algorithm_dict = {‘8-term’: <function two_port at 0x5f2be60>, ‘two port’: <function two
dictionary holding calibration algorithms.
skrf.calibration.calibration.Calibration.coefs
Calibration.coefs
coefs: a dictionary holding the calibration coefficients
for one port cal’s ‘directivity’:e00 ‘reflection tracking’:e01e10 ‘source match’:e11
for 7-error term two port cal’s TODO:
skrf.calibration.calibration.Calibration.coefs_ntwks
Calibration.coefs_ntwks
for one port cal’s ‘directivity’:e00 ‘reflection tracking’:e01e10 ‘source match’:e11
for 7-error term two port cal’s TODO
skrf.calibration.calibration.Calibration.coefs_ntwks_2p
Calibration.coefs_ntwks_2p
coefs: a dictionary holding the calibration coefficients
skrf.calibration.calibration.Calibration.error_ntwk
Calibration.error_ntwk
A Network object which represents the error network being calibrated out.
skrf.calibration.calibration.Calibration.nports
Calibration.nports
the number of ports in the calibration
skrf.calibration.calibration.Calibration.nstandards
Calibration.nstandards
number of ideal/measurement pairs in calibration
skrf.calibration.calibration.Calibration.output_from_cal
Calibration.output_from_cal
a dictionary holding all of the output from the calibration algorithm
skrf.calibration.calibration.Calibration.residual_ntwks
Calibration.residual_ntwks
returns a the residuals for each calibration standard in the form of a list of Network types.
these residuals are calculated in the ‘calibrated domain’, meaning they are
r = (E.inv ** m - i)
skrf.calibration.calibration.Calibration.residuals
Calibration.residuals
if calibration is overdeteremined, this holds the residuals in the form of a vector.
also available are the complex residuals in the form of skrf.Network’s, see the property ‘residual_ntwks’
from numpy.lstsq: residues: the sum of the residues; squared euclidean norm for each column vector in b
(given ax=b)
skrf.calibration.calibration.Calibration.type
Calibration.type
string representing what type of calibration is to be performed. supported types at the moment are:
‘one port’: standard one-port cal. if more than 2 measurement/ideal pairs are given it will calculate the least
squares solution.
‘two port’: two port calibration based on the error-box model
note: algorithms referenced by calibration_algorithm_dict, are stored in calibrationAlgorithms.py
Methods
skrf.calibration.calibration.Calibration.__init__
Calibration.__init__(measured, ideals, type=None, is_reciprocal=False, name=None,
sloppy_input=False, switch_terms=None, **kwargs)
Calibration initializer.
Parameters measured : list of Network objects
Raw measurements of the calibration standards. The order must align with the ideals
parameter ( or use sloppy_input)
ideals : list of Network objects
Predicted ideal response of the calibration standards. The order must align with ideals
list ( or use sloppy_input
Notes
References
Examples
See the Calibration tutorial, or the examples sections for One-Port Calibration and
../../../examples/twoport_calibration
skrf.calibration.calibration.Calibration.apply_cal
Calibration.apply_cal(input_ntwk)
apply the current calibration to a measurement.
takes:
input_ntwk: the measurement to apply the calibration to, a Network type.
returns: caled: the calibrated measurement, a Network type.
skrf.calibration.calibration.Calibration.apply_cal_to_all_in_dir
Calibration.apply_cal_to_all_in_dir(dir=’.’, contains=None, f_unit=’ghz’)
convience function to apply calibration to an entire directory of measurements, and return a dictionary of the
calibrated results, optionally the user can ‘grep’ the direction by using the contains switch.
takes: dir: directory of measurements (string) contains: will only load measurements who’s filename contains
this string.
f_unit: frequency unit, to use for all networks. see frequency.Frequency.unit for info.
returns:
ntwkDict: a dictionary of calibrated measurements, the keys are the filenames.
skrf.calibration.calibration.Calibration.biased_error
Calibration.biased_error(std_names=None)
estimate of biased error for overdetermined calibration with multiple connections of each standard
takes:
std_names: list of strings to uniquely identify each standard.*
returns:
systematic error: skrf.Network type who’s .s_mag is proportional to the systematic error metric
note:
mathematically, this is mean_s(|mean_c(r)|)
where: r: complex residual errors mean_c: complex mean taken accross connection mean_s: complex
mean taken accross standard
skrf.calibration.calibration.Calibration.func_per_standard
Calibration.func_per_standard(func, attribute=’s’, std_names=None)
skrf.calibration.calibration.Calibration.mean_residuals
Calibration.mean_residuals()
skrf.calibration.calibration.Calibration.plot_caled_ntwk_sets
Calibration.plot_caled_ntwk_sets(attr=’s_db’, *args, **kwargs)
plots calibrated network sets with uncertainty bounds.
For use with redundantly measured calibration standards.
Parameters attr : str
plotable uncertainty bounds attribute of a NetworkSet object. ie ‘s_db’, ‘s_deg’
*args, **kwargs : :
passed to the plotting method
skrf.calibration.calibration.Calibration.plot_caled_ntwks
Calibration.plot_caled_ntwks(attr=’s_smith’, *args, **kwargs)
Plot specified parameters the :caled_ntwks.
Parameters attr : str
plotable attribute of a Network object. ie ‘s_db’, ‘s_smith’
*args, **kwargs : :
passed to the plotting method
skrf.calibration.calibration.Calibration.plot_coefs
Calibration.plot_coefs(attr=’s_db’, port=None, *args, **kwargs)
plot magnitude of the error coeficient dictionary
skrf.calibration.calibration.Calibration.plot_coefs_db
Calibration.plot_coefs_db(*args, **kwargs)
skrf.calibration.calibration.Calibration.plot_errors
Calibration.plot_errors(std_names=None, scale=’db’, *args, **kwargs)
plot calibration error metrics for an over-determined calibration.
see biased_error, unbiased_error, and total_error for more info
skrf.calibration.calibration.Calibration.plot_residuals
Calibration.plot_residuals(attribute, *args, **kwargs)
plots a component of the residual errors on the Calibration-plane.
takes:
attribute: name of ploting method of Network class to call
possible options are: ‘mag’, ‘db’, ‘smith’, ‘deg’, etc
*args,**kwargs: passed to plot_s_‘atttribute’()
note: the residuals are calculated by:
(self.apply_cal(self.measured[k])-self.ideals[k])
skrf.calibration.calibration.Calibration.plot_residuals_db
Calibration.plot_residuals_db(*args, **kwargs)
see plot_residuals
skrf.calibration.calibration.Calibration.plot_residuals_mag
Calibration.plot_residuals_mag(*args, **kwargs)
see plot_residuals
skrf.calibration.calibration.Calibration.plot_residuals_smith
Calibration.plot_residuals_smith(*args, **kwargs)
see plot_residuals
skrf.calibration.calibration.Calibration.plot_uncertainty_per_standard
Calibration.plot_uncertainty_per_standard(scale=’db’, *args, **kwargs)
Plots uncertainty associated with each calibration standard.
This requires that each calibration standard is measured multiple times. The uncertainty associated with each
standard is calculated by the complex standard deviation.
Parameters scale : ‘db’, ‘lin’
plot uncertainties on linear or log scale
*args, **kwargs : passed to uncertainty_per_standard()
See Also:
uncertainty_per_standard()
skrf.calibration.calibration.Calibration.remove_std
Calibration.remove_std(prefix)
skrf.calibration.calibration.Calibration.run
Calibration.run()
runs the calibration algorihtm.
this is automatically called the first time any dependent property is referenced (like error_ntwk), but only the
first time. if you change something and want to re-run the calibration
use this.
skrf.calibration.calibration.Calibration.total_error
Calibration.total_error(std_names=None)
estimate of total error for overdetermined calibration with multiple connections of each standard. This is the
combined effects of both biased and un-biased errors
takes:
std_names: list of strings to uniquely identify each standard.*
returns:
composit error: skrf.Network type who’s .s_mag is proportional to the composit error metric
note:
mathematically, this is std_cs(r)
where: r: complex residual errors std_cs: standard deviation taken accross connections
and standards
skrf.calibration.calibration.Calibration.unbiased_error
Calibration.unbiased_error(std_names=None)
estimate of unbiased error for overdetermined calibration with multiple connections of each standard
takes:
std_names: list of strings to uniquely identify each standard.*
returns:
stochastic error: skrf.Network type who’s .s_mag is proportional to the stochastic error metric
see also: uncertainty_per_standard, for this a measure of unbiased errors for each standard
note:
mathematically, this is mean_s(std_c(r))
where: r: complex residual errors std_c: standard deviation taken accross connections mean_s: complex
mean taken accross standards
skrf.calibration.calibration.Calibration.uncertainty_per_standard
Calibration.uncertainty_per_standard(std_names=None, attribute=’s’)
given that you have repeat-connections of single standard, this calculates the complex standard deviation (dis-
tance) for each standard in the calibration across connection #.
takes:
std_names: list of strings to uniquely identify each standard.*
attribute: string passed to func_on_networks to calculate std deviation on a component if desired.
[’s’]
returns: list of skrf.Networks, whose magnitude of s-parameters is proportional to the standard deviation for
that standard
*example:
if your calibration had ideals named like: ‘short 1’, ‘short 2’, ‘open 1’, ‘open 2’, etc.
you would pass this mycal.uncertainty_per_standard([’short’,’open’,’match’])
skrf.calibration.calibration.Calibration.write
Calibration.write(file=None, *args, **kwargs)
Write the Calibration to disk using write()
Parameters file : str or file-object
filename or a file-object. If left as None then the filename will be set to Calibra-
tion.name, if its not None. If both are None, ValueError is raised.
*args, **kwargs : arguments and keyword arguments
passed through to write()
See Also:
skrf.io.general.write, skrf.io.general.read
Notes
If the self.name is not None and file is can left as None and the resultant file will have the .ntwk extension
appended to the filename.
Examples
calibrationAlgorithms (skrf.calibration.calibrationAlgorithms)
Contains calibrations algorithms and related functions, which are used in the Calibration class.
Calibration Algorithms
skrf.calibration.calibrationAlgorithms.one_port
skrf.calibration.calibrationAlgorithms.one_port(measured, ideals)
Standard algorithm for a one port calibration.
If more than three standards are supplied then a least square algorithm is applied.
Parameters measured : list of Network objects or numpy.ndarray
a list of the measured reflection coefficients. The elements of the list can either a kxnxn
numpy.ndarray, representing a s-matrix, or list of 1-port Network objects.
ideals : list of Network objects or numpy.ndarray
a list of the ideal reflection coefficients. The elements of the list can either a kxnxn
numpy.ndarray, representing a s-matrix, or list of 1-port Network objects.
Returns output : a dictionary
output information from the calibration, the keys are
• ‘error coeffcients’: dictionary containing standard error coefficients
• ‘residuals’: a matrix of residuals from the least squared calculation. see
numpy.linalg.lstsq() for more info
See Also:
Notes
skrf.calibration.calibrationAlgorithms.one_port_nls
skrf.calibration.calibrationAlgorithms.one_port_nls(measured, ideals)
one port non-linear least squares.
Parameters measured : list of Network objects or numpy.ndarray
a list of the measured reflection coefficients. The elements of the list can either a kxnxn
numpy.ndarray, representing a s-matrix, or list of 1-port Network objects.
ideals : list of Network objects or numpy.ndarray
a list of the ideal reflection coefficients. The elements of the list can either a kxnxn
numpy.ndarray, representing a s-matrix, or list of 1-port Network objects.
Returns output : a dictionary
a dictionary containing the following keys:
• ‘error coeffcients’: dictionary containing standard error coefficients
• ‘residuals’: a matrix of residuals from the least squared calculation. see
numpy.linalg.lstsq() for more info
• ‘cov_x’: covariance matrix
Notes
skrf.calibration.calibrationAlgorithms.two_port
skrf.calibration.calibrationAlgorithms.two_port(measured, ideals,
switch_terms=None)
Two port calibration based on the 8-term error model.
Takes two ordered lists of measured and ideal responses. Optionally, switch terms 34 can be taken into account
by passing a tuple containing the forward and reverse switch terms as 1-port Networks. This algorithm is based
on the work in 35 .
Parameters measured : list of 2-port Network objects
Raw measurements of the calibration standards. The order must align with the ideals
parameter
ideals : list of 2-port Network objects
Predicted ideal response of the calibration standards. The order must align with ideals
list measured: ordered list of measured networks. list elements
switch_terms : tuple of Network objects
The two measured switch terms in the order (forward, reverse). This is only applicable
in two-port calibrations. See Roger Mark’s paper on switch terms 3 for explanation of
what they are.
Returns output : a dictionary
34 Marks, Roger B.; , “Formulations of the Basic Vector Network Analyzer Error Model including Switch-Terms,” ARFTG Conference Digest-
Affected by Leakage Errors,” Microwave Theory and Techniques, IEEE Transactions on , vol.25, no.12, pp. 1100- 1115, Dec 1977. URL:
http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=1129282&isnumber=25047
output information, contains the following keys: * ‘error coefficients’: * ‘error vector’:
* ‘residuals’:
Notes
References
skrf.calibration.calibrationAlgorithms.parameterized_self_calibration
skrf.calibration.calibrationAlgorithms.parameterized_self_calibration(measured,
ide-
als,
show-
Progress=True,
**kwargs)
An iterative, general self-calibration routine.
A self calibration routine based off of residual error minimization which can take any mixture of parameterized
standards.
Parameters measured : list of Network objects
a list of the measured networks
ideals : list of ParametricStandard objects
a list of the ideal networks
showProgress : Boolean
turn printing progress on/off
**kwargs : key-word arguments
passed to minimization algorithm (scipy.optimize.fmin)
Returns output : a dictionary
a dictionary containing the following keys:
• ‘error_coefficients’ : dictionary of error coefficients
• ‘residuals’: residual matrix (shape depends on #stds)
• ‘parameter_vector_final’: final results for parameter vector
• ‘mean_residual_list’: the mean, magnitude of the residuals at each iteration of
calibration. this is the variable being minimized.
See Also:
skrf.calibration.calibrationAlgorithms.parameterized_self_calibration_nls
skrf.calibration.calibrationAlgorithms.parameterized_self_calibration_nls(measured,
ide-
als_ps,
show-
Progress=True,
**kwargs)
An iterative, general self-calibration routine.
A self calibration routine based off of residual error minimization which can take any mixture of parameterized
standards. Uses a non-linear least squares estimator to calculate the residuals.
Parameters measured : list of Network objects
a list of the measured networks
ideals : list of Network objects
a list of the ideal networks
showProgress : Boolean
turn printing progress on/off
**kwargs : key-word arguments
passed to minimization algorithm (scipy.optimize.fmin)
Returns output : a dictionary
a dictionary containing the following keys:
• ‘error_coefficients’ : dictionary of error coefficients
• ‘residuals’: residual matrix (shape depends on #stds)
• ‘parameter_vector_final’: final results for parameter vector
• ‘mean_residual_list’: the mean, magnitude of the residuals at each iteration of
calibration. this is the variable being minimized.
See Also:
Supporting Functions
skrf.calibration.calibrationAlgorithms.unterminate_switch_terms
skrf.calibration.calibrationAlgorithms.unterminate_switch_terms(two_port,
gamma_f,
gamma_r)
Unterminates switch terms from raw measurements.
In order to use the 8-term error model on a VNA which employs a switched source, the effects of the switch
must be accounted for. This is done through switch terms as described in 36 . The two switch terms are defined
as,
a2 a1
Γf = , sourced by port 1Γr = , sourced by port 2
b2 b1
These can be measured by four-sampler VNA’s by setting up user-defined traces onboard the VNA. If the VNA
doesnt have 4-samplers, then you can measure switch terms indirectly by using a two-tier two-port calibration.
Firts do a SOLT, then convert the 12-term error coefs to 8-term, and pull out the switch terms.
Parameters two_port : 2-port Network
the raw measurement
gamma_f : 1-port Network
the measured forward switch term. gamma_f = a2/b2 sourced by port1
gamma_r : 1-port Network
the measured reverse switch term
Returns ntwk : Network object
References
skrf.calibration.calibrationAlgorithms.abc_2_coefs_dict
skrf.calibration.calibrationAlgorithms.abc_2_coefs_dict(abc)
converts an abc ndarry to a dictionarry containing the error coefficients.
takes:
abc [Nx3 numpy.ndarray, which holds the complex calibration]
coefficients. the components of abc are a[:] = abc[:,0] b[:] = abc[:,1] c[:] = abc[:,2],
a, b and c are related to the error network by a = det(e) = e01*e10 - e00*e11 b = e00 c = e11
returns:
coefsDict: dictionary containing the following ‘directivity’:e00 ‘reflection tracking’:e01e10 ‘source
match’:e11
note: e00 = directivity error e10e01 = reflection tracking error e11 = source match error
skrf.calibration.calibrationAlgorithms.eight_term_2_one_port_coefs
skrf.calibration.calibrationAlgorithms.eight_term_2_one_port_coefs(coefs)
calibrationFunctions (skrf.calibration.calibrationFunctions)
cartesian_product_calibration_set(ideals, ...) This function is used for calculating calibration uncertainty due to un-b
36 “Formulations of the Basic Vector Network Analyzer Error Model including Switch Terms” by Roger B. Marks
skrf.calibration.calibrationFunctions.cartesian_product_calibration_set
skrf.calibration.calibrationFunctions.cartesian_product_calibration_set(ideals,
mea-
sured,
*args,
**kwargs)
This function is used for calculating calibration uncertainty due to un-biased, non-systematic errors.
It creates an ensemble of calibration instances. the set of measurement lists used in the ensemble is the Cartesian
Product of all instances of each measured standard.
The idea is that if you have multiple measurements of each standard, then the multiple calibrations can be
made by generating all possible combinations of measurements. This produces a conceptually simple, but
computationally expensive way to estimate calibration uncertainty.
takes: ideals: list of ideal Networks measured: list of measured Networks *args,**kwargs: passed to Calibra-
tion initializer
returns: cal_ensemble: a list of Calibration instances.
you can use the output to estimate uncertainty by calibrating a DUT with all calibrations, and then running
statistics on the resultant set of Networks. for example
import skrf as rf # define you lists of ideals and measured networks cal_ensemble =
rf.cartesian_product_calibration_ensemble( ideals, measured) dut = rf.Network(‘dut.s1p’) network_ensemble
= [cal.apply_cal(dut) for cal in cal_ensemble] rf.plot_uncertainty_mag(network_ensemble) [net-
work.plot_s_smith() for network in network_ensemble]
10.10.2 Classes
skrf.calibration.calibration.Calibration
Attributes
skrf.calibration.calibration.Calibration.Ts
Calibration.Ts
T-matricies used for de-embeding, a two-port calibration.
skrf.calibration.calibration.Calibration.caled_ntwk_sets
Calibration.caled_ntwk_sets
returns a NetworkSet for each caled_ntwk, based on their names
skrf.calibration.calibration.Calibration.caled_ntwks
Calibration.caled_ntwks
list of the calibrated, calibration standards.
skrf.calibration.calibration.Calibration.calibration_algorithm_dict
skrf.calibration.calibration.Calibration.coefs
Calibration.coefs
coefs: a dictionary holding the calibration coefficients
for one port cal’s ‘directivity’:e00 ‘reflection tracking’:e01e10 ‘source match’:e11
for 7-error term two port cal’s TODO:
skrf.calibration.calibration.Calibration.coefs_ntwks
Calibration.coefs_ntwks
for one port cal’s ‘directivity’:e00 ‘reflection tracking’:e01e10 ‘source match’:e11
for 7-error term two port cal’s TODO
skrf.calibration.calibration.Calibration.coefs_ntwks_2p
Calibration.coefs_ntwks_2p
coefs: a dictionary holding the calibration coefficients
for one port cal’s ‘directivity’:e00 ‘reflection tracking’:e01e10 ‘source match’:e11
for 7-error term two port cal’s TODO
skrf.calibration.calibration.Calibration.error_ntwk
Calibration.error_ntwk
A Network object which represents the error network being calibrated out.
skrf.calibration.calibration.Calibration.nports
Calibration.nports
the number of ports in the calibration
skrf.calibration.calibration.Calibration.nstandards
Calibration.nstandards
number of ideal/measurement pairs in calibration
skrf.calibration.calibration.Calibration.output_from_cal
Calibration.output_from_cal
a dictionary holding all of the output from the calibration algorithm
skrf.calibration.calibration.Calibration.residual_ntwks
Calibration.residual_ntwks
returns a the residuals for each calibration standard in the form of a list of Network types.
these residuals are calculated in the ‘calibrated domain’, meaning they are
r = (E.inv ** m - i)
skrf.calibration.calibration.Calibration.residuals
Calibration.residuals
if calibration is overdeteremined, this holds the residuals in the form of a vector.
also available are the complex residuals in the form of skrf.Network’s, see the property ‘residual_ntwks’
from numpy.lstsq: residues: the sum of the residues; squared euclidean norm for each column vector in b
(given ax=b)
skrf.calibration.calibration.Calibration.type
Calibration.type
string representing what type of calibration is to be performed. supported types at the moment are:
‘one port’: standard one-port cal. if more than 2 measurement/ideal pairs are given it will calculate the least
squares solution.
‘two port’: two port calibration based on the error-box model
note: algorithms referenced by calibration_algorithm_dict, are stored in calibrationAlgorithms.py
Methods
skrf.calibration.calibration.Calibration.__init__
Predicted ideal response of the calibration standards. The order must align with ideals
list ( or use sloppy_input
Notes
References
Examples
See the Calibration tutorial, or the examples sections for One-Port Calibration and
../../../examples/twoport_calibration
skrf.calibration.calibration.Calibration.apply_cal
Calibration.apply_cal(input_ntwk)
apply the current calibration to a measurement.
takes:
input_ntwk: the measurement to apply the calibration to, a Network type.
returns: caled: the calibrated measurement, a Network type.
skrf.calibration.calibration.Calibration.apply_cal_to_all_in_dir
f_unit: frequency unit, to use for all networks. see frequency.Frequency.unit for info.
returns:
ntwkDict: a dictionary of calibrated measurements, the keys are the filenames.
skrf.calibration.calibration.Calibration.biased_error
Calibration.biased_error(std_names=None)
estimate of biased error for overdetermined calibration with multiple connections of each standard
takes:
std_names: list of strings to uniquely identify each standard.*
returns:
systematic error: skrf.Network type who’s .s_mag is proportional to the systematic error metric
note:
mathematically, this is mean_s(|mean_c(r)|)
where: r: complex residual errors mean_c: complex mean taken accross connection mean_s: complex
mean taken accross standard
skrf.calibration.calibration.Calibration.func_per_standard
skrf.calibration.calibration.Calibration.mean_residuals
Calibration.mean_residuals()
skrf.calibration.calibration.Calibration.plot_caled_ntwk_sets
skrf.calibration.calibration.Calibration.plot_caled_ntwks
skrf.calibration.calibration.Calibration.plot_coefs
skrf.calibration.calibration.Calibration.plot_coefs_db
Calibration.plot_coefs_db(*args, **kwargs)
skrf.calibration.calibration.Calibration.plot_errors
skrf.calibration.calibration.Calibration.plot_residuals
skrf.calibration.calibration.Calibration.plot_residuals_db
Calibration.plot_residuals_db(*args, **kwargs)
see plot_residuals
skrf.calibration.calibration.Calibration.plot_residuals_mag
Calibration.plot_residuals_mag(*args, **kwargs)
see plot_residuals
skrf.calibration.calibration.Calibration.plot_residuals_smith
Calibration.plot_residuals_smith(*args, **kwargs)
see plot_residuals
skrf.calibration.calibration.Calibration.plot_uncertainty_per_standard
skrf.calibration.calibration.Calibration.remove_std
Calibration.remove_std(prefix)
skrf.calibration.calibration.Calibration.run
Calibration.run()
runs the calibration algorihtm.
this is automatically called the first time any dependent property is referenced (like error_ntwk), but only the
first time. if you change something and want to re-run the calibration
use this.
skrf.calibration.calibration.Calibration.total_error
Calibration.total_error(std_names=None)
estimate of total error for overdetermined calibration with multiple connections of each standard. This is the
combined effects of both biased and un-biased errors
takes:
std_names: list of strings to uniquely identify each standard.*
returns:
composit error: skrf.Network type who’s .s_mag is proportional to the composit error metric
note:
mathematically, this is std_cs(r)
where: r: complex residual errors std_cs: standard deviation taken accross connections
and standards
skrf.calibration.calibration.Calibration.unbiased_error
Calibration.unbiased_error(std_names=None)
estimate of unbiased error for overdetermined calibration with multiple connections of each standard
takes:
std_names: list of strings to uniquely identify each standard.*
returns:
stochastic error: skrf.Network type who’s .s_mag is proportional to the stochastic error metric
see also: uncertainty_per_standard, for this a measure of unbiased errors for each standard
note:
mathematically, this is mean_s(std_c(r))
where: r: complex residual errors std_c: standard deviation taken accross connections mean_s: complex
mean taken accross standards
skrf.calibration.calibration.Calibration.uncertainty_per_standard
Calibration.uncertainty_per_standard(std_names=None, attribute=’s’)
given that you have repeat-connections of single standard, this calculates the complex standard deviation (dis-
tance) for each standard in the calibration across connection #.
takes:
std_names: list of strings to uniquely identify each standard.*
attribute: string passed to func_on_networks to calculate std deviation on a component if desired.
[’s’]
returns: list of skrf.Networks, whose magnitude of s-parameters is proportional to the standard deviation for
that standard
*example:
if your calibration had ideals named like: ‘short 1’, ‘short 2’, ‘open 1’, ‘open 2’, etc.
you would pass this mycal.uncertainty_per_standard([’short’,’open’,’match’])
skrf.calibration.calibration.Calibration.write
Notes
If the self.name is not None and file is can left as None and the resultant file will have the .ntwk extension
appended to the filename.
Examples
The Media object is the base-class that is inherited by specific transmission line instances, such as Freespace, or
RectangularWaveguide. The Media object provides generic methods to produce Network‘s for any transmi-
sion line medium, such as line() and delay_short(). These methods are inherited by the specific tranmission
line classes, which interally define relevant quantities such as propagation constant, and characteristic impedance. This
allows the specific transmission line mediums to produce networks without re-implementing methods for each specific
media instance.
Network components specific to an given transmission line medium such as cpw_short() and
microstrip_bend(), are implemented in those object
skrf.media.media.Media
Attributes
Z0 Characterisitc impedance
characteristic_impedance Characterisitc impedance
gamma Propagation constant
portz0 Port Impedance
propagation_constant Propagation constant
v_p complex phase velocity (in m/s)
z0 Port Impedance
skrf.media.media.Media.Z0
Media.Z0
Characterisitc impedance
The characteristic_impedance can be either a number, array-like, or a function. If it is a function is must take no
arguments. The reason to make it a function is if you want the characterisitc impedance to be dynamic, meaning
changing with some attribute of the media. See __init__() for more explanation.
Returns characteristic_impedance : numpy.ndarray
skrf.media.media.Media.characteristic_impedance
Media.characteristic_impedance
Characterisitc impedance
The characteristic_impedance can be either a number, array-like, or a function. If it is a function is must take no
arguments. The reason to make it a function is if you want the characterisitc impedance to be dynamic, meaning
changing with some attribute of the media. See __init__() for more explanation.
Returns characteristic_impedance : numpy.ndarray
skrf.media.media.Media.gamma
Media.gamma
Propagation constant
The propagation constant can be either a number, array-like, or a function. If it is a function is must take no
arguments. The reason to make it a function is if you want the propagation constant to be dynamic, meaning
changing with some attribute of the media. See __init__() for more explanation.
Returns propagation_constant : numpy.ndarray
complex propagation constant for this media
Notes
skrf.media.media.Media.portz0
Media.portz0
Port Impedance
The port impedance is usually equal to the characteristic_impedance. Therefore, if the port impedance
is None then this will return characteristic_impedance.
However, in some cases such as rectangular waveguide, the port impedance is traditionally set to 1 (normalized).
In such a case this property may be used.
The Port Impedance can be either a number, array-like, or a function. If it is a function is must take no arguments.
The reason to make it a function is if you want the Port Impedance to be dynamic, meaning changing with some
attribute of the media. See __init__() for more explanation.
Returns port_impedance : numpy.ndarray
the media’s port impedance
skrf.media.media.Media.propagation_constant
Media.propagation_constant
Propagation constant
The propagation constant can be either a number, array-like, or a function. If it is a function is must take no
arguments. The reason to make it a function is if you want the propagation constant to be dynamic, meaning
changing with some attribute of the media. See __init__() for more explanation.
Returns propagation_constant : numpy.ndarray
complex propagation constant for this media
Notes
skrf.media.media.Media.v_p
Media.v_p
complex phase velocity (in m/s)
j · ω/γ
skrf.media.media.Media.z0
Media.z0
Port Impedance
The port impedance is usually equal to the characteristic_impedance. Therefore, if the port impedance
is None then this will return characteristic_impedance.
However, in some cases such as rectangular waveguide, the port impedance is traditionally set to 1 (normalized).
In such a case this property may be used.
The Port Impedance can be either a number, array-like, or a function. If it is a function is must take no arguments.
The reason to make it a function is if you want the Port Impedance to be dynamic, meaning changing with some
attribute of the media. See __init__() for more explanation.
Returns port_impedance : numpy.ndarray
the media’s port impedance
Methods
skrf.media.media.Media.__init__
from_csv() function to create a Media object from a csv file containing gamma/z0
Notes
the z0 parameter is needed in some cases. For example, the RectangularWaveguide is an example where
you may need this, because the characteristic impedance is frequency dependent, but the touchstone’s created
by most VNA’s have z0=1
skrf.media.media.Media.capacitor
Media.capacitor(C, **kwargs)
Capacitor
Parameters C : number, array
Capacitance, in Farads. If this is an array, must be of same length as frequency vector.
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns capacitor : a 2-port Network
See Also:
skrf.media.media.Media.delay_load
Notes
This calls
line(d,unit, **kwargs) ** load(Gamma0, **kwargs)
Examples
skrf.media.media.Media.delay_open
skrf.media.media.Media.delay_short
skrf.media.media.Media.electrical_length
Media.electrical_length(d, deg=False)
calculates the electrical length for a given distance, at the center frequency.
Parameters d: number or array-like :
delay distance, in meters
deg: Boolean :
return electral length in deg?
Returns theta: number or array-like :
electrical length in radians or degrees, depending on value of deg.
skrf.media.media.Media.from_csv
skrf.media.media.Media.guess_length_of_delay_short
Media.guess_length_of_delay_short(aNtwk)
Guess physical length of a delay short.
Unwraps the phase and determines the slope, which is then used in conjunction with
propagation_constant to estimate the physical distance to the short.
Parameters aNtwk : Network object
(note: if this is a measurment it needs to be normalized to the reference plane)
skrf.media.media.Media.impedance_mismatch
Notes
skrf.media.media.Media.inductor
Media.inductor(L, **kwargs)
Inductor
Parameters L : number, array
Inductance, in Henrys. If this is an array, must be of same length as frequency vector.
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns inductor : a 2-port Network
See Also:
skrf.media.media.Media.line
Examples
skrf.media.media.Media.load
skrf.media.media.Media.match
number of ports
z0 : number, or array-like
characterisitc impedance. Default is None, in which case the Media’s z0 is used. This
sets the resultant Network’s z0.
**kwargs : key word arguments
passed to Network initializer
Returns match : Network object
a n-port match
Examples
skrf.media.media.Media.open
Media.open(nports=1, **kwargs)
Open (Γ0 = 1)
Parameters nports : int
number of ports
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns match : Network object
a n-port open circuit
See Also:
skrf.media.media.Media.random
Media.random(n_ports=1, **kwargs)
Complex random network.
Creates a n-port network whose s-matrix is filled with random complex numbers.
Parameters n_ports : int
number of ports.
**kwargs : passed to Network
initializer
Returns result : Network object
the network
skrf.media.media.Media.resistor
skrf.media.media.Media.short
Media.short(nports=1, **kwargs)
Short (Γ0 = −1)
Parameters nports : int
number of ports
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns match : Network object
a n-port short circuit
See Also:
skrf.media.media.Media.shunt
Media.shunt(ntwk, **kwargs)
Shunts a Network
This creates a tee() and connects connects ntwk to port 1, and returns the result
Parameters ntwk : Network object
**kwargs : keyword arguments
passed to tee()
Returns shunted_ntwk : Network object
a shunted a ntwk. The resultant shunted_ntwk will have (2 + ntwk.number_of_ports -1)
ports.
skrf.media.media.Media.shunt_capacitor
Notes
This calls:
shunt(capacitor(C,*args, **kwargs))
skrf.media.media.Media.shunt_delay_load
Media.shunt_delay_load(*args, **kwargs)
Shunted delayed load
Parameters *args,**kwargs : arguments, keyword arguments
passed to func:delay_load
Returns shunt_delay_load : Network object
a shunted delayed load (2-port)
Notes
This calls:
shunt(delay_load(*args, **kwargs))
skrf.media.media.Media.shunt_delay_open
Media.shunt_delay_open(*args, **kwargs)
Shunted delayed open
Parameters *args,**kwargs : arguments, keyword arguments
passed to func:delay_open
Returns shunt_delay_open : Network object
shunted delayed open (2-port)
Notes
This calls:
shunt(delay_open(*args, **kwargs))
skrf.media.media.Media.shunt_delay_short
Media.shunt_delay_short(*args, **kwargs)
Shunted delayed short
Parameters *args,**kwargs : arguments, keyword arguments
passed to func:delay_open
Returns shunt_delay_load : Network object
shunted delayed open (2-port)
Notes
This calls:
shunt(delay_short(*args, **kwargs))
skrf.media.media.Media.shunt_inductor
Notes
This calls:
shunt(inductor(C,*args, **kwargs))
skrf.media.media.Media.splitter
Media.splitter(nports, **kwargs)
Ideal, lossless n-way splitter.
Parameters nports : int
number of ports
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns tee : Network object
a n-port splitter
See Also:
skrf.media.media.Media.tee
Media.tee(**kwargs)
Ideal, lossless tee. (3-port splitter)
Parameters **kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns tee : Network object
a 3-port splitter
See Also:
skrf.media.media.Media.theta_2_d
Media.theta_2_d(theta, deg=True)
Converts electrical length to physical distance.
The given electrical length is to be at the center frequency.
Parameters theta : number
electrical length, at band center (see deg for unit)
deg : Boolean
is theta in degrees?
Returns d : number
physical distance in meters
skrf.media.media.Media.thru
Media.thru(**kwargs)
Matched transmission line of length 0.
Parameters **kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns thru : Network object
skrf.media.media.Media.white_gaussian_polar
skrf.media.media.Media.write_csv
from_csv class method to initialize Media object from a csv file written from this function
skrf.media.distributedCircuit.DistributedCircuit
+<e{γ} = attenuation
−=m{γ} = forward propagation
Attributes
0
Y Distributed Admittance, Y
0
Z Distributed Impedance, Z
characteristic_impedance Characterisitc impedance
portz0 Port Impedance
propagation_constant Propagation constant
v_p complex phase velocity (in m/s)
z0 Port Impedance
skrf.media.distributedCircuit.DistributedCircuit.Y
DistributedCircuit.Y
0
Distributed Admittance, Y
Defined as
0 0 0
Y = G + jωC
Returns Y : numpy.ndarray
Distributed Admittance in units of S/m
skrf.media.distributedCircuit.DistributedCircuit.Z
DistributedCircuit.Z
0
Distributed Impedance, Z
Defined as
0 0 0
Z = R + jωI
Returns Z : numpy.ndarray
Distributed impedance in units of ohm/m
skrf.media.distributedCircuit.DistributedCircuit.characteristic_impedance
DistributedCircuit.characteristic_impedance
Characterisitc impedance
The characteristic_impedance can be either a number, array-like, or a function. If it is a function is must take no
arguments. The reason to make it a function is if you want the characterisitc impedance to be dynamic, meaning
changing with some attribute of the media. See __init__() for more explanation.
Returns characteristic_impedance : numpy.ndarray
skrf.media.distributedCircuit.DistributedCircuit.portz0
DistributedCircuit.portz0
Port Impedance
The port impedance is usually equal to the characteristic_impedance. Therefore, if the port impedance
is None then this will return characteristic_impedance.
However, in some cases such as rectangular waveguide, the port impedance is traditionally set to 1 (normalized).
In such a case this property may be used.
The Port Impedance can be either a number, array-like, or a function. If it is a function is must take no arguments.
The reason to make it a function is if you want the Port Impedance to be dynamic, meaning changing with some
attribute of the media. See __init__() for more explanation.
Returns port_impedance : numpy.ndarray
the media’s port impedance
skrf.media.distributedCircuit.DistributedCircuit.propagation_constant
DistributedCircuit.propagation_constant
Propagation constant
The propagation constant can be either a number, array-like, or a function. If it is a function is must take no
arguments. The reason to make it a function is if you want the propagation constant to be dynamic, meaning
changing with some attribute of the media. See __init__() for more explanation.
Returns propagation_constant : numpy.ndarray
complex propagation constant for this media
Notes
skrf.media.distributedCircuit.DistributedCircuit.v_p
DistributedCircuit.v_p
complex phase velocity (in m/s)
j · ω/γ
skrf.media.distributedCircuit.DistributedCircuit.z0
DistributedCircuit.z0
Port Impedance
The port impedance is usually equal to the characteristic_impedance. Therefore, if the port impedance
is None then this will return characteristic_impedance.
However, in some cases such as rectangular waveguide, the port impedance is traditionally set to 1 (normalized).
In such a case this property may be used.
The Port Impedance can be either a number, array-like, or a function. If it is a function is must take no arguments.
The reason to make it a function is if you want the Port Impedance to be dynamic, meaning changing with some
attribute of the media. See __init__() for more explanation.
Returns port_impedance : numpy.ndarray
the media’s port impedance
Methods
Z0 Characteristic Impedance, Z0
__init__ Distributed Circuit constructor.
capacitor Capacitor
delay_load Delayed load
delay_open Delayed open transmission line
delay_short Delayed Short
electrical_length calculates the electrical length for a given distance, at
from_Media Initializes a DistributedCircuit from an existing
from_csv create a Media from numerical values stored in a csv file.
gamma Propagation Constant, γ
Continued on next page
skrf.media.distributedCircuit.DistributedCircuit.Z0
DistributedCircuit.Z0()
Characteristic Impedance, Z0
r
Z0
Z0 =
Y0
Returns Z0 : numpy.ndarray
Characteristic Impedance in units of ohms
skrf.media.distributedCircuit.DistributedCircuit.__init__
G : number, or array-like
distributed conductance, in S/m
Notes
C,I,R,G can all be vectors as long as they are the same length
This object can be constructed from a Media instance too, see the classmethod from_Media()
skrf.media.distributedCircuit.DistributedCircuit.capacitor
DistributedCircuit.capacitor(C, **kwargs)
Capacitor
Parameters C : number, array
Capacitance, in Farads. If this is an array, must be of same length as frequency vector.
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns capacitor : a 2-port Network
See Also:
skrf.media.distributedCircuit.DistributedCircuit.delay_load
Notes
This calls
line(d,unit, **kwargs) ** load(Gamma0, **kwargs)
Examples
skrf.media.distributedCircuit.DistributedCircuit.delay_open
skrf.media.distributedCircuit.DistributedCircuit.delay_short
skrf.media.distributedCircuit.DistributedCircuit.electrical_length
DistributedCircuit.electrical_length(d, deg=False)
calculates the electrical length for a given distance, at the center frequency.
Parameters d: number or array-like :
delay distance, in meters
deg: Boolean :
return electral length in deg?
Returns theta: number or array-like :
electrical length in radians or degrees, depending on value of deg.
skrf.media.distributedCircuit.DistributedCircuit.from_Media
skrf.media.distributedCircuit.DistributedCircuit.from_csv
skrf.media.distributedCircuit.DistributedCircuit.gamma
DistributedCircuit.gamma()
Propagation Constant, γ
Defined as,
√
γ= Z0 Y 0
Notes
skrf.media.distributedCircuit.DistributedCircuit.guess_length_of_delay_short
DistributedCircuit.guess_length_of_delay_short(aNtwk)
Guess physical length of a delay short.
Unwraps the phase and determines the slope, which is then used in conjunction with
propagation_constant to estimate the physical distance to the short.
Parameters aNtwk : Network object
(note: if this is a measurment it needs to be normalized to the reference plane)
skrf.media.distributedCircuit.DistributedCircuit.impedance_mismatch
Notes
skrf.media.distributedCircuit.DistributedCircuit.inductor
DistributedCircuit.inductor(L, **kwargs)
Inductor
Parameters L : number, array
Inductance, in Henrys. If this is an array, must be of same length as frequency vector.
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns inductor : a 2-port Network
See Also:
skrf.media.distributedCircuit.DistributedCircuit.line
Examples
skrf.media.distributedCircuit.DistributedCircuit.load
nports : int
number of ports
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns load :class:‘~skrf.network.Network‘ object :
n-port load, where S = Gamma0*eye(...)
skrf.media.distributedCircuit.DistributedCircuit.match
Examples
skrf.media.distributedCircuit.DistributedCircuit.open
DistributedCircuit.open(nports=1, **kwargs)
Open (Γ0 = 1)
Parameters nports : int
number of ports
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns match : Network object
a n-port open circuit
See Also:
skrf.media.distributedCircuit.DistributedCircuit.random
DistributedCircuit.random(n_ports=1, **kwargs)
Complex random network.
Creates a n-port network whose s-matrix is filled with random complex numbers.
Parameters n_ports : int
number of ports.
**kwargs : passed to Network
initializer
Returns result : Network object
the network
skrf.media.distributedCircuit.DistributedCircuit.resistor
skrf.media.distributedCircuit.DistributedCircuit.short
DistributedCircuit.short(nports=1, **kwargs)
Short (Γ0 = −1)
Parameters nports : int
number of ports
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns match : Network object
a n-port short circuit
See Also:
skrf.media.distributedCircuit.DistributedCircuit.shunt
DistributedCircuit.shunt(ntwk, **kwargs)
Shunts a Network
This creates a tee() and connects connects ntwk to port 1, and returns the result
Parameters ntwk : Network object
**kwargs : keyword arguments
passed to tee()
Returns shunted_ntwk : Network object
a shunted a ntwk. The resultant shunted_ntwk will have (2 + ntwk.number_of_ports -1)
ports.
skrf.media.distributedCircuit.DistributedCircuit.shunt_capacitor
Notes
This calls:
shunt(capacitor(C,*args, **kwargs))
skrf.media.distributedCircuit.DistributedCircuit.shunt_delay_load
DistributedCircuit.shunt_delay_load(*args, **kwargs)
Shunted delayed load
Parameters *args,**kwargs : arguments, keyword arguments
passed to func:delay_load
Returns shunt_delay_load : Network object
a shunted delayed load (2-port)
Notes
This calls:
shunt(delay_load(*args, **kwargs))
skrf.media.distributedCircuit.DistributedCircuit.shunt_delay_open
DistributedCircuit.shunt_delay_open(*args, **kwargs)
Shunted delayed open
Parameters *args,**kwargs : arguments, keyword arguments
passed to func:delay_open
Returns shunt_delay_open : Network object
shunted delayed open (2-port)
Notes
This calls:
shunt(delay_open(*args, **kwargs))
skrf.media.distributedCircuit.DistributedCircuit.shunt_delay_short
DistributedCircuit.shunt_delay_short(*args, **kwargs)
Shunted delayed short
Parameters *args,**kwargs : arguments, keyword arguments
passed to func:delay_open
Returns shunt_delay_load : Network object
shunted delayed open (2-port)
Notes
This calls:
shunt(delay_short(*args, **kwargs))
skrf.media.distributedCircuit.DistributedCircuit.shunt_inductor
passed to func:delay_open
Returns shunt_inductor : Network object
shunted inductor(2-port)
Notes
This calls:
shunt(inductor(C,*args, **kwargs))
skrf.media.distributedCircuit.DistributedCircuit.splitter
DistributedCircuit.splitter(nports, **kwargs)
Ideal, lossless n-way splitter.
Parameters nports : int
number of ports
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns tee : Network object
a n-port splitter
See Also:
skrf.media.distributedCircuit.DistributedCircuit.tee
DistributedCircuit.tee(**kwargs)
Ideal, lossless tee. (3-port splitter)
Parameters **kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns tee : Network object
a 3-port splitter
See Also:
skrf.media.distributedCircuit.DistributedCircuit.theta_2_d
DistributedCircuit.theta_2_d(theta, deg=True)
Converts electrical length to physical distance.
The given electrical length is to be at the center frequency.
skrf.media.distributedCircuit.DistributedCircuit.thru
DistributedCircuit.thru(**kwargs)
Matched transmission line of length 0.
Parameters **kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns thru : Network object
matched tranmission line of 0 length
See Also:
skrf.media.distributedCircuit.DistributedCircuit.white_gaussian_polar
skrf.media.distributedCircuit.DistributedCircuit.write_csv
from_csv class method to initialize Media object from a csv file written from this function
skrf.media.rectangularWaveguide.RectangularWaveguide
Attributes
skrf.media.rectangularWaveguide.RectangularWaveguide.alpha_c
RectangularWaveguide.alpha_c
Loss due to finite conductivity and roughness of sidewalls
In units of np/m See property rho for setting conductivity.
Effects of finite conductivity are taken from 37 . If roughness is not None, then its effects the conductivity by
σ
σc =
˛w2
where
1.6
kw = 1 + e(−δ/2h)
δ = skindepthh = surf aceroughness
References
http://eceweb1.rutgers.edu/~orfanidi/ewa/
skrf.media.rectangularWaveguide.RectangularWaveguide.characteristic_impedance
RectangularWaveguide.characteristic_impedance
Characterisitc impedance
The characteristic_impedance can be either a number, array-like, or a function. If it is a function is must take no
arguments. The reason to make it a function is if you want the characterisitc impedance to be dynamic, meaning
changing with some attribute of the media. See __init__() for more explanation.
Returns characteristic_impedance : numpy.ndarray
skrf.media.rectangularWaveguide.RectangularWaveguide.ep
RectangularWaveguide.ep
The permativity of the filling material
Returns ep : number
filling material’s relative permativity
skrf.media.rectangularWaveguide.RectangularWaveguide.f_cutoff
RectangularWaveguide.f_cutoff
cutoff frequency for this mode
max(
37 Electromagnetic Waves and Antennas by Sophocles J. Orfanidis
skrf.media.rectangularWaveguide.RectangularWaveguide.f_norm
RectangularWaveguide.f_norm
frequency vector normalized to cuttoff
skrf.media.rectangularWaveguide.RectangularWaveguide.gamma
RectangularWaveguide.gamma
Propagation constant
The propagation constant can be either a number, array-like, or a function. If it is a function is must take no
arguments. The reason to make it a function is if you want the propagation constant to be dynamic, meaning
changing with some attribute of the media. See __init__() for more explanation.
Returns propagation_constant : numpy.ndarray
complex propagation constant for this media
Notes
skrf.media.rectangularWaveguide.RectangularWaveguide.k0
RectangularWaveguide.k0
Characteristic wave number
Returns k0 : number
characteristic wave number
skrf.media.rectangularWaveguide.RectangularWaveguide.kc
RectangularWaveguide.kc
Cut-off wave number
Defined as
r
q π2 π2
kc = kx2 + ky2 = m +n
a b
Returns kc : number
cut-off wavenumber
skrf.media.rectangularWaveguide.RectangularWaveguide.kx
RectangularWaveguide.kx
Eigen value in the ‘a’ direction
Defined as
π
kx = m
a
Returns kx : number
eigen-value in a direction
skrf.media.rectangularWaveguide.RectangularWaveguide.ky
RectangularWaveguide.ky
Eigen-value in the b direction.
Defined as
π
ky = n
b
Returns ky : number
eigen-value in b direction
skrf.media.rectangularWaveguide.RectangularWaveguide.lambda_cutoff
RectangularWaveguide.lambda_cutoff
cuttoff wavelength
fc ∗ v
wherev = sqrt(ep ∗ mu)
skrf.media.rectangularWaveguide.RectangularWaveguide.mu
RectangularWaveguide.mu
The permeability of the filling material
Returns mu : number
filling material’s relative permeability
skrf.media.rectangularWaveguide.RectangularWaveguide.portz0
RectangularWaveguide.portz0
Port Impedance
The port impedance is usually equal to the characteristic_impedance. Therefore, if the port impedance
is None then this will return characteristic_impedance.
However, in some cases such as rectangular waveguide, the port impedance is traditionally set to 1 (normalized).
In such a case this property may be used.
The Port Impedance can be either a number, array-like, or a function. If it is a function is must take no arguments.
The reason to make it a function is if you want the Port Impedance to be dynamic, meaning changing with some
attribute of the media. See __init__() for more explanation.
Returns port_impedance : numpy.ndarray
the media’s port impedance
skrf.media.rectangularWaveguide.RectangularWaveguide.propagation_constant
RectangularWaveguide.propagation_constant
Propagation constant
The propagation constant can be either a number, array-like, or a function. If it is a function is must take no
arguments. The reason to make it a function is if you want the propagation constant to be dynamic, meaning
changing with some attribute of the media. See __init__() for more explanation.
Returns propagation_constant : numpy.ndarray
complex propagation constant for this media
Notes
skrf.media.rectangularWaveguide.RectangularWaveguide.rho
RectangularWaveguide.rho
conductivty of sidewalls in ohm*m
Parameters val : float, array-like or str
the conductivity in ohm*m. If array-like must be same length as self.frequency. if str, it
must be a key in skrf.data.materials.
Examples
skrf.media.rectangularWaveguide.RectangularWaveguide.v_p
RectangularWaveguide.v_p
complex phase velocity (in m/s)
j · ω/γ
skrf.media.rectangularWaveguide.RectangularWaveguide.z0
RectangularWaveguide.z0
Port Impedance
The port impedance is usually equal to the characteristic_impedance. Therefore, if the port impedance
is None then this will return characteristic_impedance.
However, in some cases such as rectangular waveguide, the port impedance is traditionally set to 1 (normalized).
In such a case this property may be used.
The Port Impedance can be either a number, array-like, or a function. If it is a function is must take no arguments.
The reason to make it a function is if you want the Port Impedance to be dynamic, meaning changing with some
attribute of the media. See __init__() for more explanation.
Returns port_impedance : numpy.ndarray
the media’s port impedance
Methods
skrf.media.rectangularWaveguide.RectangularWaveguide.Z0
RectangularWaveguide.Z0()
The characteristic impedance
skrf.media.rectangularWaveguide.RectangularWaveguide.__init__
Examples
Most common usage is standard aspect ratio (2:1) dominant mode, TE10 mode of wr10 waveguide can be
constructed by
>>> freq = rf.Frequency(75,110,101,’ghz’)
>>> rf.RectangularWaveguide(freq, 100*mil)
skrf.media.rectangularWaveguide.RectangularWaveguide.capacitor
RectangularWaveguide.capacitor(C, **kwargs)
Capacitor
Parameters C : number, array
Capacitance, in Farads. If this is an array, must be of same length as frequency vector.
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns capacitor : a 2-port Network
See Also:
skrf.media.rectangularWaveguide.RectangularWaveguide.delay_load
Notes
This calls
line(d,unit, **kwargs) ** load(Gamma0, **kwargs)
Examples
skrf.media.rectangularWaveguide.RectangularWaveguide.delay_open
skrf.media.rectangularWaveguide.RectangularWaveguide.delay_short
skrf.media.rectangularWaveguide.RectangularWaveguide.electrical_length
RectangularWaveguide.electrical_length(d, deg=False)
calculates the electrical length for a given distance, at the center frequency.
Parameters d: number or array-like :
delay distance, in meters
deg: Boolean :
return electral length in deg?
Returns theta: number or array-like :
electrical length in radians or degrees, depending on value of deg.
skrf.media.rectangularWaveguide.RectangularWaveguide.from_csv
skrf.media.rectangularWaveguide.RectangularWaveguide.guess_length_of_delay_short
RectangularWaveguide.guess_length_of_delay_short(aNtwk)
Guess physical length of a delay short.
Unwraps the phase and determines the slope, which is then used in conjunction with
propagation_constant to estimate the physical distance to the short.
Parameters aNtwk : Network object
(note: if this is a measurment it needs to be normalized to the reference plane)
skrf.media.rectangularWaveguide.RectangularWaveguide.impedance_mismatch
Notes
skrf.media.rectangularWaveguide.RectangularWaveguide.inductor
RectangularWaveguide.inductor(L, **kwargs)
Inductor
Parameters L : number, array
Inductance, in Henrys. If this is an array, must be of same length as frequency vector.
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns inductor : a 2-port Network
See Also:
skrf.media.rectangularWaveguide.RectangularWaveguide.kz
RectangularWaveguide.kz()
The Longitudinal wave number, aka propagation constant.
Defined as
q
kz = ± k02 − kc2
This is.
• IMAGINARY for propagating modes
Returns kz : number
The propagation constant
skrf.media.rectangularWaveguide.RectangularWaveguide.line
Examples
skrf.media.rectangularWaveguide.RectangularWaveguide.load
skrf.media.rectangularWaveguide.RectangularWaveguide.match
Examples
skrf.media.rectangularWaveguide.RectangularWaveguide.open
RectangularWaveguide.open(nports=1, **kwargs)
Open (Γ0 = 1)
Parameters nports : int
number of ports
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns match : Network object
a n-port open circuit
See Also:
skrf.media.rectangularWaveguide.RectangularWaveguide.random
RectangularWaveguide.random(n_ports=1, **kwargs)
Complex random network.
Creates a n-port network whose s-matrix is filled with random complex numbers.
Parameters n_ports : int
number of ports.
**kwargs : passed to Network
initializer
Returns result : Network object
the network
skrf.media.rectangularWaveguide.RectangularWaveguide.resistor
skrf.media.rectangularWaveguide.RectangularWaveguide.short
RectangularWaveguide.short(nports=1, **kwargs)
Short (Γ0 = −1)
Parameters nports : int
number of ports
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns match : Network object
a n-port short circuit
See Also:
skrf.media.rectangularWaveguide.RectangularWaveguide.shunt
RectangularWaveguide.shunt(ntwk, **kwargs)
Shunts a Network
This creates a tee() and connects connects ntwk to port 1, and returns the result
Parameters ntwk : Network object
**kwargs : keyword arguments
passed to tee()
Returns shunted_ntwk : Network object
skrf.media.rectangularWaveguide.RectangularWaveguide.shunt_capacitor
Notes
This calls:
shunt(capacitor(C,*args, **kwargs))
skrf.media.rectangularWaveguide.RectangularWaveguide.shunt_delay_load
RectangularWaveguide.shunt_delay_load(*args, **kwargs)
Shunted delayed load
Parameters *args,**kwargs : arguments, keyword arguments
passed to func:delay_load
Returns shunt_delay_load : Network object
a shunted delayed load (2-port)
Notes
This calls:
shunt(delay_load(*args, **kwargs))
skrf.media.rectangularWaveguide.RectangularWaveguide.shunt_delay_open
RectangularWaveguide.shunt_delay_open(*args, **kwargs)
Shunted delayed open
Parameters *args,**kwargs : arguments, keyword arguments
passed to func:delay_open
Returns shunt_delay_open : Network object
shunted delayed open (2-port)
Notes
This calls:
shunt(delay_open(*args, **kwargs))
skrf.media.rectangularWaveguide.RectangularWaveguide.shunt_delay_short
RectangularWaveguide.shunt_delay_short(*args, **kwargs)
Shunted delayed short
Parameters *args,**kwargs : arguments, keyword arguments
passed to func:delay_open
Returns shunt_delay_load : Network object
shunted delayed open (2-port)
Notes
This calls:
shunt(delay_short(*args, **kwargs))
skrf.media.rectangularWaveguide.RectangularWaveguide.shunt_inductor
Notes
This calls:
shunt(inductor(C,*args, **kwargs))
skrf.media.rectangularWaveguide.RectangularWaveguide.splitter
RectangularWaveguide.splitter(nports, **kwargs)
Ideal, lossless n-way splitter.
Parameters nports : int
number of ports
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns tee : Network object
a n-port splitter
See Also:
skrf.media.rectangularWaveguide.RectangularWaveguide.tee
RectangularWaveguide.tee(**kwargs)
Ideal, lossless tee. (3-port splitter)
Parameters **kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns tee : Network object
a 3-port splitter
See Also:
skrf.media.rectangularWaveguide.RectangularWaveguide.theta_2_d
RectangularWaveguide.theta_2_d(theta, deg=True)
Converts electrical length to physical distance.
The given electrical length is to be at the center frequency.
Parameters theta : number
electrical length, at band center (see deg for unit)
deg : Boolean
is theta in degrees?
Returns d : number
physical distance in meters
skrf.media.rectangularWaveguide.RectangularWaveguide.thru
RectangularWaveguide.thru(**kwargs)
Matched transmission line of length 0.
Parameters **kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns thru : Network object
skrf.media.rectangularWaveguide.RectangularWaveguide.white_gaussian_polar
skrf.media.rectangularWaveguide.RectangularWaveguide.write_csv
from_csv class method to initialize Media object from a csv file written from this function
skrf.media.cpw.CPW
Attributes
skrf.media.cpw.CPW.K_ratio
CPW.K_ratio
intermediary parameter. see qucs docs on cpw lines.
skrf.media.cpw.CPW.alpha_conductor
CPW.alpha_conductor
Losses due to conductor resistivity
Returns alpha_conductor : array-like
lossyness due to conductor losses
See Also :
———- :
surface_resistivity : calculates surface resistivity
skrf.media.cpw.CPW.characteristic_impedance
CPW.characteristic_impedance
Characterisitc impedance
The characteristic_impedance can be either a number, array-like, or a function. If it is a function is must take no
arguments. The reason to make it a function is if you want the characterisitc impedance to be dynamic, meaning
changing with some attribute of the media. See __init__() for more explanation.
Returns characteristic_impedance : numpy.ndarray
skrf.media.cpw.CPW.ep_re
CPW.ep_re
intermediary parameter. see qucs docs on cpw lines.
skrf.media.cpw.CPW.k1
CPW.k1
intermediary parameter. see qucs docs on cpw lines.
skrf.media.cpw.CPW.portz0
CPW.portz0
Port Impedance
The port impedance is usually equal to the characteristic_impedance. Therefore, if the port impedance
is None then this will return characteristic_impedance.
However, in some cases such as rectangular waveguide, the port impedance is traditionally set to 1 (normalized).
In such a case this property may be used.
The Port Impedance can be either a number, array-like, or a function. If it is a function is must take no arguments.
The reason to make it a function is if you want the Port Impedance to be dynamic, meaning changing with some
attribute of the media. See __init__() for more explanation.
Returns port_impedance : numpy.ndarray
the media’s port impedance
skrf.media.cpw.CPW.propagation_constant
CPW.propagation_constant
Propagation constant
The propagation constant can be either a number, array-like, or a function. If it is a function is must take no
arguments. The reason to make it a function is if you want the propagation constant to be dynamic, meaning
changing with some attribute of the media. See __init__() for more explanation.
Returns propagation_constant : numpy.ndarray
complex propagation constant for this media
Notes
skrf.media.cpw.CPW.v_p
CPW.v_p
complex phase velocity (in m/s)
j · ω/γ
skrf.media.cpw.CPW.z0
CPW.z0
Port Impedance
The port impedance is usually equal to the characteristic_impedance. Therefore, if the port impedance
is None then this will return characteristic_impedance.
However, in some cases such as rectangular waveguide, the port impedance is traditionally set to 1 (normalized).
In such a case this property may be used.
The Port Impedance can be either a number, array-like, or a function. If it is a function is must take no arguments.
The reason to make it a function is if you want the Port Impedance to be dynamic, meaning changing with some
attribute of the media. See __init__() for more explanation.
Returns port_impedance : numpy.ndarray
the media’s port impedance
Methods
Z0 Characterisitc impedance
__init__ Coplanar Waveguide initializer
capacitor Capacitor
delay_load Delayed load
delay_open Delayed open transmission line
delay_short Delayed Short
electrical_length calculates the electrical length for a given distance, at
from_csv create a Media from numerical values stored in a csv file.
gamma Propagation constant ..
guess_length_of_delay_short Guess physical length of a delay short.
impedance_mismatch Two-port network for an impedance miss-match
inductor Inductor
line Matched transmission line of given length
load Load of given reflection coefficient.
match Perfect matched load (Γ0 = 0).
open Open (Γ0 = 1)
random Complex random network.
resistor Resistor
short Short (Γ0 = −1)
shunt Shunts a Network
shunt_capacitor Shunted capacitor
shunt_delay_load Shunted delayed load
shunt_delay_open Shunted delayed open
shunt_delay_short Shunted delayed short
shunt_inductor Shunted inductor
splitter Ideal, lossless n-way splitter.
tee Ideal, lossless tee.
theta_2_d Converts electrical length to physical distance.
thru Matched transmission line of length 0.
white_gaussian_polar Complex zero-mean gaussian white-noise network.
write_csv write this media’s frequency, z0, and gamma to a csv file.
skrf.media.cpw.CPW.Z0
CPW.Z0()
Characterisitc impedance
skrf.media.cpw.CPW.__init__
skrf.media.cpw.CPW.capacitor
CPW.capacitor(C, **kwargs)
Capacitor
Parameters C : number, array
Capacitance, in Farads. If this is an array, must be of same length as frequency vector.
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns capacitor : a 2-port Network
See Also:
skrf.media.cpw.CPW.delay_load
Notes
This calls
line(d,unit, **kwargs) ** load(Gamma0, **kwargs)
Examples
skrf.media.cpw.CPW.delay_open
skrf.media.cpw.CPW.delay_short
skrf.media.cpw.CPW.electrical_length
CPW.electrical_length(d, deg=False)
calculates the electrical length for a given distance, at the center frequency.
Parameters d: number or array-like :
delay distance, in meters
deg: Boolean :
return electral length in deg?
Returns theta: number or array-like :
electrical length in radians or degrees, depending on value of deg.
skrf.media.cpw.CPW.from_csv
skrf.media.cpw.CPW.gamma
CPW.gamma()
Propagation constant
See Also:
skrf.media.cpw.CPW.guess_length_of_delay_short
CPW.guess_length_of_delay_short(aNtwk)
Guess physical length of a delay short.
Unwraps the phase and determines the slope, which is then used in conjunction with
propagation_constant to estimate the physical distance to the short.
Parameters aNtwk : Network object
(note: if this is a measurment it needs to be normalized to the reference plane)
skrf.media.cpw.CPW.impedance_mismatch
Notes
skrf.media.cpw.CPW.inductor
CPW.inductor(L, **kwargs)
Inductor
Parameters L : number, array
Inductance, in Henrys. If this is an array, must be of same length as frequency vector.
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns inductor : a 2-port Network
See Also:
skrf.media.cpw.CPW.line
Examples
skrf.media.cpw.CPW.load
skrf.media.cpw.CPW.match
Examples
skrf.media.cpw.CPW.open
CPW.open(nports=1, **kwargs)
Open (Γ0 = 1)
Parameters nports : int
number of ports
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
skrf.media.cpw.CPW.random
CPW.random(n_ports=1, **kwargs)
Complex random network.
Creates a n-port network whose s-matrix is filled with random complex numbers.
Parameters n_ports : int
number of ports.
**kwargs : passed to Network
initializer
Returns result : Network object
the network
skrf.media.cpw.CPW.resistor
skrf.media.cpw.CPW.short
CPW.short(nports=1, **kwargs)
Short (Γ0 = −1)
Parameters nports : int
number of ports
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns match : Network object
a n-port short circuit
See Also:
skrf.media.cpw.CPW.shunt
CPW.shunt(ntwk, **kwargs)
Shunts a Network
This creates a tee() and connects connects ntwk to port 1, and returns the result
Parameters ntwk : Network object
**kwargs : keyword arguments
passed to tee()
Returns shunted_ntwk : Network object
a shunted a ntwk. The resultant shunted_ntwk will have (2 + ntwk.number_of_ports -1)
ports.
skrf.media.cpw.CPW.shunt_capacitor
Notes
This calls:
shunt(capacitor(C,*args, **kwargs))
skrf.media.cpw.CPW.shunt_delay_load
CPW.shunt_delay_load(*args, **kwargs)
Shunted delayed load
Parameters *args,**kwargs : arguments, keyword arguments
passed to func:delay_load
Returns shunt_delay_load : Network object
a shunted delayed load (2-port)
Notes
This calls:
shunt(delay_load(*args, **kwargs))
skrf.media.cpw.CPW.shunt_delay_open
CPW.shunt_delay_open(*args, **kwargs)
Shunted delayed open
Parameters *args,**kwargs : arguments, keyword arguments
passed to func:delay_open
Returns shunt_delay_open : Network object
shunted delayed open (2-port)
Notes
This calls:
shunt(delay_open(*args, **kwargs))
skrf.media.cpw.CPW.shunt_delay_short
CPW.shunt_delay_short(*args, **kwargs)
Shunted delayed short
Parameters *args,**kwargs : arguments, keyword arguments
passed to func:delay_open
Returns shunt_delay_load : Network object
shunted delayed open (2-port)
Notes
This calls:
shunt(delay_short(*args, **kwargs))
skrf.media.cpw.CPW.shunt_inductor
passed to func:delay_open
Returns shunt_inductor : Network object
shunted inductor(2-port)
Notes
This calls:
shunt(inductor(C,*args, **kwargs))
skrf.media.cpw.CPW.splitter
CPW.splitter(nports, **kwargs)
Ideal, lossless n-way splitter.
Parameters nports : int
number of ports
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns tee : Network object
a n-port splitter
See Also:
skrf.media.cpw.CPW.tee
CPW.tee(**kwargs)
Ideal, lossless tee. (3-port splitter)
Parameters **kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns tee : Network object
a 3-port splitter
See Also:
skrf.media.cpw.CPW.theta_2_d
CPW.theta_2_d(theta, deg=True)
Converts electrical length to physical distance.
The given electrical length is to be at the center frequency.
skrf.media.cpw.CPW.thru
CPW.thru(**kwargs)
Matched transmission line of length 0.
Parameters **kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns thru : Network object
matched tranmission line of 0 length
See Also:
skrf.media.cpw.CPW.white_gaussian_polar
skrf.media.cpw.CPW.write_csv
from_csv class method to initialize Media object from a csv file written from this function
skrf.media.freespace.Freespace
Attributes
0
Y Distributed Admittance, Y
0
Z Distributed Impedance, Z
characteristic_impedance Characterisitc impedance
portz0 Port Impedance
propagation_constant Propagation constant
v_p complex phase velocity (in m/s)
z0 Port Impedance
skrf.media.freespace.Freespace.Y
Freespace.Y
0
Distributed Admittance, Y
Defined as
0 0 0
Y = G + jωC
Returns Y : numpy.ndarray
Distributed Admittance in units of S/m
skrf.media.freespace.Freespace.Z
Freespace.Z
0
Distributed Impedance, Z
Defined as
0 0 0
Z = R + jωI
Returns Z : numpy.ndarray
Distributed impedance in units of ohm/m
skrf.media.freespace.Freespace.characteristic_impedance
Freespace.characteristic_impedance
Characterisitc impedance
The characteristic_impedance can be either a number, array-like, or a function. If it is a function is must take no
arguments. The reason to make it a function is if you want the characterisitc impedance to be dynamic, meaning
changing with some attribute of the media. See __init__() for more explanation.
Returns characteristic_impedance : numpy.ndarray
skrf.media.freespace.Freespace.portz0
Freespace.portz0
Port Impedance
The port impedance is usually equal to the characteristic_impedance. Therefore, if the port impedance
is None then this will return characteristic_impedance.
However, in some cases such as rectangular waveguide, the port impedance is traditionally set to 1 (normalized).
In such a case this property may be used.
The Port Impedance can be either a number, array-like, or a function. If it is a function is must take no arguments.
The reason to make it a function is if you want the Port Impedance to be dynamic, meaning changing with some
attribute of the media. See __init__() for more explanation.
Returns port_impedance : numpy.ndarray
the media’s port impedance
skrf.media.freespace.Freespace.propagation_constant
Freespace.propagation_constant
Propagation constant
The propagation constant can be either a number, array-like, or a function. If it is a function is must take no
arguments. The reason to make it a function is if you want the propagation constant to be dynamic, meaning
changing with some attribute of the media. See __init__() for more explanation.
Returns propagation_constant : numpy.ndarray
complex propagation constant for this media
Notes
skrf.media.freespace.Freespace.v_p
Freespace.v_p
complex phase velocity (in m/s)
j · ω/γ
skrf.media.freespace.Freespace.z0
Freespace.z0
Port Impedance
The port impedance is usually equal to the characteristic_impedance. Therefore, if the port impedance
is None then this will return characteristic_impedance.
However, in some cases such as rectangular waveguide, the port impedance is traditionally set to 1 (normalized).
In such a case this property may be used.
The Port Impedance can be either a number, array-like, or a function. If it is a function is must take no arguments.
The reason to make it a function is if you want the Port Impedance to be dynamic, meaning changing with some
attribute of the media. See __init__() for more explanation.
Returns port_impedance : numpy.ndarray
the media’s port impedance
Methods
Z0 Characteristic Impedance, Z0
__init__ Freespace initializer
capacitor Capacitor
delay_load Delayed load
delay_open Delayed open transmission line
delay_short Delayed Short
electrical_length calculates the electrical length for a given distance, at
from_Media Initializes a DistributedCircuit from an existing
from_csv create a Media from numerical values stored in a csv file.
gamma Propagation Constant, γ
Continued on next page
skrf.media.freespace.Freespace.Z0
Freespace.Z0()
Characteristic Impedance, Z0
r
Z0
Z0 =
Y0
Returns Z0 : numpy.ndarray
Characteristic Impedance in units of ohms
skrf.media.freespace.Freespace.__init__
Notes
skrf.media.freespace.Freespace.capacitor
Freespace.capacitor(C, **kwargs)
Capacitor
Parameters C : number, array
Capacitance, in Farads. If this is an array, must be of same length as frequency vector.
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns capacitor : a 2-port Network
See Also:
skrf.media.freespace.Freespace.delay_load
See Also:
Notes
This calls
line(d,unit, **kwargs) ** load(Gamma0, **kwargs)
Examples
skrf.media.freespace.Freespace.delay_open
skrf.media.freespace.Freespace.delay_short
unit : [’m’,’deg’,’rad’]
the units of d. possible options are:
• m : meters, physical length in meters (default)
• deg :degrees, electrical length in degrees
• rad :radians, electrical length in radians
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns delay_short : Network object
a delayed short
See Also:
skrf.media.freespace.Freespace.electrical_length
Freespace.electrical_length(d, deg=False)
calculates the electrical length for a given distance, at the center frequency.
Parameters d: number or array-like :
delay distance, in meters
deg: Boolean :
return electral length in deg?
Returns theta: number or array-like :
electrical length in radians or degrees, depending on value of deg.
skrf.media.freespace.Freespace.from_Media
skrf.media.freespace.Freespace.from_csv
skrf.media.freespace.Freespace.gamma
Freespace.gamma()
Propagation Constant, γ
Defined as,
√
γ= Z0 Y 0
Notes
skrf.media.freespace.Freespace.guess_length_of_delay_short
Freespace.guess_length_of_delay_short(aNtwk)
Guess physical length of a delay short.
Unwraps the phase and determines the slope, which is then used in conjunction with
propagation_constant to estimate the physical distance to the short.
Parameters aNtwk : Network object
(note: if this is a measurment it needs to be normalized to the reference plane)
skrf.media.freespace.Freespace.impedance_mismatch
Notes
skrf.media.freespace.Freespace.inductor
Freespace.inductor(L, **kwargs)
Inductor
Parameters L : number, array
Inductance, in Henrys. If this is an array, must be of same length as frequency vector.
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns inductor : a 2-port Network
See Also:
skrf.media.freespace.Freespace.line
Examples
skrf.media.freespace.Freespace.load
skrf.media.freespace.Freespace.match
Examples
skrf.media.freespace.Freespace.open
Freespace.open(nports=1, **kwargs)
Open (Γ0 = 1)
Parameters nports : int
number of ports
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
skrf.media.freespace.Freespace.random
Freespace.random(n_ports=1, **kwargs)
Complex random network.
Creates a n-port network whose s-matrix is filled with random complex numbers.
Parameters n_ports : int
number of ports.
**kwargs : passed to Network
initializer
Returns result : Network object
the network
skrf.media.freespace.Freespace.resistor
skrf.media.freespace.Freespace.short
Freespace.short(nports=1, **kwargs)
Short (Γ0 = −1)
Parameters nports : int
number of ports
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns match : Network object
a n-port short circuit
See Also:
skrf.media.freespace.Freespace.shunt
Freespace.shunt(ntwk, **kwargs)
Shunts a Network
This creates a tee() and connects connects ntwk to port 1, and returns the result
Parameters ntwk : Network object
**kwargs : keyword arguments
passed to tee()
Returns shunted_ntwk : Network object
a shunted a ntwk. The resultant shunted_ntwk will have (2 + ntwk.number_of_ports -1)
ports.
skrf.media.freespace.Freespace.shunt_capacitor
Notes
This calls:
shunt(capacitor(C,*args, **kwargs))
skrf.media.freespace.Freespace.shunt_delay_load
Freespace.shunt_delay_load(*args, **kwargs)
Shunted delayed load
Parameters *args,**kwargs : arguments, keyword arguments
passed to func:delay_load
Returns shunt_delay_load : Network object
a shunted delayed load (2-port)
Notes
This calls:
shunt(delay_load(*args, **kwargs))
skrf.media.freespace.Freespace.shunt_delay_open
Freespace.shunt_delay_open(*args, **kwargs)
Shunted delayed open
Parameters *args,**kwargs : arguments, keyword arguments
passed to func:delay_open
Returns shunt_delay_open : Network object
shunted delayed open (2-port)
Notes
This calls:
shunt(delay_open(*args, **kwargs))
skrf.media.freespace.Freespace.shunt_delay_short
Freespace.shunt_delay_short(*args, **kwargs)
Shunted delayed short
Parameters *args,**kwargs : arguments, keyword arguments
passed to func:delay_open
Returns shunt_delay_load : Network object
shunted delayed open (2-port)
Notes
This calls:
shunt(delay_short(*args, **kwargs))
skrf.media.freespace.Freespace.shunt_inductor
passed to func:delay_open
Returns shunt_inductor : Network object
shunted inductor(2-port)
Notes
This calls:
shunt(inductor(C,*args, **kwargs))
skrf.media.freespace.Freespace.splitter
Freespace.splitter(nports, **kwargs)
Ideal, lossless n-way splitter.
Parameters nports : int
number of ports
**kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns tee : Network object
a n-port splitter
See Also:
skrf.media.freespace.Freespace.tee
Freespace.tee(**kwargs)
Ideal, lossless tee. (3-port splitter)
Parameters **kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns tee : Network object
a 3-port splitter
See Also:
skrf.media.freespace.Freespace.theta_2_d
Freespace.theta_2_d(theta, deg=True)
Converts electrical length to physical distance.
The given electrical length is to be at the center frequency.
skrf.media.freespace.Freespace.thru
Freespace.thru(**kwargs)
Matched transmission line of length 0.
Parameters **kwargs : key word arguments
passed to match(), which is called initially to create a ‘blank’ network.
Returns thru : Network object
matched tranmission line of 0 length
See Also:
skrf.media.freespace.Freespace.white_gaussian_polar
skrf.media.freespace.Freespace.write_csv
from_csv class method to initialize Media object from a csv file written from this function
10.12 vi (skrf.vi)
This module holds Virtual Instruments that are intricately related to skrf.
• Development
s
skrf.calibration, 218
skrf.calibration.calibration, 218
skrf.calibration.calibrationAlgorithms,
226
skrf.calibration.calibrationFunctions,
230
skrf.constants, 205
skrf.frequency, 69
skrf.io, 208
skrf.io.csv, 217
skrf.io.general, 208
skrf.io.touchstone, 214
skrf.mathFunctions, 193
skrf.media, 239
skrf.network, 75
skrf.networkSet, 179
skrf.plotting, 188
skrf.tlineFunctions, 196
skrf.util, 206
skrf.vi, 318
317