S-Parameters Extraction and Simulation Using SPICE: A Practical Guide

S-parameters in SPICE banner

What Are S-Parameters and Why Do They Matter?

Scattering parameters, or S-parameters, are essential tools for analyzing high-frequency circuits and components. Widely used in RF and microwave engineering, they describe the behavior of linear electrical networks by characterizing reflection and transmission at network ports. Traditionally, S-parameters are calculated using specialized RF simulation software, such as Keysight ADS. While powerful, these tools can be expensive and have a steep learning curve. However, SPICE-based simulators, including free options like LTspice, Qspice, and Micro-Cap, can also be used to compute and analyze S-parameters. SPICE simulators are familiar to most electronics engineers, offering a more accessible path to S-parameter insights, especially when SPICE models are readily available for many components.

Understanding Waves in a Two-Port Network

Let’s consider a two-port network, as illustrated in Figure 1. Here, a voltage source \(V_{G1}\) with an internal impedance \(Z_0\) is connected to the input port (Port 1), while the output port (Port 2) is terminated with a load also equal to \(Z_0\). This impedance, \(Z_0\), is known as the characteristic or reference impedance of the system.

2-port network diagram
Figure 1: Generic 2-port network diagram

At each port, we can imagine the signal as a superposition of two waves:

  • \(a_i\): the incident wave traveling into the port.
  • \(b_i\): the wave reflected away from the port.

In Figure 1, \(a_1\) is the incident wave at Port 1. Part of its energy reflects back as \(b_1\), while the remaining energy transmits to Port 2, potentially being amplified or attenuated. Because Port 2 is terminated with a load matching the reference impedance \(Z_0\), there is no reflection from the load, meaning \(a_2 = 0\). It’s important to note that the “forward wave” and “reflected wave” are mathematical constructs designed to simplify wave analysis. In reality, there is only one electromagnetic wave at any point in the transmission line—this wave is the superposition of all incident and reflected components. The definitions of forward and reflected waves depend entirely on the reference impedance \(Z_0\). Changing the reference impedance alters the relative magnitudes and phases of these waves but leaves the actual physical wave unaffected.

Scattering Parameters Explained and Calculated

The relationships between the waves at each port are described by scattering parameters:

  • \(S_{11}\): the input reflection coefficient, \(S_{11} = \frac{b_1}{a_1}\).
  • \(S_{21}\): the forward transmission coefficient, \(S_{21} = \frac{b_2}{a_1}\).

Similarly, we can connect the source to Port 2 and terminate Port 1. This setup yields the remaining S-parameters of the two-port system:

  • \(S_{22}\): the output reflection coefficient, \(S_{22} = \frac{b_2}{a_2}\).
  • \(S_{12}\): the reverse transmission coefficient, \(S_{12} = \frac{b_1}{a_2}\).

Note that these S-parameters vary with frequency. Additionally, S-parameters are complex numbers, meaning they have both magnitude and phase.

The magnitudes of the waves \(a_i\) and \(b_i\) at a given port can be defined using the voltages and currents at that port:

\[ a_i = \frac{V_i + Z_0 I_i}{2\sqrt{\text{Re}(Z_0)}} \tag{1}, \]

\[ b_i = \frac{V_i – Z_0^* I_i}{2\sqrt{\text{Re}(Z_0)}} \tag{2}. \]

These definitions normalize \(a_i\) and \(b_i\) to the reference impedance \(Z_0\). As a result, S-parameters are inherently tied to a specific reference impedance, reflecting how the device behaves when connected to a source or load with this characteristic impedance.

Using equations (1) and (2) and assuming \(Z_0\)​ is a real number, we can calculate \(S_{11}\)​ for the system in Figure 1:

\[\begin{eqnarray} S_{11} = \frac{b_1}{a_1} = \frac{V_1 – Z_0 I_1}{V_1 + Z_0 I_1} \\= \frac{Z_\text{in} I_1 – Z_0 I_1}{Z_\text{in} I_1 + Z_0 I_1} \\= \frac{Z_\text{in} – Z_0}{Z_\text{in} + Z_0} \end{eqnarray} \tag{3} \]

Here, \(Z_\text{in}\)​ is the input impedance seen at Port 1.

Similarly, we can compute \(S_{21}\)​:

\[ V_1 = V_{G1} – Z_0 I_1 \tag{4}, \]

\[ V_2 = -Z_0 I_2 \tag{5}, \]

\[S_{21} = \frac{b_2}{a_1} = \frac{V_2 – Z_0 I_2}{V_1 + Z_0 I_1} \\= \frac{2V_2}{V_{G1}} \tag{6} \]

For a system with more than two ports, the S-parameters are calculated in the same way. A source is connected to one of the ports \(i\), while all other ports are terminated with the reference impedance \(Z_0\)​. The reflection coefficient \(S_{ii}\)​ is calculated using equation (3) for that port, and the transmission coefficient \(S_{ji}\)​ to any other port \(j\) is determined using equation (6). Simply replace the indices \(1\) and \(2\) in these equations with the relevant indices \(i\) and \(j\) for the ports being analyzed.

