skrf.network.Network

class skrf.network.Network(touchstone_file=None, name=None)

A n-port electrical network.

A n-port network may be defined by three quantities,
  • scattering parameter matrix (s-matrix)
  • port characteristic impedance matrix
  • frequency information

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.
number_of_ports the number of ports the network has.
passivity passivity metric for a multi-port network.
s the scattering parameter matrix [#]_.
Network.s_abs
Network.s_angle
Network.s_arcl
Network.s_arcl_unwrap
Network.s_db
Network.s_deg
Network.s_deg_unwrap
Network.s_im
Network.s_mag
Network.s_quad
Network.s_rad
Network.s_rad_unwrap
Network.s_re
t t-parameters, aka scattering transfer parameters [#]_
y admittance 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
Network.change_frequency
flip swaps the ports of a two port Network
interpolate calculates an interpolated network.
multiply_noise multiplys a complex bivariate gaussian white-noise signal
nudge perturb s-parameters by small amount. this is useful to
plot_passivity plots the passivity of a network, possibly for a specific port.
Network.plot_polar_generic
Network.plot_s_complex
Network.plot_s_polar
plot_s_smith plots the scattering parameter on a smith chart
Network.plot_vs_frequency_generic
read_touchstone loads values from a touchstone file.
write_touchstone write a contents of the Network to a touchstone file.

This Page