A n-port electrical network.
The Network class stores these data structures internally in the form of complex numpy.ndarray’s. These arrays are not interfaced directly but instead through the use of the properties:
Property | Meaning |
---|---|
s | scattering parameter matrix |
z0 | characteristic impedance matrix |
f | frequency vector |
Individual components of the s-matrix are accesable through properties as well. These also return numpy.ndarray’s.
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 Network operators are available:
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 |
Generally, Network objects are created from touchstone files upon initializtion (see __init__()), or are created from a Media object. 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
Attributes
f | the frequency vector for the network, in Hz. |
frequency | frequency information for the network. |
inv | a Network object with ‘inverse’ s-parameters. |
nports | the number of ports the network has. |
number_of_ports | the number of ports the network has. |
passivity | passivity metric for a multi-port network. |
s | the scattering parameter matrix [#]_. |
t | t-parameters, aka scattering transfer parameters [#]_ |
y | admittance parameters |
z | impedance parameters |
z0 | the characteristic impedance[s] of the network ports. |
Methods
__init__ | constructor. |
add_noise_polar | adds a complex zero-mean gaussian white-noise. |
add_noise_polar_flatband | adds a flatband complex zero-mean gaussian white-noise signal of |
copy | returns a copy of this Network |
flip | swaps the ports of a two port Network |
interpolate | calculates an interpolated network. |
interpolate_self | interpolates s-parameters given a new |
interpolate_self_npoints | interpolate network based on a new number of frequency points |
multiply_noise | multiplys a complex bivariate gaussian white-noise signal |
nudge | perturb s-parameters by small amount. this is useful to |
plot_it_all | |
plot_passivity | plots the passivity of a network, possibly for a specific port. |
plot_s_smith | plots the scattering parameter on a smith chart |
read_touchstone | loads values from a touchstone file. |
renumber | renumbers some ports of a two port Network |
write_touchstone | write a contents of the Network to a touchstone file. |