# doc-cache created by Octave 5.2.0
# name: cache
# type: cell
# rows: 3
# columns: 21
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
AddElement2Port


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 712
 function net = AddElement2Port(net, port, type, value, varargin)

   Add a linear network element to the given ports

 arguments:
   port:   number of ports to apply the element
   type:   type of network element:
               'C_se' : series capacity
               'C_sh' : shunt capacity
               'L_se' : series inductance
               'L_sh' : shunt inductance
               'R_se' : series resistance
               'R_sh' : shunt resistance
               'Z_se' : series impedance
               'Y_se' : shunt addmitance

 See also: InitNetwork, SetPortTermination, ApplyCurrent2Port,
 ApplyRFPower2Port

 ------
 Cuicuit Toolbox (https://github.com/thliebig/CTB)
 (c) Thorsten Liebig, 2013



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
 function net = AddElement2Port(net, port, type, value, varargin)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
ApplyCurrent2Port


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 469
 function I_port = ApplyCurrent2Port(net, port, current, varargin)

   Apply a total current to a given port of your network

 arguments:
   port:           number of ports to apply the power to
   current:        applied total current

 output:
   I_port:         Total currents going into the ports

 See also: InitNetwork, SetPortTermination, AddElement2Port,
 ApplyRFPower2Port

 ------
 Cuicuit Toolbox (https://github.com/thliebig/CTB)
 (c) Thorsten Liebig, 2013



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 66
 function I_port = ApplyCurrent2Port(net, port, current, varargin)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
ApplyRFPower2Port


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 459
 function I_port = ApplyRFPower2Port(net, port, power, varargin)

   Apply a RF power to a given port of your network

 arguments:
   port:           number of ports to apply the power to
   power:          applied power in W

 output:
   I_port:         Total currents going into the ports

 See also: InitNetwork, SetPortTermination, AddElement2Port,
 ApplyCurrent2Port

 ------
 Cuicuit Toolbox (https://github.com/thliebig/CTB)
 (c) Thorsten Liebig, 2013



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
 function I_port = ApplyRFPower2Port(net, port, power, varargin)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
InitNetwork


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 828
 function net = InitNetwork(freq, s_para, varargin)

   Init a new network with a given frequncy vector and scattering parameter set

 arguments:
   freq:   frequncy vector
   s_para: scattering parameter

 example:
   % read some touchstone s-parameter file
   [type,freq,data,ref]=read_touchstone('test.s3p');

   % init network
   net = InitNetwork(freq, data);
   % attach a series capacity to port 2
   net = AddElement2Port(net, 2, 'C_se', 1e-12);
   % terminate all ports with 50 Ohms
   net = AddElement2Port(net, 1:3, 'R_se', 50);
   % apply 1mW to port 1 and get port currents
   I_tot = ApplyRFPower2Port(net, 1, 1e-3);

 See also AddElement2Port, ApplyCurrent2Port, ApplyRFPower2Port,
          read_touchstone, write_touchstone

 ------
 Cuicuit Toolbox (https://github.com/thliebig/CTB)
 (c) Thorsten Liebig, 2013



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
 function net = InitNetwork(freq, s_para, varargin)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
SetPortTermination


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 363
 function net = SetPortTermination(net, port, Z0, varargin)

   Set the given port impedance/termination

 arguments:
   port:   number of ports to apply the termination
   Z0:     port impedance

 See also: InitNetwork, AddElement2Port, ApplyCurrent2Port,
 ApplyRFPower2Port

 ------
 Cuicuit Toolbox (https://github.com/thliebig/CTB)
 (c) Thorsten Liebig, 2013



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
 function net = SetPortTermination(net, port, Z0, varargin)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3
a2s


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 383
 s = a2s(a [,ref])

 ABCD to Scattering Matrix transformation (only for 2x2xf matrices)

 input:
   a:   ABCD matrix 2x2xf   (f: number of frequencies)
   ref: (optional) reference impedance (default 50 Ohm)

 output:
   s:   S-matrix 2x2xf normalized to ref Ohm

 Reference: David M. Pozar "Microwave Engineering"

 Sebastian Held <sebastian.held@gmx.de>
 Sep 1 2010



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 s = a2s(a [,ref])

 ABCD to Scattering Matrix transformation (only for 2x2...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4
a_PI


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 172
 a = a_PI(Y1,Y2,Y3)

 calculate the ABCD matrix from a PI-circuit

 Reference: David M. Pozar "Microwave Engineering"

 Thorsten Liebig <thorsten.liebig@gmx.de>
 Feb. 2013



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
 a = a_PI(Y1,Y2,Y3)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3
a_T


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 170
 a = a_T(Z1,Z2,Z3)

 calculate the ABCD matrix from a T-circuit

 Reference: David M. Pozar "Microwave Engineering"

 Thorsten Liebig <thorsten.liebig@gmx.de>
 Feb. 2013



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
 a = a_T(Z1,Z2,Z3)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5
a_mul


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 276
 a = a_mul(varargin)

 multiply a number of ABCD matricies

 example:

 a = a_mul(a1,a2); which is a = a1 * a2;

 a = a_mul(a1,a2,a3,a4); which is a = a1 * a2 * a3 * a4;

 Reference: David M. Pozar "Microwave Engineering"

 Thorsten Liebig <thorsten.liebig@gmx.de>
 Feb. 2013



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
 a = a_mul(varargin)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
a_series


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 298
 a = a_series(Z)

 create the ABCD matrix of a series impedance

 example:
 C = 1e-12; aka 1pF
 f = linspace(0,2e9,201);
 Z = 2j*pi*f*C;

 %ABCD matrix of a series capacitor
 a = a_series(Z);

 Reference: David M. Pozar "Microwave Engineering"

 Thorsten Liebig <thorsten.liebig@gmx.de>
 Feb. 2013



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
 a = a_series(Z)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
a_shunt


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 300
 a = a_shunt(Y)

 create the ABCD matrix of a shunt admittance

 example:
 C = 1e-12; aka 1pF
 f = linspace(0,2e9,201);
 Y = 1./(2j*pi*f*C);

 %ABCD matrix of a shunt capacitor
 a = a_shunt(Y);

 Reference: David M. Pozar "Microwave Engineering"

 Thorsten Liebig <thorsten.liebig@gmx.de>
 Feb. 2013



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
 a = a_shunt(Y)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
read_touchstone


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 519
 [type,freq,data,ref]=read_touchstone( filename ) - read touchstone-file
 type      (lowercase) 'z' for Z-Parameter touchstone-file
 freq      vector of frequencies (in Hz)
 data      (numports x numports x numfreq) matrix
 filename  filename of the file to read
 ref       reference impedance
 comment   cell array of comment lines

 Version 16. Jun 2010
 18. Aug 2010: comment lines
 1. Sep 2010: BUGFIX: two-port files had S12 and S21 swapped!!!!!
 ATTENTION: higher than two-ports must be validated again!!!!!!!!!1



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 [type,freq,data,ref]=read_touchstone( filename ) - read touchstone-file
 typ...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3
s2a


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 354
 a = s2a(s [,ref])

 Scattering to ABCD transformation (only for 2x2xf matrices)

 input:
   s:   S-matrix matrix 2x2xf   (f: number of frequencies)
   ref: (optional) reference impedance (default 50 Ohm)

 output:
   a:   ABCD 2x2xf

 Reference: David M. Pozar "Microwave Engineering"

 Sebastian Held <sebastian.held@gmx.de>
 Sep 1 2010



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 a = s2a(s [,ref])

 Scattering to ABCD transformation (only for 2x2xf matr...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3
s2y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 336
 y = s2y(s [,ref])

 Scattering to Y transformation

 input:
   s:   S-matrix matrix nxnxf   (f: number of frequencies)
   ref: (optional) reference impedance (default 50 Ohm)

 output:
   y:   Y-matrix nxnxf

 Reference: http://qucs.sourceforge.net/tech/node98.html

 Thorsten Liebig <thorsten.liebig@gmx.de>
 Feb. 2013



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 y = s2y(s [,ref])

 Scattering to Y transformation

 input:
   s:   S-m...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3
s2z


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 336
 z = s2z(s [,ref])

 Scattering to Z transformation

 input:
   s:   S-matrix matrix nxnxf   (f: number of frequencies)
   ref: (optional) reference impedance (default 50 Ohm)

 output:
   z:   Z-matrix nxnxf

 Reference: http://qucs.sourceforge.net/tech/node98.html

 Thorsten Liebig <thorsten.liebig@gmx.de>
 Feb. 2013



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 z = s2z(s [,ref])

 Scattering to Z transformation

 input:
   s:   S-m...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
s_renorm


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 326
 s_new = s_renorm(s, Z, Z_new)

 scattering matrix renormalization

 input:
   s:      scattering matrix nxnxf   (f: number of frequencies)
   Z:      old reference impedance
   Z_new:  new reference impedance

 output:
   s:      renormalized scattering-matrix nxnxf

 Thorsten Liebig <thorsten.liebig@gmx.de>
 (c) Jan. 2014



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
 s_new = s_renorm(s, Z, Z_new)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
write_touchstone


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 526
 write_touchstone( type, freq, data, filename [,ref [,comment]] ) - write touchstone-file
 for ADS
 type      'z' for Z-Parameter touchstone-file
           'y' for Y-Parameter touchstone-file
           's' for S-Parameter touchstone-file
 freq      vector of frequencies (in Hz)
 data      (numports x numports x numfreq) matrix
 filename  filename of the file to create
 ref       (optional) reference impedance
 comment   (optional) written in the header

 (C) Sebastian Held <sebastian.held@gmx.de>
 Version 21. Feb 2006



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 write_touchstone( type, freq, data, filename [,ref [,comment]] ) - write tou...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3
y2s


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 343
 s = y2s(y [,ref])

 Y-matrix to scattering transformation

 input:
   y:   Y-matrix matrix nxnxf   (f: number of frequencies)
   ref: (optional) reference impedance (default 50 Ohm)

 output:
   s:   S-matrix nxnxf

 Reference: http://qucs.sourceforge.net/tech/node98.html

 Thorsten Liebig <thorsten.liebig@gmx.de>
 Feb. 2013



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 s = y2s(y [,ref])

 Y-matrix to scattering transformation

 input:
   y...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3
y2z


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 247
 z = y2z(y)

 Y-matrix to Z-matrix

 input:
   y:   Y-matrix matrix nxnxf   (f: number of frequencies)

 output:
   z:   Z-matrix nxnxf

 Reference: http://qucs.sourceforge.net/tech/node98.html

 Thorsten Liebig <thorsten.liebig@gmx.de>
 (c) 2013



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
 z = y2z(y)



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3
z2s


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 343
 s = z2s(z [,ref])

 Z-matrix to scattering transformation

 input:
   z:   Z-matrix matrix nxnxf   (f: number of frequencies)
   ref: (optional) reference impedance (default 50 Ohm)

 output:
   s:   S-matrix nxnxf

 Reference: http://qucs.sourceforge.net/tech/node98.html

 Thorsten Liebig <thorsten.liebig@gmx.de>
 Feb. 2013



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
 s = z2s(z [,ref])

 Z-matrix to scattering transformation

 input:
   z...



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3
z2y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 247
 y = z2y(z)

 Z-matrix to Y-matrix

 input:
   z:   Z-matrix matrix nxnxf   (f: number of frequencies)

 output:
   y:   Y-matrix nxnxf

 Reference: http://qucs.sourceforge.net/tech/node98.html

 Thorsten Liebig <thorsten.liebig@gmx.de>
 (c) 2013



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
 y = z2y(z)





