Table of Contents

Struct NetworkParameter

Namespace
Touchstone.Parser.Models
Assembly
Touchstone.Parser.dll

Represents a single complex network parameter value (e.g., S11, S21). Internally stored as real and imaginary parts for lossless conversion.

public readonly struct NetworkParameter : IEquatable<NetworkParameter>
Implements
Inherited Members
Extension Methods

Remarks

All factory methods normalize input to the internal real/imaginary representation. Use the computed properties to access magnitude, phase, and dB values.

Constructors

NetworkParameter(double, double)

Initializes a new NetworkParameter from real and imaginary components.

public NetworkParameter(double real, double imaginary)

Parameters

real double

The real part.

imaginary double

The imaginary part.

Properties

Imaginary

Gets the imaginary part of the complex parameter.

public double Imaginary { get; }

Property Value

double

Magnitude

Gets the linear magnitude: |S| = sqrt(Re² + Im²).

public double Magnitude { get; }

Property Value

double

MagnitudeDb

Gets the magnitude in decibels: 20 * log10(|S|).

public double MagnitudeDb { get; }

Property Value

double

PhaseDegrees

Gets the phase angle in degrees.

public double PhaseDegrees { get; }

Property Value

double

PhaseRadians

Gets the phase angle in radians.

public double PhaseRadians { get; }

Property Value

double

Real

Gets the real part of the complex parameter.

public double Real { get; }

Property Value

double

Zero

Returns a zero-valued network parameter.

public static NetworkParameter Zero { get; }

Property Value

NetworkParameter

Methods

Conjugate()

Returns the complex conjugate of this parameter.

public NetworkParameter Conjugate()

Returns

NetworkParameter

A new NetworkParameter with negated imaginary part.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

Equals(NetworkParameter)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(NetworkParameter other)

Parameters

other NetworkParameter

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

FromDecibelAngle(double, double)

Creates a NetworkParameter from decibel magnitude and angle (in degrees).

public static NetworkParameter FromDecibelAngle(double magnitudeDb, double angleDegrees)

Parameters

magnitudeDb double

The magnitude in dB.

angleDegrees double

The angle in degrees.

Returns

NetworkParameter

A new NetworkParameter.

FromMagnitudeAngle(double, double)

Creates a NetworkParameter from magnitude and angle (in degrees).

public static NetworkParameter FromMagnitudeAngle(double magnitude, double angleDegrees)

Parameters

magnitude double

The linear magnitude.

angleDegrees double

The angle in degrees.

Returns

NetworkParameter

A new NetworkParameter.

FromRealImaginary(double, double)

Creates a NetworkParameter from real and imaginary parts.

public static NetworkParameter FromRealImaginary(double real, double imaginary)

Parameters

real double

The real part.

imaginary double

The imaginary part.

Returns

NetworkParameter

A new NetworkParameter.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Reciprocal()

Returns the reciprocal (1/z) of this parameter.

public NetworkParameter Reciprocal()

Returns

NetworkParameter

A new NetworkParameter representing the reciprocal.

Exceptions

InvalidOperationException

Thrown when the parameter is zero.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator ==(NetworkParameter, NetworkParameter)

Determines whether two NetworkParameter values are equal.

public static bool operator ==(NetworkParameter left, NetworkParameter right)

Parameters

left NetworkParameter
right NetworkParameter

Returns

bool

operator !=(NetworkParameter, NetworkParameter)

Determines whether two NetworkParameter values are not equal.

public static bool operator !=(NetworkParameter left, NetworkParameter right)

Parameters

left NetworkParameter
right NetworkParameter

Returns

bool