Microwave filters GUI  2.0.3
Public Member Functions | List of all members
libcommonfunc.CouplingMatrices Class Reference

Coupling matrices class. More...

Public Member Functions

def __init__
 Compute Coupling Matrices for all the selected topologies.
def matrixElementsEps
 Convenience function that computes the threshold to determine if coupling matrix elements (or their real or imaginary parts) are null.
def updateCM_error
 Convenience function that updates the error estimation in self.CM_error.
def transCouplingMatrix
 Computation of the $ N+2 $ transversal coupling matrix of the filter defined by its caracteristic polynomials and constants.
def polyExDiv
 Polynomial exact division.
def tcm2fcm
 This function transforms the transversal $N+2$ coupling matrix $M$ into the coupling matrix in Folded Canonical Form (FCM) $Mfcm$.
def tcm2arrow
 This function transforms the transversal $N+2$ coupling matrix $M$ into the coupling matrix in Arrow or Wheel Form $Marrow$.
def arrow2triplet
 This function transforms the coupling matrix in Arrow or Wheel Form $Marrow$ into the coupling matrix in Trisections Form $Mtriplet$.
def fcm2culdesac
 This function transforms the coupling matrix in Folded Canonical Form (FCM) $Mfcm$ into the Cul de Sac coupling matrix $Mculdesac$.
def fcm2cqs
 This function transforms the coupling matrix in Folded Canonical Form (FCM) $Mfcm$ into the Cascaded Quartets coupling matrix $Mcqs$.
def fcm2pfitzenmaier
 This function transforms the coupling matrix in Folded Canonical Form (FCM) $Mfcm$ into the Pfitzenmaier coupling matrix $Mpfi$.
def fcm2inlineAsymmetric
 This function transforms the coupling matrix in Folded Canonical Form (FCM) $Mfcm$ into the Inline Asymmetric coupling matrix $Minasym$.
def fcm2inlineSymmetric
 This function transforms the coupling matrix in Folded Canonical Form (FCM) $Mfcm$ into the Inline Symmetric coupling matrix $Minsym$.
def readCouplingMatrix
 Read coupling matrix from disk file.
def saveCouplingMatrices
 Save coupling matrices in output file.
def uniformQFCMOrder4
 This function transforms the Folded $N+2$ Canonical Form (FCM) coupling matrix of a filter of order 4 into an N+4 matrix so that all the resonant nodes have equal quality factor Q.
def uniformQFCMOrder6
 This function transforms the Folded $N+2$ Canonical Form (FCM) coupling matrix of a filter of order 6 into an N+4 matrix so that all the resonant nodes have equal quality factor Q.
def uniformQOrder6Optimize
 This function performs the hyperbolic rotations in TN102.3 sec.3.3.
def uniformQFCMOrder6Case3
 This function transforms the Folded $N+2$ Canonical Form (FCM) coupling matrix of a filter of order 6 into an N+4 matrix so that all the resonant nodes have equal quality factor Q.
def uniformQOrder6Case3Optimize
 This function performs the hyperbolic rotations in TN102.3.

Detailed Description

Coupling matrices class.

If \form#0 is the impedance matriz that relates the current at the network loops with the voltage sources within these loops,
the compupling matriz \form#1 is such that [TN 102.1, sec. 3.2]:

\[ [Z] = [jM + sI] \]

Todo:
Call numpy functions as methods of array class, whenever possible.

Definition at line 2844 of file libcommonfunc.py.

Constructor & Destructor Documentation

def libcommonfunc.CouplingMatrices.__init__ (   self,
  P,
  CP,
  Yo,
  FT,
  SP 
)

Compute Coupling Matrices for all the selected topologies.

    @param P  = Parameters class instance, containing filter, synthesis and sweep parameters.
    @param CP = CharPolys class instance, containing Characteristic Polynomials Es, Ps, Fs and constants eps, epsR.
    @param Yo = Termination admitance.
    @param FT = Frequency transformation class instance.
    @param SP = SParameters class instance.
    @return CM = CouplingMatrices class instance. 

