A n-port 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. |
| number_of_ports | the number of ports the network has. |
| passivity | passivity metric for a multi-port network. |
| s | the scattering parameter matrix [#]_. |
| s_abs | see s_mag |
| s_angle | see s_deg |
| s_arcl | arc-length of the s-parameters |
| s_arcl_unwrap | unwrapped arc-length of the s-parameters, see s_arcl |
| s_db | magnitude of the s-parameters, in dB |
| s_deg | phase of the s-parameters, in degrees |
| s_deg_unwrap | unwrapped phase of the s-paramerts, in degrees |
| s_im | imaginary part of the s-parameters. |
| s_mag | magnitude of the s-parameters. |
| s_quad | see s_arcl |
| s_rad | phase of the s-parameters, in radians. |
| s_rad_unwrap | unwrapped phase of the s-parameters, in radians. |
| s_re | real part of the s-parameters. |
| t | t-parameters, aka scattering transfer parameters [#]_ |
| y | needs work |
| 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 |
| 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. |
| plot_polar_generic | generic plotting function for plotting a Network’s attribute |
| plot_s_complex | plots the scattering parameter on complex plane |
| plot_s_polar | plots the scattering parameter in polar form. |
| plot_s_smith | plots the scattering parameter on a smith chart |
| plot_vs_frequency_generic | plot a Network attribute vs frequency. |
| read_touchstone | loads values from a touchstone file. |
| write_touchstone | write a contents of the Network to a touchstone file. |