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
Properties
Imaginary
Gets the imaginary part of the complex parameter.
public double Imaginary { get; }
Property Value
Magnitude
Gets the linear magnitude: |S| = sqrt(Re² + Im²).
public double Magnitude { get; }
Property Value
MagnitudeDb
Gets the magnitude in decibels: 20 * log10(|S|).
public double MagnitudeDb { get; }
Property Value
PhaseDegrees
Gets the phase angle in degrees.
public double PhaseDegrees { get; }
Property Value
PhaseRadians
Gets the phase angle in radians.
public double PhaseRadians { get; }
Property Value
Real
Gets the real part of the complex parameter.
public double Real { get; }
Property Value
Zero
Returns a zero-valued network parameter.
public static NetworkParameter Zero { get; }
Property Value
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
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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
otherNetworkParameterAn object to compare with this object.
Returns
FromDecibelAngle(double, double)
Creates a NetworkParameter from decibel magnitude and angle (in degrees).
public static NetworkParameter FromDecibelAngle(double magnitudeDb, double angleDegrees)
Parameters
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
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
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
leftNetworkParameterrightNetworkParameter
Returns
operator !=(NetworkParameter, NetworkParameter)
Determines whether two NetworkParameter values are not equal.
public static bool operator !=(NetworkParameter left, NetworkParameter right)
Parameters
leftNetworkParameterrightNetworkParameter