Frequency transform used to compute these coupling matrices. It must be used when creating new matrices or reading matrices from disk. SParameters class instance containing the frequency sampling and SP.fromCouplingMatrix() method. Will be used in the sensitivity analysis. Uniform Q folded coupling matrix N+4. List of available coupling matrices Last index of CM selection comboBox. Initially it is equal to zero(first matrix in list). Roundoff error in the computation of the Tranversal Coupling Matrix N+2. The error is obtained as the maximum of the largest of the remainders in the computation of $ y_{22n}(s) $ and $ y_d(s) $ and the constant term in the partial fraction expansion of $ y_{21n}(s) / Y_d(s) $ Current coupling matrix, after rotations. Is the first in the list. Backup list of self.MatQ values, for undo. Must use deep copy, since self.MatQ will be modified by edit actions. Backup list of actions

Definition at line 2856 of file libcommonfunc.py.

References libcommonfunc.CouplingMatrices.arrow2triplet(), libcommonfunc.CouplingMatrices.bkpActions, libcommonfunc.CouplingMatrices.bkpMatQ, libcommonfunc.CouplingMatrices.CM_error, libcommonfunc.CouplingMatrices.fcm2cqs(), libcommonfunc.CouplingMatrices.fcm2culdesac(), libcommonfunc.CouplingMatrices.fcm2inlineAsymmetric(), libcommonfunc.CouplingMatrices.fcm2inlineSymmetric(), libcommonfunc.CouplingMatrices.fcm2pfitzenmaier(), libcommonfunc.CouplingMatrices.fCM_uniQ, libcommonfunc.Sparameters.FT, libcommonfunc.MatrixQ.FT, libcommonfunc.CouplingMatrices.FT, libcommonfunc.CouplingMatrices.indexCM, libcommonfunc.CouplingMatrices.listM, libcommonfunc.CouplingMatrices.MatQ, libcommonfunc.CouplingMatrices.SP, libcommonfunc.CouplingMatrices.tcm2arrow(), libcommonfunc.CouplingMatrices.tcm2fcm(), libcommonfunc.CouplingMatrices.transCouplingMatrix(), libcommonfunc.CouplingMatrices.uniformQFCMOrder4(), libcommonfunc.CouplingMatrices.uniformQFCMOrder6(), and libcommonfunc.CouplingMatrices.uniformQFCMOrder6Case3().

Here is the call graph for this function:

Member Function Documentation

def libcommonfunc.CouplingMatrices.arrow2triplet (   self,
  MatQarrow,
  TZ 
)

This function transforms the coupling matrix in Arrow or Wheel Form $Marrow$ into the coupling matrix in Trisections Form $Mtriplet$.

Parameters
MatQarrow= MatrixQ class instance, containing the Arrow topology coupling matrix.
TZ= Transmission Zeros.
Returns
MatQtriplet = MatrixQ class instance, containing the Trisections topology coupling matrix.

[Cameron]

Definition at line 3431 of file libcommonfunc.py.

Referenced by libcommonfunc.CouplingMatrices.__init__().

Here is the caller graph for this function:

def libcommonfunc.CouplingMatrices.fcm2cqs (   self,
  MatQfcm,
  r,
  UpDownNone 
)

This function transforms the coupling matrix in Folded Canonical Form (FCM) $Mfcm$ into the Cascaded Quartets coupling matrix $Mcqs$.

Parameters
MatQfcm= MatrixQ class instance, containing the Folded Canonical Form (FCM) coupling matrix.
r= If we want to shift the quartet, r indicates the position of the first resonator node of the quartet. It should be 0 if we do not want to shift it.
UpDownNone= 'Up' : Shift the quartet above the diagonal. 'Down' : Shift the quartet below the diagonal. 'None' : No shifting.
Returns
MatQcqs = MatrixQ class instance, containing the Cascaded Quartets coupling matrix.

[Cameron]

Definition at line 3507 of file libcommonfunc.py.

Referenced by libcommonfunc.CouplingMatrices.__init__().

Here is the caller graph for this function:

