|
Microwave filters GUI
2.0.3
|
[S] parameters class. More...
Public Member Functions | |
| def | __init__ |
| Initialize frequency axis attributes and compute S parameters from Characteristic Polynomials. | |
| def | fromCharPolys |
Compute S-Parameters ( , , , and ) from the characteristic polynomials. | |
| def | groupDelayfunc |
| This function returns the group delay as defined in [Cameron eq. | |
| def | fromCouplingMatrix |
Compute S-Parameters ( and ) from a coupling matrix. | |
| def | energyPowerFromCM |
| Compute stored energy and dissipated power at resonators and lossy couplings, from a coupling matrix. | |
| def | saveSparam |
| Save [S] parameters in output file. | |
[S] parameters class.
Definition at line 935 of file libcommonfunc.py.
| def libcommonfunc.Sparameters.__init__ | ( | self, | |
| P, | |||
| CP, | |||
| FT, | |||
freq = None, |
|||
checkPassive = True |
|||
| ) |
Initialize frequency axis attributes and compute S parameters from Characteristic Polynomials.
@param P = Parameters class instance, containing filter, synthesis and sweep parameters.
@param CP = CharPolys class instance, containing characteristic polynomials and constants.
@param FT = Frequency transform class instance, containing methods to normalize frequency and unnormalize group delay.
@param freq = Frequency axis (Hz). If equal to None, the frequency sweep based on P.minFreq, P.maxFreq and P.numFreq will be used. Default None.
@param checkPassive = If checkPassive is True, a warning will be raised when there are [S] parameters larger than 0 dB. Default True.
[S] parameters computed from characteristic polynomials.
except for asymmetrical "Prescribed Insertion Loss technique" case 1 (kS21+kS11), where it is computed as
In this "Prescribed Insertion Loss technique" case 1, the correct lossy values of
and
are obtained because
and
have been divided by
and
, respectively, when processing the polinomials at liblossyfilters.nonUniformQ() function . Fractional bandwidth of the FT used to compute this [S] parameters. Central frequency of the FT used to compute this [S] parameters. Frequency transform used to compute this [S] parameters. Frequency axis (Hz) Normalized
axis Dissipation factor. [Cameron eq. (3.118)] [TN 101.1 eq. (14)].
Complex frequency variable in normalized s-plane.
Parameter
computed from characteristic polynomials.
Parameter
computed from characteristic polynomials.
Parameter
computed from characteristic polynomials.
Parameter
computed from characteristic polynomials.
[Cameron eq. (6.15) pp. 212]
except for asymmetrical "Prescribed Insertion Loss technique" case 1 (kS21+kS11), where it is computed as
Group delay for the LowPass prototype Group delay for the unnormalized filter (sec) Phase of transfer function (rad) Phase of return losses (rad) Phase of inverse return losses (rad) Deviation from linear phase. It is the error between the phase of S21 and the straight line that best fits the phase in the center of the band in an interval equal to half the bandwidth. Parameter
computed from a coupling matrix. Parameter
computed from a coupling matrix. Parameter
computed from a coupling matrix. Power dissipated at resonators. 2-D numpy array of shape (Nf, Nr), where Nf is the number of frequencies and Nr the number of resonators. Energy stored at resonators. 2-D numpy array of shape (Nf, Nr), where Nf is the number of frequencies and Nr the number of resonators. Power dissipated at resistive couplings. Tuple ( (m, n), Gmn, powerDirect, powerReverse ) where power is a 1-D numpy array with one element for each frequency. Only entries n>m are stored. Energy stored at magnetic or electric couplings. Tuple ( (m, n), Bmn, energyDirect, energyReverse ) where energy is a 1-D numpy array with one element for each frequency. Only entries n>m are stored. Power dissipated at resonators, with reverse excitation. 2-D numpy array of shape (Nf, Nr), where Nf is the number of frequencies and Nr the number of resonators. Energy stored at resonators, with reverse excitation. 2-D numpy array of shape (Nf, Nr), where Nf is the number of frequencies and Nr the number of resonators.
Definition at line 965 of file libcommonfunc.py.
References libcommonfunc.Sparameters.deviationLP, libcommonfunc.Sparameters.energyCoup, libcommonfunc.Sparameters.energyRes, libcommonfunc.Sparameters.energyResRev, libcommonfunc.Sparameters.f0, libcommonfunc.Sparameters.FBW, libcommonfunc.Sparameters.freq, libcommonfunc.Sparameters.fromCharPolys(), libcommonfunc.Sparameters.FT, libcommonfunc.Sparameters.groupDelay, libcommonfunc.Sparameters.groupDelayfunc(), libcommonfunc.Sparameters.groupDelayLP, libcommonfunc.Sparameters.omega, libcommonfunc.Sparameters.phaseS11, libcommonfunc.Sparameters.phaseS21, libcommonfunc.Sparameters.phaseS22, libcommonfunc.Sparameters.powerCoup, libcommonfunc.Sparameters.powerRes, libcommonfunc.Sparameters.powerResRev, libcommonfunc.Sparameters.s, libcommonfunc.Sparameters.S11, libcommonfunc.Sparameters.S11M, libcommonfunc.Sparameters.S12, libcommonfunc.Sparameters.S21, libcommonfunc.Sparameters.S21M, libcommonfunc.Sparameters.S22, libcommonfunc.Sparameters.S22M, libcommonfunc.Sparameters.sigma, and libcommonfunc.warningMsg().

| def libcommonfunc.Sparameters.energyPowerFromCM | ( | self, | |
| MatQ | |||
| ) |
Compute stored energy and dissipated power at resonators and lossy couplings, from a coupling matrix.
Evaluation points are taken from attribute Sparameters.s .
Output in atributes Sparameters.energyRes, Sparameters.powerRes ,
which are 2D numpy arrays, each column is the energy(f) or power(f) at a resonator.
@param MatQ = MatrixQ class instance, containing the coupling matrix to process.
Dissipated power at \form#38-th resonator can be found as:
being
the voltage at each resonator and
the conductance of unloaded resonators
where
is the quality factor,
is the filter fractional bandwidth and
is the characteristic impedance of the resonators.
The stored energy is:
For resistive couplings between resonators \form#47 and \form#48, with conductance \form#49, the voltage drop at the coupling is \form#50 and, hence,
the dissipated power becomes:
Following [Pozar eq. (4.14) and (4.16)], the time harmonic complex power is
and, accounting that
, the stored energy at magnetic or electric couplings between resonators
and
, with susceptance
, is
Voltages at each resonator for unitary current excitation at source port are obtained as:
where
is the input current vector ![$ J(s) = [I_s \;\: 0 \ldots 0]^T $](form_58.png)
If the input is matched, the input current is
. We will assume input power
equal to 1 Watt.
The impedance matrix is computed as:
with
a diagonal matrix with the node scaling factor squared in the diagonal except in the non-resonant nodes positions, where it is zero. It means putting zeros in the extraNodesS first positions of the diagonal and in the last extraNodesL positions.
Definition at line 1408 of file libcommonfunc.py.
References libcommonfunc.Sparameters.energyCoup, libcommonfunc.Sparameters.energyRes, libcommonfunc.Sparameters.energyResRev, libcommonfunc.Sparameters.f0, libcommonfunc.Sparameters.FBW, libcommonfunc.Sparameters.freq, libcommonfunc.Sparameters.powerCoup, libcommonfunc.Sparameters.powerRes, libcommonfunc.Sparameters.powerResRev, libcommonfunc.Sparameters.s, and libcommonfunc.warningMsg().

| def libcommonfunc.Sparameters.fromCharPolys | ( | self, | |
| P, | |||
| evalS, | |||
| Ps, | |||
| Es, | |||
| Fs, | |||
| eps, | |||
| epsR | |||
| ) |
Compute S-Parameters (
,
,
, and
) from the characteristic polynomials.
Evaluation points are taken from attribute Sparameters.s . This method will be called by the BW and TZs optimization routines. Output in atributes Sparameters.S11, Sparameters.S12, Sparameters.S21 and Sparameters.S22 .
| P | = Parameters class instance, containing filter, synthesis and sweep parameters. |
| evalS | = Vector with the normalized complex frequencies (s) where we want to compute the group delay. |
| Ps | = Characteristic polynomial of the numerator of . |
| Es | = Characteristic polynomial of the denominator of and . |
| Fs | = Characteristic polynomial of the numerator of . |
| eps | = Characteristic constant in the denominator of and |
| epsR | = Characteristic constant in the denominator of |
Definition at line 1154 of file libcommonfunc.py.
References libcommonfunc.Sparameters.S11, libcommonfunc.Sparameters.S12, libcommonfunc.Sparameters.S21, and libcommonfunc.Sparameters.S22.
Referenced by libcommonfunc.Sparameters.__init__().

| def libcommonfunc.Sparameters.fromCouplingMatrix | ( | self, | |
| MatQ, | |||
evalS = None, |
|||
checkPassive = True |
|||
| ) |
Compute S-Parameters (
and
) from a coupling matrix.
Evaluation points are taken from attribute Sparameters.s .
Output in atributes Sparameters.S11M and Sparameters.S21M .
@param MatQ = MatrixQ class instance, containing the coupling matrix to process.
@param evalS = Normalized frequency axis (imaginary). If equal to None, it is set to 1j * np.imag(self.s). Default None.
@param checkPassive = If checkPassive is True, a warning will be raised when there are [S] parameters larger than 0 dB. Default True.
@return stErrorCM = String with a message about the error in [S] computed from M coupling matrix versus self.S11 and self.S21.
@return CM_error = Relative error in [S] computed from M coupling matrix versus self.S11 and self.S21 (float).
By definition, \form#29 and \form#30 can be found as:
where:
with
a diagonal matrix with the node scaling factor squared in the diagonal except in the non-resonant nodes positions, where it is zero. It means putting zeros in the extraNodesS first positions of the diagonal and in the last extraNodesL positions.
Phase of S11 return losses computed from coupling matrix Phase of S22 return losses computed from coupling matrix Phase of transfer function computed from coupling matrix Group delay computed from coupling matrix Frequency axis with sampling points in the middle of self.freq sampling. It is necessary to plot self.groupDelayM Group delay computed from Characteristic Polynomials, sampled at self.freq2 It is necessary to compare with self.groupDelayM
Definition at line 1223 of file libcommonfunc.py.
References libcommonfunc.Sparameters.freq, libcommonfunc.Sparameters.freq2, libcommonfunc.Sparameters.groupDelay, libcommonfunc.Sparameters.groupDelay2, libcommonfunc.Sparameters.groupDelayM, libcommonfunc.Sparameters.phaseS11M, libcommonfunc.Sparameters.phaseS21M, libcommonfunc.Sparameters.phaseS22M, libcommonfunc.Sparameters.S11, libcommonfunc.Sparameters.S11M, libcommonfunc.Sparameters.S21, libcommonfunc.Sparameters.S21M, libcommonfunc.Sparameters.S22, libcommonfunc.Sparameters.S22M, and libcommonfunc.warningMsg().

| def libcommonfunc.Sparameters.groupDelayfunc | ( | self, | |
| Es, | |||
| Ps, | |||
| evalS | |||
| ) |
This function returns the group delay as defined in [Cameron eq.
13.7, pp. 475-476] evaluated in the normalized complex frequency vector evalS .
| Es | = Characteristic polynomial of the denominator of and . |
| Ps | = Characteristic polynomial of the numerator of . |
| evalS | = Vector with the normalized complex frequencies (s) where we want to compute the group delay. |
are the frequency samples. Definition at line 1188 of file libcommonfunc.py.
Referenced by libcommonfunc.Sparameters.__init__().

| def libcommonfunc.Sparameters.saveSparam | ( | self, | |
| P, | |||
| prec | |||
| ) |
Save [S] parameters in output file.
S11, S12, S21 and S22 are attributes of sParameters class, and of type numpy.array.
| P | = Parameter class instance. |
| prec | = Number of correct significant digits to print. |
Definition at line 1519 of file libcommonfunc.py.
References libcommonfunc.complexStr(), libcommonfunc.Sparameters.freq, libcommonfunc.myPrint(), libcommonfunc.pkgNameVersion(), libcommonfunc.Sparameters.S11, libcommonfunc.Sparameters.S12, libcommonfunc.Sparameters.S21, and libcommonfunc.Sparameters.S22.

1.8.1.2