skrf.vectorFitting.VectorFitting
- class skrf.vectorFitting.VectorFitting(network)[source]
This class provides a Python implementation of the Vector Fitting algorithm and various functions for the fit analysis, passivity evaluation and enforcement, and export of SPICE equivalent circuits.
- Parameters:
network (
skrf.network.Network
) – Network instance of the \(N\)-port holding the frequency responses to be fitted, for example a scattering, impedance or admittance matrix.
Examples
Load the Network, create a VectorFitting instance, perform the fit with a given number of real and complex-conjugate starting poles:
>>> nw_3port = skrf.Network('my3port.s3p') >>> vf = skrf.VectorFitting(nw_3port) >>> vf.vector_fit(n_poles_real=1, n_poles_cmplx=4)
Notes
The fitting code is based on the original algorithm [1] and on two improvements for relaxed pole relocation [2] and efficient (fast) solving [3]. See also the Vector Fitting website [4] for further information and download of the papers listed below. A Matlab implementation is also available there for reference.
References
Attributes
Instance variable holding the Network to be fitted. |
|
Instance variable holding the list of fitted poles. |
|
Instance variable holding the list of fitted residues. |
|
Instance variable holding the list of fitted proportional coefficients. |
|
Instance variable holding the list of fitted constants. |
|
Instance variable specifying the maximum number of iterations for the fitting process and for the passivity enforcement. |
|
Instance variable specifying the convergence criterion in terms of relative tolerance. |
|
Instance variable holding the wall-clock time (in seconds) consumed by the most recent fitting process with |
Methods
Automatic fitting routine implementing the "vector fitting with adding and skimming" algorithm as proposed in [#Grivet-Talocia]_. |
|
Returns the model order calculated with \(N_{real} + 2 N_{complex}\) for a given set of poles. |
|
Returns one of the frequency responses \(H_{i+1,j+1}\) of the fitted model \(H\). |
|
Returns the root-mean-square (rms) error magnitude of the fit, i.e. \(\sqrt{ \mathrm{mean}(|S - S_\mathrm{fit} |^2) }\), either for an individual response \(S_{i+1,j+1}\) or for larger slices of the network. |
|
Classifies fitted pole-residue pairs as spurious or not spurious. |
|
Returns the passivity status of the model as a boolean value. |
|
Enforces the passivity of the vector fitted model, if required. |
|
Evaluates the passivity of reciprocal vector fitted models by means of a half-size test matrix [#]_. |
|
Plots the specified component of the parameter \(H_{i+1,j+1}\) in the fit, where \(H\) is either the scattering (\(S\)), the impedance (\(Z\)), or the admittance (\(H\)) response specified in parameter. |
|
Plots the history of the model residue parameter d_res during the iterative pole relocation process of the vector fitting, which should eventually converge to a fixed value. |
|
Plots the history of the greatest singular value during the iterative passivity enforcement process, which should eventually converge to a value slightly lower than 1.0 or stop after reaching the maximum number of iterations specified in the class variable |
|
|
Plots the magnitude in dB of the scattering parameter response(s) in the fit. |
|
Plots the phase in degrees of the scattering parameter response(s) in the fit. |
|
Plots the unwrapped phase in degrees of the scattering parameter response(s) in the fit. |
|
Plots the imaginary part of the scattering parameter response(s) in the fit. |
|
Plots the magnitude in linear scale of the scattering parameter response(s) in the fit. |
|
Plots the real part of the scattering parameter response(s) in the fit. |
Plots the singular values of the vector fitted S-matrix in linear scale. |
|
Reads all model parameters |
|
Main work routine performing the vector fit. |
|
Writes the model parameters in |
|
Creates an equivalent N-port SPICE subcircuit based on its vector fitted S parameter responses. |