def libcommonfunc.CouplingMatrices.fcm2culdesac (   self,
  MatQfcm,
  TZ 
)

This function transforms the coupling matrix in Folded Canonical Form (FCM) $Mfcm$ into the Cul de Sac coupling matrix $Mculdesac$.

Parameters
MatQfcm= MatrixQ class instance, containing the Folded Canonical Form (FCM) coupling matrix.
TZ= Transmission Zeros.
Returns
MatQculdesac = MatrixQ class instance, containing the Cul de Sac coupling matrix.

[Cameron]

Definition at line 3466 of file libcommonfunc.py.

Referenced by libcommonfunc.CouplingMatrices.__init__().

Here is the caller graph for this function:

def libcommonfunc.CouplingMatrices.fcm2inlineAsymmetric (   self,
  MatQfcm 
)

This function transforms the coupling matrix in Folded Canonical Form (FCM) $Mfcm$ into the Inline Asymmetric coupling matrix $Minasym$.

Parameters
MatQfcm= MatrixQ class instance, containing the Folded Canonical Form (FCM) coupling matrix.
Returns
MatQinasym = MatrixQ class instance, containing the Inline Asymmetric coupling matrix.

[Cameron]

Definition at line 3601 of file libcommonfunc.py.

Referenced by libcommonfunc.CouplingMatrices.__init__().

Here is the caller graph for this function:

def libcommonfunc.CouplingMatrices.fcm2inlineSymmetric (   self,
  MatQfcm,
  TZ 
)

This function transforms the coupling matrix in Folded Canonical Form (FCM) $Mfcm$ into the Inline Symmetric coupling matrix $Minsym$.

Parameters
MatQfcm= MatrixQ class instance, containing the Folded Canonical Form (FCM) coupling matrix.
TZ= Transmission Zeros.
Returns
MatQinsym = MatrixQ class instance, containing the Inline Symmetric coupling matrix.

[Cameron]

Definition at line 3687 of file libcommonfunc.py.

Referenced by libcommonfunc.CouplingMatrices.__init__().

Here is the caller graph for this function:

def libcommonfunc.CouplingMatrices.fcm2pfitzenmaier (   self,
  MatQfcm 
)

This function transforms the coupling matrix in Folded Canonical Form (FCM) $Mfcm$ into the Pfitzenmaier coupling matrix $Mpfi$.

Parameters
MatQfcm= MatrixQ class instance, containing the Folded Canonical Form (FCM) coupling matrix.
Returns
MatQpfi = MatrixQ class instance, containing the Pfitzenmaier coupling matrix.

[Cameron]

Definition at line 3574 of file libcommonfunc.py.

Referenced by libcommonfunc.CouplingMatrices.__init__().

Here is the caller graph for this function:

def libcommonfunc.CouplingMatrices.matrixElementsEps (   self,
  st = None 
)

Convenience function that computes the threshold to determine if coupling matrix elements (or their real or imaginary parts) are null.

Parameters
st= String with relevant info. Default None.
Returns
eps = Threshold.

Definition at line 2962 of file libcommonfunc.py.

References libcommonfunc.CouplingMatrices.CM_error, and libcommonfunc.myPrint().

Here is the call graph for this function:

def libcommonfunc.CouplingMatrices.polyExDiv (   self,
  num,
  den 
)

Polynomial exact division.

Computes quot and remain polynomials so that num(s) = quot(s)*den(s) + error(s).

Parameters
num= Dividend.
den= Divisor.
Returns
quot = Quotient.
error = Error in the computation of the quotient. Is equal to: num(s)-quot(s)*den(s)

Algorithm

Since numpy.polydiv or the equivalent numpy.poly1d polynomial division fails for complex coefficients, at least in numpy v1.1.1, here we evaluate num(s)/den(s) for a finite number of points in the imaginary axis and use polyfit to build the polynomial that passes trhough this points. The remainder is the error.

This function does not work well with the example in "Prescribed_insertion_losses_K11+k21_asymmetrical.par" (the example in journal paper publication), while numpy.polydiv from numpy v1.3.0 works perfectly.

