Main Content

Extract S-Parameters from Circuit

This example uses the Symbolic Math Toolbox to explain how the RF Toolbox extracts two-port S-parameters from an RF Toolbox circuit object.

Consider a two-port network as shown in the figure 1that you want to characterize with S-parameters. S-parameters are defined as VI×Z0=S(V+I×Z0).

Figure 1: Two-Port Network

To extract the S-parameters from a circuit into an sparameters object, the RF Toolbox terminates each port with the reference impedance Z0. Then, the RF Toolbox independently drives each port j, with 1Z0 and solves for the port voltages Vij. Driving with current sources is the Norton equivalent of driving with a 1 V source and a series resistance of Z0.

Measure the port voltage Vij at node i when node j is driven.

  • If i j, the S-parameter entry Sij is simply twice the port voltage Vij, and this is given using the equation Sij=2×Vij.

  • The diagonal entries of S-parameters when i=j are given using the equation Sij=2×Vij-1.

Figure 2: Circuit Driven at Port 1 with Current Source

Write Constitutive and Conservative Equations of Circuit

Circuits are represented in node-branch form in the RF Toolbox. There are four branches in the circuit represented in figure 2, one for the input port, two for the two-port nport object, and one for the output port. This means that the circuit has four branch current unknowns IS, I1, I2, and IL and two node voltages V11 and V21. To represent the circuit described in figure 2 in node-branch form, you need four constitutive equations to represent the branch currents and two conservative equations to represent the node voltages.

syms F IS I1 I2 IL V1 V2 Z0
syms S11 S12 S21 S22

nI = 4; % number of branch currents
nV = 2; % number of node voltages

% F = [Fconstitutive; Fconservative]
F = [
    V1 - Z0*IS
    V1 - Z0*I1 - S11*(V1+Z0*I1) - S12*(V2+Z0*I2)
    V2 - Z0*I2 - S21*(V1+Z0*I1) - S22*(V2+Z0*I2)
    V2 - Z0*IL
F = 

(V1-ISZ0V1-I1Z0-S11V1+I1Z0-S12V2+I2Z0V2-I2Z0-S21V1+I1Z0-S22V2+I2Z0V2-ILZ0I1+ISI2+IL)[V1 - IS*Z0; V1 - I1*Z0 - S11*(V1 + I1*Z0) - S12*(V2 + I2*Z0); V2 - I2*Z0 - S21*(V1 + I1*Z0) - S22*(V2 + I2*Z0); V2 - IL*Z0; I1 + IS; I2 + IL]

Jacobian Evaluation of Circuit

Use the jacobian function from the Symbolic Math Toolbox to compute the matrix of derivatives of the function F with respect to the six unknowns (four branch currents and two node voltages)

J = jacobian(F,[IS; I1; I2; IL; V1; V2])
J = 

(-Z0000100-Z0-S11Z0-S12Z001-S11-S120-S21Z0-Z0-S22Z00-S211-S22000-Z001110000001100)[-Z0, sym(0), sym(0), sym(0), sym(1), sym(0); sym(0), - Z0 - S11*Z0, -S12*Z0, sym(0), 1 - S11, -S12; sym(0), -S21*Z0, - Z0 - S22*Z0, sym(0), -S21, 1 - S22; sym(0), sym(0), sym(0), -Z0, sym(0), sym(1); sym(1), sym(1), sym(0), sym(0), sym(0), sym(0); sym(0), sym(0), sym(1), sym(1), sym(0), sym(0)]

Solve S-Parameters of Circuit

Create a two-column right-hand side vector, rhs, to represent the driving of each port.

syms rhs [nI+nV 2]
syms x v S

% Compute S-parameters of cascade
rhs(:,:) = 0;
rhs(nI+1,1) = 1/Z0;  % rhs for driving input port
rhs(nI+nV,2) = 1/Z0  % rhs for driving output port
rhs = 

(000000001Z0001Z0)[sym(0), sym(0); sym(0), sym(0); sym(0), sym(0); sym(0), sym(0); 1/Z0, sym(0); sym(0), 1/Z0]

To solve for the voltages, back solve the rhs with the Jacobian. The S-parameter matrix that MATLAB outputs represents the two-port circuit shown in figure 1.

x = J \ rhs;
v = x(nI+[1 nV],:);
S = 2*v - eye(2)
S = 

(S11S12S21S22)[S11, S12; S21, S22]

Related Topics