How to Extract S-Parameters with SPICE

Consider a circuit with one input and one output, and define a reference impedance \(Z_0\)​ of 50 Ohms, which is common in many RF and microwave systems. To extract the S-parameters of the circuit using SPICE, follow these steps:

  1. Input Connection: Connect the input of the circuit to an AC voltage source with an amplitude of 1 V. Add a series resistor of \(50 \, \Omega\), matching the reference impedance \(Z_0\)​.
  2. Output Termination: Terminate the output with the same resistance of \(50 \, \Omega\), connected to ground.
  3. Simulation Setup: Configure an AC analysis in your SPICE simulator, sweeping across the desired frequency range.
  4. Data Extraction:
    • The calculation of \(S_{21}\)​ is quite straightforward using equation (6). With \(V_{G1}=1\), \(S_{21} = 2 V_2\), where \(V_2\) is the voltage on the output termination resistor. ​​
    • To calculate \(S_{11}\) ​using equation (3), you first need to find \(Z_\text{in}\), the input impedance. \(Z_\text{in}\)​ is determined as the voltage at the input (measured after the series \(50 \, \Omega\) resistor of the AC source) divided by the input current.
  5. Plot Results: Use your SPICE simulator’s post-processing tools to plot \(S_{11}\)​ and \(S_{21}\) in decibels​ versus frequency. In some simulation tools, such as Micro-Cap, it is possible to define these formulas for \(S_{11}\) and \(S_{21}\) as the values of behavioral voltage sources and then to plot their voltages.

This simulation approach is possible with any SPICE software. In LTspice, there is also the option to use the .net directive to directly calculate S-parameters, simplifying the process further for users of this tool. However, we will not cover that method here.

Practical Example: S-Parameters of a Band Pass Filter

To demonstrate, we will simulate the band-pass filter (BPF) shown in Figure 2 using Qucs and SPICE. Qucs (Quite Universal Circuit Simulator) is an open-source circuit simulator that supports S-parameter simulations, similar to the functionality provided by the commercial ADS software. We will run the simulation from 1 MHz to 50 MHz, and plot \(S_{21}\) and \(S_{11}\) versus frequency.

BPF schematic in Qucs
Figure 2: Example of a BPF schematic in Qucs software

To perform the simulation in SPICE, we will use the LTspice software. The first step is to draw the schematic of the BPF and connect the terminations and sources. We will connect an AC voltage source to the input port and match both the input and output to \(50 \, \Omega\) as explained before. Since we need to calculate the input impedance \(Z_\text{in}\), we will also connect a zero-value voltage source in series with the input port. This is a common technique because SPICE does not allow direct current measurement at arbitrary points in a circuit; instead, it requires a component through which current flows for measurement. The resulting circuit is shown in Figure 3.

BPF schematic in LTspice
Figure 3: BPF schematic in LTspice

To simulate, we will run an AC analysis and modify the plotted expressions by right-clicking on them to display the S-parameters:

For \(S_{21}\) the expression is 2*V(out)/V(s) based on formula (6) above.

For \(S_{11}\) the expression is (V(in)/I(V2)-50)/(V(in)/I(V2)+50)+1e-12 based on formula (3) above. Note that V(in)/I(V2) is \(Z_\text{in}\). The small term 1e-12 we add to the expression of \(S_{11}\) is to prevent it from being zero, as the logarithmic dB plot would otherwise result in infinity.

Below we can see the comparison of the results from Qucs (Figure 4) to LTspice (Figure 5).

Qucs S-parameters simulation results
Figure 4: S-parameters of the BPF in RF simulation software(Qucs)
LTspice S-parameters simulation results
Figure 5: S-parameters of the BPF in LTspice

It can be observed that the results from LTspice and Qucs are very similar, demonstrating the accuracy and reliability of this method for simulating S-parameters in SPICE. This validates its effectiveness for practical circuit analysis.

Summary and Conclusion

SPICE simulators present a practical and accessible option for S-parameter extraction and analysis, particularly for electronics engineers who may not have access to specialized RF design tools. While SPICE-based simulations can yield accurate results for many applications, they are not without limitations. At very high frequencies, the accuracy of simulations can be influenced by component parasitics, which may not always be accounted for in SPICE models. This can lead to deviations in results, especially in cases involving distributed elements or complex RF structures. However, for lower-frequency applications, where the assumptions behind the device models remain valid, SPICE proves to be a highly effective tool. Its capability to simulate lumped-element circuits with precision makes it a valuable resource for engineers aiming to perform S-parameter analysis without investing in expensive software.

E.W. Matthews, The Use of Scattering Matrices in Microwave Circuits.

Kurokawa, K., Power Waves and the Scattering Matrix.

Share this on:

2 thoughts on “S-Parameters Extraction and Simulation Using SPICE: A Practical Guide”

  1. K. Bharath kumar

    Dear respected Sir,

    I would like to contribute an short article
    in BV circuit blog in the area of Spice
    Circuits simulation.

    What are the requirements?

    Regards,
    K. Bharath kumar, Researcher

Leave a Comment

Your email address will not be published. Required fields are marked *