Definition at line 3318 of file libcommonfunc.py.

def libcommonfunc.CouplingMatrices.readCouplingMatrix (   self,
  fileName 
)

Read coupling matrix from disk file.

Parameters
fileName= File name (string).
Returns
MatQ = Coupling matrix (MatrixQ class instance.)

Definition at line 3829 of file libcommonfunc.py.

References libcommonfunc.Sparameters.FT, libcommonfunc.MatrixQ.FT, libcommonfunc.CouplingMatrices.FT, and libcommonfunc.myPrint().

Here is the call graph for this function:

def libcommonfunc.CouplingMatrices.saveCouplingMatrices (   self,
  P,
  SP,
  precCM,
  precEP 
)

Save coupling matrices in output file.

The matrices are attributes of CouplingMatrices class, and of type numpy.array.

Parameters
P= Parameter class instance.
SP= SParameters class instance.
precCM= Number of significant digits to save in coupling matrix and Q (int).
precEP= Number of significant digits to save in energy and power (int).

Definition at line 3876 of file libcommonfunc.py.

References libcommonfunc.CouplingMatrices.listM, and libcommonfunc.myPrint().

Here is the call graph for this function:

def libcommonfunc.CouplingMatrices.tcm2arrow (   self,
  MatQ 
)

This function transforms the transversal $N+2$ coupling matrix $M$ into the coupling matrix in Arrow or Wheel Form $Marrow$.

Parameters
MatQ= MatrixQ class instance, containing the transversal $N+2$ coupling matrix.
Returns
MatQarrow = MatrixQ class instance, containing the Arrow topology coupling matrix.

[Cameron]

Definition at line 3406 of file libcommonfunc.py.

Referenced by libcommonfunc.CouplingMatrices.__init__().

Here is the caller graph for this function:

def libcommonfunc.CouplingMatrices.tcm2fcm (   self,
  MatQ 
)

This function transforms the transversal $N+2$ coupling matrix $M$ into the coupling matrix in Folded Canonical Form (FCM) $Mfcm$.

    @param MatQ = MatrixQ class instance, containing the transversal \form#189 coupling matrix.
    @return MatQfcm =  MatrixQ class instance, containing the Folded Canonical Form (FCM) coupling matrix. 

    [TN 102.2 sec. 9.2]
    The procedure to obtain the matrix [FCM] consists in setting to zero step by step elements of the matrix [M] using the following:

    -Step 1: We remove all the elements of the row 1 (In total there are nerk(1) elements).

    -Step 2: We remove all the elements of the column 1 (In total there are neck(1) elements).

    -Step 3: The same as in step 1 with the row 2 (In total there are nerk(2) elements).

    -Step 4: The same as in step 2 with the column 2 (In total there are neck(2) elements).

$\vdots$

    -Step numSteps-1:  We remove all the elements of the row numRows (In total there are nerk(numRows) elements).

    -Step numSteps: We remove all the elements of the column numColumns (In total there are nerk(numColumns) elements).

    The last two steps consist in removing the last remaining row and the last remaining column of the matrix (it is not necessary that they are in that order).                                                                                                                                                                

Definition at line 3352 of file libcommonfunc.py.

Referenced by libcommonfunc.CouplingMatrices.__init__().

Here is the caller graph for this function:

def libcommonfunc.CouplingMatrices.transCouplingMatrix (   self,
  P,
  CP,
  Yo,
  FT 
)

Computation of the $ N+2 $ transversal coupling matrix of the filter defined by its caracteristic polynomials and constants.

        Polynomials are of type numpy.poly1d.
        This function sets the self.CM_error attribute to the roundoff error in the computation of M, 
        given by the largest of the remainders in the computation of \form#128 and \form#129 
        and the constant term in the partial fraction expansion of \form#130
        @param P  = Parameters class instance, containing filter, synthesis and sweep parameters.
        @param CP = CharPolys class instance, containing Characteristic Polynomials Es, Ps, Fs and constants eps, epsR.
        @param Yo = Termination admitance.
        @param FT = Frequency transformation class instance.
        @return MatQ = MatrixQ class instance, containing the N+2 transversal coupling matrix.

    @section Smat Scattering matrix [S]

    The first step to find the \form#131 transversal coupling matrix of a two-port network is finding the associated scattering matrix \form#132. 

    By definition, the scattering matrix of a two-port network is  [TN 102.1, eq (1)]:

