Giter VIP home page Giter VIP logo

cascader's Introduction

This repo provides functionality to read and manipulate S-parameter files, including cascading operations on 2 port models.

The input files must follow the standardized Touchstone file format (.snp, where n is the number of ports), and contain sets of data representing scattering parameters of linear networks.

Process Summary:

  1. Read S-parameter files, validate format
  2. Verify all S-parameter sets are defined over the same frequency points. If not, interpolate.
  3. Conversion to T parameters (for 3-port networks): NOT IMPLEMENTED
  4. Cascading: Perform cascading matrix operation
  5. Back Conversion (for 3-port networks): NOT IMPLEMENTED

Cascading algorithm

top level diagram The script will read both files, extracting sets of parameters (each representing a two port network component) and calculates a resulting parameter set as if these two networks were connected in series. The cascading algorithm directly embeds the combined network response into a single whole network. This approach utilizes a generalized two port chain scattering model and system of network embedding equations. Read more this model from LibreTexts here, and the embedding equations from RFCafe here.

cascade diagram with coefficients

The two port networks from the above figure can be described in the following matrix form:

$$ S = \begin{pmatrix} S_{11} & S_{12} \\ S_{21} & S_{22} \end{pmatrix} $$

Where:

  • S11 and S22 are the input and output reflection coefficients , respectively.
  • S21 and S12 are the forward and reverse transmission coefficients, respectively.

The resulting S-parameter matrix can be calculated using the following formulas for each element of the cascaded S-parameter matrix:

$$ S_{11} = S^1_{11} + \frac{S^1_{12} \cdot S^1_{21} \cdot S^2_{11}}{1 - S^2_{11} \cdot S^1_{22}} $$

$$ S_{12} = \frac{S^1_{12} \cdot S^2_{12}}{1 - S^2_{11} \cdot S^1_{22}} $$

$$ S_{21} = \frac{S^2_{21} \cdot S^1_{21}}{1 - S^1_{22} \cdot S^2_{11}} $$

$$ S_{22} = S^2_{22} + \frac{S^2_{21} \cdot S^2_{12} \cdot S^1_{22}}{1 - S^1_{22} \cdot S^2_{11}} $$

  • Note that the input and output of each network affects the other.
  • The division by $1 - S^2_{11} \cdot S^1_{22}$ or $1 - S^1_{22} \cdot S^2_{11}$ in these formulas accounds for this interaction between the two networks.

Here is the corresponding implementation inside cascade_s2p:

        s11 = s1[i][0,0] + (s1[i][0,1] * s1[i][1,0] * s2[i][0,0]) / (1 - s2[i][0,0] * s1[i][1,1])
        s12 = (s1[i][0,1] * s2[i][0,1]) / (1 - s2[i][0,0] * s1[i][1,1])
        s21 = (s2[i][1,0] * s1[i][1,0]) / (1 - s1[i][1,1] * s2[i][0,0])
        s22 = s2[i][1,1] + (s2[i][1,0] * s2[i][0,1] * s1[i][1,1]) / (1 - s1[i][1,1] * s2[i][0,0])

cascader's People

Contributors

mslaffin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.