| |
- __builtin__.object
-
- Network
class Network(__builtin__.object) |
|
Represents a n-port microwave network.
the most fundemental properties are:
s: scattering matrix. a kxnxn complex matrix where 'n' is number
of ports of network.
z0: characteristic impedance
f: frequency vector in Hz. see also frequency, which is a
Frequency object (see help on this class for more info)
The following operators are defined as follows:
'+' : element-wise addition of the s-matrix
'-' : element-wise subtraction of the s-matrix
'*' : element-wise multiplication of the s-matrix
'/' : element-wise division of the s-matrix
'**': cascading of two networks
'//': de-embdeding of one network from the other.
various other network properties are accesable as well as plotting
routines are also defined for convenience,
most properties are derived from the specifications given for
touchstone files. |
|
Methods defined here:
- __add__(self, other)
- element-wise addition of s-matrix
- __div__(self, other)
- element-wise complex division of s-matrix
- __floordiv__(self, other)
- implements de-embeding another network[s], from this network
see de_embed
- __init__(self, touchstone_file=None, name=None)
- constructor.
takes:
file: if given will load information from touchstone file
name: name of this network.
- __mul__(self, a)
- element-wise complex multiplication of s-matrix
- __pow__(self, other)
- implements cascading this network with another network
- __sub__(self, other)
- element-wise subtraction of s-matrix
- flip(self)
- swaps the ports of a two port
- interpolate(self)
- # self-modifications
- plot_polar_generic(self, attribute_r, attribute_theta, m=0, n=0, ax=None, show_legend=True, **kwargs)
- generic plotting function for plotting a Network's attribute
in polar form
takes:
- plot_s_db(self, m=0, n=0, ax=None, show_legend=True, **kwargs)
- plots the magnitude of the scattering parameter of indecies m, n
in log magnitude
takes:
m - first index, int
n - second indext, int
ax - matplotlib.axes object to plot on, used in case you
want to update an existing plot.
show_legend: boolean, to turn legend show legend of not
**kwargs - passed to the matplotlib.plot command
- plot_s_deg(self, m=0, n=0, ax=None, show_legend=True, **kwargs)
- plots the phase of a scattering parameter of indecies m, n in
degrees
takes:
m - first index, int
n - second indext, int
ax - matplotlib.axes object to plot on, used in case you
want to update an existing plot.
show_legend: boolean, to turn legend show legend of not
**kwargs - passed to the matplotlib.plot command
- plot_s_deg_unwrapped(self, m=0, n=0, ax=None, show_legend=True, **kwargs)
- plots the phase of a scattering parameter of indecies m, n in
unwrapped degrees
takes:
m - first index, int
n - second indext, int
ax - matplotlib.axes object to plot on, used in case you
want to update an existing plot.
show_legend: boolean, to turn legend show legend of not
**kwargs - passed to the matplotlib.plot command
- plot_s_mag(self, m=0, n=0, ax=None, show_legend=True, **kwargs)
- plots the magnitude of a scattering parameter of indecies m, n
not in magnitude
takes:
m - first index, int
n - second indext, int
ax - matplotlib.axes object to plot on, used in case you
want to update an existing plot.
show_legend: boolean, to turn legend show legend of not
**kwargs - passed to the matplotlib.plot command
- plot_s_polar(self, m=0, n=0, ax=None, show_legend=True, **kwargs)
- plots the scattering parameter of indecies m, n in polar form
takes:
m - first index, int
n - second indext, int
ax - matplotlib.axes object to plot on, used in case you
want to update an existing plot.
show_legend: boolean, to turn legend show legend of not
**kwargs - passed to the matplotlib.plot command
- plot_s_rad(self, m=0, n=0, ax=None, show_legend=True, **kwargs)
- plots the phase of a scattering parameter of indecies m, n in
radians
takes:
m - first index, int
n - second indext, int
ax - matplotlib.axes object to plot on, used in case you
want to update an existing plot.
show_legend: boolean, to turn legend show legend of not
**kwargs - passed to the matplotlib.plot command
- plot_s_rad_unwrapped(self, m=0, n=0, ax=None, show_legend=True, **kwargs)
- plots the phase of a scattering parameter of indecies m, n in
unwrapped radians
takes:
m - first index, int
n - second indext, int
ax - matplotlib.axes object to plot on, used in case you
want to update an existing plot.
show_legend: boolean, to turn legend show legend of not
**kwargs - passed to the matplotlib.plot command
- plot_s_smith(self, m=0, n=0, r=1, ax=None, show_legend=True, **kwargs)
- plots the scattering parameter of indecies m, n on smith chart
takes:
m - first index, int
n - second indext, int
r - radius of smith chart
ax - matplotlib.axes object to plot on, used in case you
want to update an existing plot.
show_legend: boolean, to turn legend show legend of not
**kwargs - passed to thematplotlib.plot command
- plot_vs_frequency_generic(self, attribute, y_label=None, m=0, n=0, ax=None, show_legend=True, **kwargs)
- generic plotting function for plotting a Network's attribute
vs frequency.
takes:
- read_touchstone(self, filename)
- loads values from a touchstone file.
takes:
filename - touchstone file name, string.
note:
ONLY 'S' FORMAT SUPORTED AT THE MOMENT
all work is tone in the touchstone class.
- write_touchstone(self, filename=None)
- write a touchstone file representing this network. the only
format supported at the moment is :
HZ S RI
takes:
filename - filename (not including extension)
note:
in the future could make possible use of the touchtone
class, but at the moment this would not provide any benefit
as it has not set_ functions.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- f
- the frequency vector for the network, in Hz.
- frequency
- returns a Frequency object, see frequency.py
- number_of_ports
- the number of ports the network has.
- s
- The scattering parameter matrix.
s-matrix has shape fxmxn,
where;
f is frequency axis and,
m and n are port indicies
- s_db
- returns the magnitude of the s-parameters, in dB
note:
dB is calculated by
20*log10(|s|)
- s_deg
- returns the phase of the s-parameters, in radians
- s_deg_unwrap
- returns the unwrapped phase of the s-paramerts, in degrees
- s_mag
- returns the magnitude of the s-parameters.
- s_rad
- returns the phase of the s-parameters, in radians.
- s_rad_unwrap
- returns the unwrapped phase of the s-parameters, in radians.
- t
- returns the t-parameters, which are also known as wave cascading
matrix.
- y
- z0
- the characteristic impedance of the network.
| |