\[ [S]=\begin{bmatrix} S_{11}(s) & S_{12}(s) \\ S_{21}(s) & S_{22}(s) \end{bmatrix} = \frac{1}{S_{d}(s)} \begin{bmatrix} S_{11n}(s) & S_{12n}(s) \\ S_{21n}(s) & S_{22n}(s) \end{bmatrix} \]

   The [S] parameters are computed from the polinomials as:

\[ S_{11} = \frac{1}{\epsilon_R} \frac{F(s)}{E(s)} \]

\[ S_{21} = S_{12} = \frac{1}{\epsilon} \frac{P(s)}{E(s)} \]

\[ S_{22} = \frac{1}{\epsilon_R} \frac{F_{22}(s)}{E(s)} = (-1)^N \frac{1}{\epsilon_R} \frac{F(s)^*}{E(s)} \]

except for asymmetrical "Prescribed Insertion Loss technique" case 1 (kS21+kS11), where [S] parameters are computed from the lossless case above as:

\[ S_{11} = k_{11} S_{11\mathrm{lossless}} \]

\[ S_{21} = S_{12} = k_{21} S_{21\mathrm{lossless}} \]

\[ S_{22} = k_{22} \left( 1 - \left( \frac{k_{21}}{k_{11}} \right) ^2 \right) + \left( \frac{k_{21}}{k_{11}} \right) ^2 S_{11 \mathrm{lossless}} \]

    and hence the numerators and denominator of the \form#137 rational polynomials are:

\[ S_{11n}(s) = \frac{F(s)}{\epsilon_{R}} \]

\[ S_{12n}(s) = S_{21n} = \frac{P(s)}{\epsilon} \]

\[ S_{d}(s) = E(s) \]

\[ S_{22n}(s) = \frac{F_{22}(s)}{\epsilon_R} \]

except for asymmetrical "Prescribed Insertion Loss technique" case 1 (kS21+kS11), where they are computed as

\[ S_{11n}(s) = k_{11} \frac{F(s)}{\epsilon_{R}} \]

\[ S_{12n}(s) = S_{21n} = k_{21} \frac{P(s)}{\epsilon} \]

\[ S_{d}(s) = E(s) \]

\[ S_{22n}(s) = k_{22} \left( 1 - \left( \frac{k_{21}}{k_{11}} \right) ^2 \right) \, S_d(s) + \left( \frac{k_{21}}{k_{11}} \right) ^2 S_{11n}(s) \]

In practice, the software divides $ \epsilon_R $ by $ k_{11} $ and $ \epsilon $ by $ k_{21} $ , and stores the updated values to automatically apply the $ k_{11} $ and $ k_{21} $ whenever computing $ S_{11n} $ and $ S_{21n} $ .

Admitance matrix [Y]

The next step is the computation of $ y_{21}(s)$ and $ y_{22}(s) $ of the admitance matrix $ [Y] $. [Y] is related to [S] as [TN 102.1, eq (12)]:

\[ [Y]= \frac{1}{y_{d}(s)} \begin{bmatrix} y_{11n}(s) & y_{12n}(s) \\ y_{21n}(s) & y_{22n}(s) \end{bmatrix} \]

Where:

\[ y_{21n}(s)= -2 \, S_{21n}(s) \]

\[ y_{22n}(s)=\frac{(S_{d}(s)+S_{11n}(s))(S_{d}(s)-S_{22n}(s))+S_{12n}S_{21n}}{S_{d}(s)} \]

\[ y_{11n}(s)=\frac{(S_{d}(s)-S_{11n}(s))(S_{d}(s)+S_{22n}(s))+S_{12n}S_{21n}}{S_{d}(s)} \]

