skrf.network.Network

class skrf.network.Network(file=None, name=None, comments=None, f_unit=None, **kwargs)[source]

A n-port electrical network [1].

For instructions on how to create Network see __init__().

A n-port network may be defined by three quantities,
  • network parameter matrix (s, z, or y-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

Although these docs focus on s-parameters, other equivalent network representations such as z and y are available. Scalar projections of the complex network parameters are accessible 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 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 ../../tutorials/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

[1]http://en.wikipedia.org/wiki/Two-port_network

Attributes

a abcd parameter matrix.
a_arcl The arcl component of the a-matrix
a_arcl_unwrap The arcl_unwrap component of the a-matrix
a_db The db component of the a-matrix
a_db10 The db10 component of the a-matrix
a_deg The deg component of the a-matrix
a_deg_unwrap The deg_unwrap component of the a-matrix
a_im The im component of the a-matrix
a_mag The mag component of the a-matrix
a_rad The rad component of the a-matrix
a_rad_unwrap The rad_unwrap component of the a-matrix
a_re The re component of the a-matrix
a_time The time component of the a-matrix
a_time_db The time_db component of the a-matrix
a_time_impulse The time_impulse component of the a-matrix
a_time_mag The time_mag component of the a-matrix
a_time_step The time_step component of the a-matrix
a_vswr The vswr component of the a-matrix
f the frequency vector for the network, in Hz.
frequency frequency information for the network.
group_delay The group delay
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.
port_tuples Returns a list of tuples, for each port index pair
reciprocity reciprocity metric for a multi-port network.
reciprocity2 Reciprocity metric #2
s Scattering parameter matrix.
s11 one-port sub-network.
s12 one-port sub-network.
s13 one-port sub-network.
s21 one-port sub-network.
s22 one-port sub-network.
s23 one-port sub-network.
s31 one-port sub-network.
s32 one-port sub-network.
s33 one-port sub-network.
s_arcl The arcl component of the s-matrix
s_arcl_unwrap The arcl_unwrap component of the s-matrix
s_db The db component of the s-matrix
s_db10 The db10 component of the s-matrix
s_deg The deg component of the s-matrix
s_deg_unwrap The deg_unwrap component of the s-matrix
s_im The im component of the s-matrix
s_mag The mag component of the s-matrix
s_rad The rad component of the s-matrix
s_rad_unwrap The rad_unwrap component of the s-matrix
s_re The re component of the s-matrix
s_time The time component of the s-matrix
s_time_db The time_db component of the s-matrix
s_time_impulse The time_impulse component of the s-matrix
s_time_mag The time_mag component of the s-matrix
s_time_step The time_step component of the s-matrix
s_vswr The vswr component of the s-matrix
sa Active scattering parameter matrix.
stability Stability factor
t Scattering transfer parameters
y Admittance parameter matrix.
y_arcl The arcl component of the y-matrix
y_arcl_unwrap The arcl_unwrap component of the y-matrix
y_db The db component of the y-matrix
y_db10 The db10 component of the y-matrix
y_deg The deg component of the y-matrix
y_deg_unwrap The deg_unwrap component of the y-matrix
y_im The im component of the y-matrix
y_mag The mag component of the y-matrix
y_rad The rad component of the y-matrix
y_rad_unwrap The rad_unwrap component of the y-matrix
y_re The re component of the y-matrix
y_time The time component of the y-matrix
y_time_db The time_db component of the y-matrix
y_time_impulse The time_impulse component of the y-matrix
y_time_mag The time_mag component of the y-matrix
y_time_step The time_step component of the y-matrix
y_vswr The vswr component of the y-matrix
z Impedance parameter matrix.
z0 Characteristic impedance[s] of the network ports.
z_arcl The arcl component of the z-matrix
z_arcl_unwrap The arcl_unwrap component of the z-matrix
z_db The db component of the z-matrix
z_db10 The db10 component of the z-matrix
z_deg The deg component of the z-matrix
z_deg_unwrap The deg_unwrap component of the z-matrix
z_im The im component of the z-matrix
z_mag The mag component of the z-matrix
z_rad The rad component of the z-matrix
z_rad_unwrap The rad_unwrap component of the z-matrix
z_re The re component of the z-matrix
z_time The time component of the z-matrix
z_time_db The time_db component of the z-matrix
z_time_impulse The time_impulse component of the z-matrix
z_time_mag The time_mag component of the z-matrix
z_time_step The time_step component of the z-matrix
z_vswr The vswr component of the z-matrix

Methods

__init__ Network 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 given standard deviations for magnitude and phase
copy Returns a copy of this Network
copy_from Copies the contents of another Network into self
crop Crop Network based on start and stop frequencies.
cropped returns a cropped network, leaves self alone.
delay Add phase delay to a given port.
extrapolate_to_dc Extrapolate S-parameters down to 0 Hz and interpolate to uniform spacing.
flip swaps the ports of a 2n-port Network in case the network is 2n-port and n > 1, ‘second’ numbering scheme is assumed to be consistent with the ** cascade operator.
flipped returns a flipped network, leaves self alone.
from_z
func_on_parameter Applies a function parameter matrix, one frequency slice at a time
gmm2se Transform network from generalized mixed mode parameters [1] to single ended parameters
impulse_response Calculates time-domain impulse response of one-port.
interpolate Interpolate a Network allong frequency axis
interpolate_from_f Interpolates s-parameters from a frequency vector.
interpolate_self Interpolates s-parameters given a new
interpolate_self_npoints Interpolate network based on a new number of frequency points
is_lossless test for losslessness
is_passive test for passivity
is_reciprocal test for reciprocity
is_symmetric Returns whether the 2N-port network has n-th order reflection symmetry by checking s_ii == s_jj for appropriate pair(s) of i and j.
multiply_noise multiplys a complex bivariate gaussian white-noise signal of given standard deviations for magnitude and phase.
nonreciprocity Normalized non-reciprocity metric.
nudge Perturb s-parameters by small amount.
plot plot somthing vs frequency
plot_a_arcl plot the Network attribute a_arcl vs frequency.
plot_a_arcl_unwrap plot the Network attribute a_arcl_unwrap vs frequency.
plot_a_complex plot the Network attribute a vs frequency.
plot_a_db plot the Network attribute a_db vs frequency.
plot_a_db10 plot the Network attribute a_db10 vs frequency.
plot_a_deg plot the Network attribute a_deg vs frequency.
plot_a_deg_unwrap plot the Network attribute a_deg_unwrap vs frequency.
plot_a_im plot the Network attribute a_im vs frequency.
plot_a_mag plot the Network attribute a_mag vs frequency.
plot_a_polar plot the Network attribute a vs frequency.
plot_a_rad plot the Network attribute a_rad vs frequency.
plot_a_rad_unwrap plot the Network attribute a_rad_unwrap vs frequency.
plot_a_re plot the Network attribute a_re vs frequency.
plot_a_time plot the Network attribute a_time vs frequency.
plot_a_time_db plot the Network attribute a_time_db vs frequency.
plot_a_time_impulse plot the Network attribute a_time_impulse vs frequency.
plot_a_time_mag plot the Network attribute a_time_mag vs frequency.
plot_a_time_step plot the Network attribute a_time_step vs frequency.
plot_a_vswr plot the Network attribute a_vswr vs frequency.
plot_it_all Plots dB, deg, smith, and complex in subplots
plot_passivity Plot dB(diag(passivity metric)) vs frequency
plot_reciprocity Plot reciprocity metric
plot_reciprocity2 Plot reciprocity metric #2
plot_s_arcl plot the Network attribute s_arcl vs frequency.
plot_s_arcl_unwrap plot the Network attribute s_arcl_unwrap vs frequency.
plot_s_complex plot the Network attribute s vs frequency.
plot_s_db plot the Network attribute s_db vs frequency.
plot_s_db10 plot the Network attribute s_db10 vs frequency.
plot_s_db_time
plot_s_deg plot the Network attribute s_deg vs frequency.
plot_s_deg_unwrap plot the Network attribute s_deg_unwrap vs frequency.
plot_s_im plot the Network attribute s_im vs frequency.
plot_s_mag plot the Network attribute s_mag vs frequency.
plot_s_polar plot the Network attribute s vs frequency.
plot_s_rad plot the Network attribute s_rad vs frequency.
plot_s_rad_unwrap plot the Network attribute s_rad_unwrap vs frequency.
plot_s_re plot the Network attribute s_re vs frequency.
plot_s_smith plots the scattering parameter on a smith chart
plot_s_time plot the Network attribute s_time vs frequency.
plot_s_time_db plot the Network attribute s_time_db vs frequency.
plot_s_time_impulse plot the Network attribute s_time_impulse vs frequency.
plot_s_time_mag plot the Network attribute s_time_mag vs frequency.
plot_s_time_step plot the Network attribute s_time_step vs frequency.
plot_s_vswr plot the Network attribute s_vswr vs frequency.
plot_y_arcl plot the Network attribute y_arcl vs frequency.
plot_y_arcl_unwrap plot the Network attribute y_arcl_unwrap vs frequency.
plot_y_complex plot the Network attribute y vs frequency.
plot_y_db plot the Network attribute y_db vs frequency.
plot_y_db10 plot the Network attribute y_db10 vs frequency.
plot_y_deg plot the Network attribute y_deg vs frequency.
plot_y_deg_unwrap plot the Network attribute y_deg_unwrap vs frequency.
plot_y_im plot the Network attribute y_im vs frequency.
plot_y_mag plot the Network attribute y_mag vs frequency.
plot_y_polar plot the Network attribute y vs frequency.
plot_y_rad plot the Network attribute y_rad vs frequency.
plot_y_rad_unwrap plot the Network attribute y_rad_unwrap vs frequency.
plot_y_re plot the Network attribute y_re vs frequency.
plot_y_time plot the Network attribute y_time vs frequency.
plot_y_time_db plot the Network attribute y_time_db vs frequency.
plot_y_time_impulse plot the Network attribute y_time_impulse vs frequency.
plot_y_time_mag plot the Network attribute y_time_mag vs frequency.
plot_y_time_step plot the Network attribute y_time_step vs frequency.
plot_y_vswr plot the Network attribute y_vswr vs frequency.
plot_z_arcl plot the Network attribute z_arcl vs frequency.
plot_z_arcl_unwrap plot the Network attribute z_arcl_unwrap vs frequency.
plot_z_complex plot the Network attribute z vs frequency.
plot_z_db plot the Network attribute z_db vs frequency.
plot_z_db10 plot the Network attribute z_db10 vs frequency.
plot_z_deg plot the Network attribute z_deg vs frequency.
plot_z_deg_unwrap plot the Network attribute z_deg_unwrap vs frequency.
plot_z_im plot the Network attribute z_im vs frequency.
plot_z_mag plot the Network attribute z_mag vs frequency.
plot_z_polar plot the Network attribute z vs frequency.
plot_z_rad plot the Network attribute z_rad vs frequency.
plot_z_rad_unwrap plot the Network attribute z_rad_unwrap vs frequency.
plot_z_re plot the Network attribute z_re vs frequency.
plot_z_time plot the Network attribute z_time vs frequency.
plot_z_time_db plot the Network attribute z_time_db vs frequency.
plot_z_time_impulse plot the Network attribute z_time_impulse vs frequency.
plot_z_time_mag plot the Network attribute z_time_mag vs frequency.
plot_z_time_step plot the Network attribute z_time_step vs frequency.
plot_z_vswr plot the Network attribute z_vswr vs frequency.
read Read a Network from a ‘ntwk’ file
read_touchstone loads values from a touchstone file.
renormalize Renormalize s-parameter matrix given a new port impedances
renumber renumbers ports of a Network
resample Interpolates s-parameters given a new
rotate Rotate S-parameters
se2gmm Transform network from single ended parameters to generalized mixed mode parameters [1]
step_response Calculates time-domain step response of one-port.
time_gate time gate this ntwk
to_dataframe Convert attributes of a Network to a pandas DataFrame
windowed Return a windowed version of s-matrix.
write Write the Network to disk using the pickle module.
write_spreadsheet Write contents of network to a spreadsheet, for your boss to use.
write_touchstone Write a contents of the Network to a touchstone file.
zipped_touchstone read a Network from a touchstone file in a ziparchive