Skip to main content

SParameters.plot

Description​

Plots the magnitude of the scattering parameters (S-parameters) as a function of frequency.

The method displays the frequency-dependent reflection and transmission responses for selected output and input ports. Multiple ports can be specified to compare different S-parameters on the same plot.

S-parameter magnitudes are displayed in decibels (dB), with frequency expressed in gigahertz (GHz). Optionally, AAA (Adaptive Antoulas–Anderson) rational interpolation can be applied to obtain a smoother frequency response between the simulated frequency points.

Syntax​

obj

obj An SParameters object containing the complex S-parameter data and corresponding frequency values.

obj.plot()

obj.plot() Plots all available S-parameters over the frequency range.

obj.plot(port_out, port_in)

obj.plot(port_out, port_in) Plots the S-parameters for the specified output and input ports. Each argument can be a single port number, a list of port numbers, or "all".

obj.plot(port_out, port_in, interpolate=True)

obj.plot(port_out, port_in, interpolate=True) Applies AAA rational interpolation to the selected S-parameters and plots the interpolated frequency responses.

Input Arguments​

NameTypeRequiredDefaultDescription

port_out

int | list[int] | str

Optional

all

Output port numbers to plot. Specify a single port number, a list of port numbers, or "all" to select every output port. Port numbers start at 1.

port_in

int | list[int] | str

Optional

all

Input port numbers to plot. Specify a single port number, a list of port numbers, or "all" to select every input port. Port numbers start at 1.

interpolate

bool

Optional

No

Apply AAA rational interpolation to the complex S-parameter data before plotting. When enabled, the interpolated response is evaluated at 1001 equally spaced frequency points.

Examples​

# Plot all available S-parameters
sparams.plot()

# Plot the reflection coefficient at port 1
sparams.plot(port_out=1, port_in=1)

# Compare S11 and S21 with AAA interpolation
sparams.plot(port_out=[1, 2], port_in=1, interpolate=True)

Notes​

Frequency is displayed in GHz, and S-parameter magnitude is expressed in dB using 20*log10(abs(S)).

Port numbers start at 1. When multiple output and input ports are specified, all combinations of the selected ports are plotted.

When interpolate=True, AAA rational interpolation is applied to the complex S-parameter values. The interpolated response is evaluated at 1001 equally spaced frequency points between the minimum and maximum frequencies in the data.

Interpolation requires a nonzero frequency range.

Errors / Exceptions​

Error / Exceptions List
hado:solutionmessage:InvalidPortSParametersPlot
Condition

An invalid value is specified for port_out or port_in.

Resolution

Specify an integer, a list of integers, or the string “all”.

hado:solutionmessage:InvalidPortSParametersType
Condition

A Boolean value is specified as a port number.

Resolution

Use integer port numbers instead of Boolean values.

hado:solutionmessage:InvalidPortIndexSParameters
Condition

A specified port number is outside the available port range.

Resolution

Specify a port number between 1 and the number of ports in the SParameters object.

hado:solutionmessage:InvalidSParametersInterpolationDataPoint
Condition

Interpolation is requested when the frequency range is zero.

Resolution

Provide frequency data with a nonzero frequency range before enabling interpolation.