\[ y_{d}(s)=\frac{(S_{d}(s)+S_{11n}(s))(S_{d}(s)+S_{22n}(s))-S_{12n}S_{21n}}{Y_{0}(s)S_{d}(s)} \]

$ Y_{0} $ = Load admitance at the end of the network.

    @section Mmat N+2 Coupling Matrix
    A partial fraction expansion of \form#156 yields [Cameron, eq. (8.41)] [TN 101.1, eq (12)]:

\[ [Y]= \frac{1}{y_{d}(s)} \begin{bmatrix} y_{11n}(s) & y_{12n}(s) \\ y_{21n}(s) & y_{22n}(s) \end{bmatrix} = j \begin{bmatrix} 0 & K_{\infty} \\ K_{\infty} & 0 \end{bmatrix} + \sum_{k=1}^N \frac{1}{s-j\lambda_k} \cdot \begin{bmatrix} r_{11k}(s) & r_{12k}(s) \\ r_{21k}(s) & r_{22k}(s) \end{bmatrix} + \begin{bmatrix} KK_{11} & 0 \\ 0 & KK_{22} \end{bmatrix} \]

    <ul>

    <li> Computation of the residuals \form#158 and \form#159:

    The residuals \form#158 and \form#159 can be found as [Cameron, pp. 294, footnote]:

\[ r_{22k}(s) = \left.\frac{y_{22n}(s)}{y'_{d}(s)}\right|_{s=j\lambda_{k}} \qquad r_{11k}(s) = \left.\frac{y_{11n}(s)}{y'_{d}(s)}\right|_{s=j\lambda_{k}} \qquad r_{12k}(s) = r_{21k}(s) = \left.\frac{y_{21n}(s)}{y'_{d}(s)}\right|_{s=j\lambda_{k}} \]

    where:
        <ul>
        <li> \form#161 is the first derivative of \form#162. It is variable Ydp in the code.
        <li> \form#163 are the roots of \form#161.  
        </ul>
    The residuals are actually computed using scipy.signal.residue() function in order to obtain the constant terms:
        <ul>
        <li>In \form#164 the constant term is the source-load coupling term \form#165 :

\[ \frac{y_{21n}(s)}{y_d(s)} = \sum_{k=1}^N \frac{r_{21k}}{s-j\lambda_k} + j K_{\infty} \]

In $ [Y_{22}] $ and $ [Y_{11}] $ , "Prescribed Insertion Loss technique" case 1, there is a constant term $ \text{\it{KK}} \not= 0 $ that must be included in the N+2 transversal coupling matrix [TN 102.1, eq (13)]:

\[ \frac{y_{22n}(s)}{y_d(s)} = \sum_{k=1}^N \frac{r_{22k}}{s-j\lambda_k} + KK_{22} \]

\[ \frac{y_{11n}(s)}{y_d(s)} = \sum_{k=1}^N \frac{r_{11k}}{s-j\lambda_k} + KK_{11} \]

Computation of $ K_{\infty} $:

$ K_{\infty} $ is a real constant equal to 0 except for fully canonical filters where the number of finite-position transmission zeros $ n_{fz} $ is equal to the filter degree $ N $. For lossless filters it can be computed as [Cameron, eq (8.43a)]:

\[ K_{\infty} = \frac{\epsilon_{R}}{\epsilon} \frac{1}{(\epsilon_{R}+1)} \]

However, this formula is not valid for lossy synthesis, so we set $ K_{\infty} $ equal to the imaginary part of the constant term in the polynomial expansion of $ y_{21n}'(s) / y_d(s) $ .

Computation of the eigenvectors $ T_{1k} $ and $ T_{Nk} $:

The eigenvectors $ T_{Nk} $ and $ T_{1k} $ can be found as [Cameron eq. (8.55)]:

\[ T_{Nk} = \sqrt{r_{22k}} \]

\[ T_{1k} = r_{21k} / \sqrt{r_{22k}} \]

    <li> Build the \form#131 transversal coupling matrix \form#79:

    The \form#131 transversal coupling matrix is built from the orthogonal vectors \form#178 and \form#177 
    and from the eigenvalues \form#181, as follows [Cameron, fig 8.18]:

\[ [M] = \begin{bmatrix} -j KK_{11} & \cdots & T_{1k} & \cdots & K_{\infty} \\ \vdots & \ddots & & 0 & \vdots \\ T_{1k} & & -\lambda_{k} & & T_{Nk} \\ \vdots & 0 & & \ddots & \vdots \\ K_{\infty} & \cdots & T_{Nk} & \cdots & -j KK_{22} \end{bmatrix} \]

The steps to build the matrix are the following:

  1. We put the vector T1k at the first row (between the first and the last column not-included)
  2. We put the value of Kinf at the last column of the first row
  3. We put the vector TNk at the last column (between the first and the last row not-included)
  4. As the matrix M is symmetric, we copy the upper triangle to the lower
  5. We put the lambdak (with opposite sign) at the main diagonal (between the first and the last element not-included)
  6. If there is a remaining constants $ KK_{11} $ and $ KK_{22} $ in the partial fraction expansion of $ Y_{11n}/Y_d $ and $ Y_{22n}/Y_d $, set M[0,0] to $ -j KK_{11} $ and M[N+1,N+1] to $ -j KK_{22} $ .
Todo:
The function "r21k, p21k, remainder = sc.signal.residue(Y21np,Yd)" does not give the correct remainder when it is complex but in the tested cases it does not afect. This function should be improved for the future.

Definition at line 3168 of file libcommonfunc.py.

References libcommonfunc.CouplingMatrices.CM_error, and libcommonfunc.myPrint().

Referenced by libcommonfunc.CouplingMatrices.__init__().

Here is the call graph for this function:

Here is the caller graph for this function:

def libcommonfunc.CouplingMatrices.uniformQFCMOrder4 (   self,
  MatQfcm2 
)

This function transforms the Folded $N+2$ Canonical Form (FCM) coupling matrix of a filter of order 4 into an N+4 matrix so that all the resonant nodes have equal quality factor Q.

    (Valid for Butterworth, Chevyshev, Quasieliptic and Generalized Chebyshev with symmetric transmission zeros).
    @param MatQfcm2 = MatrixQ class instance, containing the Folded \form#189 Canonical Form (FCM) coupling matrix. 
    @return MatQfcm4 = MatrixQ class instance, containing the Folded \form#200 Canonical Form (FCM) coupling matrix with uniform Q.

    For a better description see TN102.3 sec. 3.2.

    First of all we add two non-resonant nodes, what means converting the N+2 folded matrix into the N+4. Then we apply two hyperbolic rotations so that we have a uniform Q. For doing so, it can be proved that the necessary angle is (TN102.3 eq. (10)):

\[ \alpha = \frac{1}{2}ln\left[\frac{\frac{M_{01}^{2}}{G}\pm \sqrt{4G_{1}\frac{M_{01}^{2}}{G}-4G_{1}^{2}+16M_{12}^{2}}}{2G_{1}+\frac{M_{01}^{2}}{G}+4M_{12}}\right] \]

Finally, we need to re-scale with a value $h$ so that the non-resonant nodes have a sum of imaginary parts equal to 0.

Definition at line 3904 of file libcommonfunc.py.

Referenced by libcommonfunc.CouplingMatrices.__init__().

Here is the caller graph for this function:

def libcommonfunc.CouplingMatrices.uniformQFCMOrder6 (   self,
  MatQfcm2 
)

This function transforms the Folded $N+2$ Canonical Form (FCM) coupling matrix of a filter of order 6 into an N+4 matrix so that all the resonant nodes have equal quality factor Q.

(Valid for Butterworth, Chevyshev, Quasieliptic and Generalized Chebyshev with symmetric transmission zeros).

Parameters
MatQfcm2= MatrixQ class instance, containing the Folded $N+2$ Canonical Form (FCM) coupling matrix.
Returns
MatQfcm4 = MatrixQ class instance, containing the Folded $N+4$ Canonical Form (FCM) coupling matrix with uniform Q.

See TN102.3 sec. 3.3.

Definition at line 3945 of file libcommonfunc.py.

References libcommonfunc.CouplingMatrices.uniformQOrder6Optimize().

Referenced by libcommonfunc.CouplingMatrices.__init__().

Here is the call graph for this function:

Here is the caller graph for this function:

def libcommonfunc.CouplingMatrices.uniformQFCMOrder6Case3 (   self,
  MatQfcm2 
)

This function transforms the Folded $N+2$ Canonical Form (FCM) coupling matrix of a filter of order 6 into an N+4 matrix so that all the resonant nodes have equal quality factor Q.

(Valid for Butterworth, Chevyshev, Quasieliptic and Generalized Chebyshev with symmetric transmission zeros).

Parameters
MatQfcm2= MatrixQ class instance, containing the Folded $N+2$ Canonical Form (FCM) coupling matrix.
Returns
MatQfcm4 = MatrixQ class instance, containing the Folded $N+4$ Canonical Form (FCM) coupling matrix with uniform Q.

Definition at line 4008 of file libcommonfunc.py.

References libcommonfunc.CouplingMatrices.uniformQOrder6Case3Optimize().

Referenced by libcommonfunc.CouplingMatrices.__init__().

Here is the call graph for this function:

Here is the caller graph for this function:

def libcommonfunc.CouplingMatrices.uniformQOrder6Case3Optimize (   self,
  angRot,
  MatQfcm2a,
  flag 
)

This function performs the hyperbolic rotations in TN102.3.

Given four angles angRot it performs the hyperbolic rotations with those angles. and sees the differences between the quality factors of the different nodes [TN102.3].

Parameters
angRot= Vector containing two angles. The first angle corresponds with $\alpha$ in TN102.3 eq. (14) and the second one with $\alpha_{1}$
MatQfcm2a= MatrixQ class instance, containing the Folded $N+2$ Canonical Form (FCM) coupling matrix.
flag= If False, return goal; if True, return MatQfcm2.
Returns
goal = Function we are minimizing. It contains the summation of the absolute values of the diferences in losses in the different nodes.
MatQfcm2 = MatrixQ class instance, containing the transformed Folded $N+2$ Canonical Form (FCM) coupling matrix.

Definition at line 4038 of file libcommonfunc.py.

Referenced by libcommonfunc.CouplingMatrices.uniformQFCMOrder6Case3().

Here is the caller graph for this function:

def libcommonfunc.CouplingMatrices.uniformQOrder6Optimize (   self,
  angRot,
  MatQfcm2a,
  flag 
)

This function performs the hyperbolic rotations in TN102.3 sec.3.3.

Given two angles angRot it performs the hyperbolic rotations with those angles and sees the differences between the quality factors of the different nodes [TN102.3 sec.3.3].

Parameters
angRot= Vector containing two angles. The first angle corresponds with $\alpha$ in TN102.3 eq. (14) and the second one with $\alpha_{1}$
MatQfcm2a= MatrixQ class instance, containing the Folded $N+2$ Canonical Form (FCM) coupling matrix.
flag= If False, return goal; if True, return MatQfcm2.
Returns
goal = Function we are minimizing. It contains the summation of the absolute values of the diferences in losses in the different nodes.
MatQfcm2 = MatrixQ class instance, containing the transformed Folded $N+2$ Canonical Form (FCM) coupling matrix.

Definition at line 3975 of file libcommonfunc.py.

Referenced by libcommonfunc.CouplingMatrices.uniformQFCMOrder6().

Here is the caller graph for this function:

def libcommonfunc.CouplingMatrices.updateCM_error (   self,
  CM_error,
  st = None 
)

Convenience function that updates the error estimation in self.CM_error.

Parameters
CM_error= New error estimation.
st= String with relevant info. Default None.

Definition at line 2979 of file libcommonfunc.py.

References libcommonfunc.CouplingMatrices.CM_error, and libcommonfunc.myPrint().

Here is the call graph for this function:


The documentation for this class was generated from the following file: