Performance Module
The performance module provides performance analysis tools for different modulation and coding schemes.
- class spacelink.phy.performance.ErrorMetric(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
str,Enum- BER = 'bit error rate'
- WER = 'codeword error rate'
- FER = 'frame error rate'
- PER = 'packet error rate'
- class spacelink.phy.performance.ModePerformanceCurve(*, modes: list[LinkMode], metric: ErrorMetric, points: list[tuple[float, float]], ref: str = '')[source]
Bases:
BaseModelPerformance characteristics for specific link modes with interpolatable curves.
This class provides methods to convert between Eb/N0 and error rates for given modulation and coding schemes.
- Parameters:
modes (list[LinkMode]) – The link mode configurations.
decoder_profile (DecoderProfile) – Configuration for the decoder stages.
metric (ErrorMetric) – Type of error metric (bit error rate, codeword error rate, etc.).
points (list[ErrorCurvePoint]) – List of error rate curve data points for interpolation.
ref (str, optional) – Reference or source of the performance data (default: “”).
-
metric:
ErrorMetric
-
points:
list[tuple[float,float]]
-
ref:
str
- __init__(**data)[source]
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- ebn0_to_error_rate(ebn0)[source]
Find the error rate corresponding to the given Eb/N0.
- Parameters:
ebn0 (Decibels) – Energy per bit to noise power spectral density ratio \(E_b/N_0\).
- Returns:
Error rate or NaN if the Eb/N0 is outside the range of available performance data. Same shape as
ebn0.- Return type:
Dimensionless
- error_rate_to_ebn0(error_rate)[source]
Find Eb/N0 required to achieve the target error rate.
- Parameters:
error_rate (Dimensionless) – Target error rate.
- Returns:
Required Eb/N0 in decibels to achieve the target error rate or NaN if the error rate is outside the range of available performance data. Same shape as
error_rate.- Return type:
Decibels
- coding_gain(uncoded, error_rate)[source]
Calculate the coding gain relative to an uncoded reference.
The coding gain is the difference in required Eb/N0 between the uncoded and coded systems at the same error rate.
- Parameters:
uncoded (ModePerformance) – Performance model for the uncoded reference system. Must use the same error metric as this object.
error_rate (Dimensionless) – Error rate at which to evaluate the coding gain.
- Returns:
Coding gain in decibels or NaN if the error rate is outside the range of the available performance data. Same shape as
error_rate.- Return type:
Decibels
- Raises:
ValueError – If the uncoded model has a different error metric.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class spacelink.phy.performance.ModePerformanceThreshold(**data)[source]
Bases:
BaseModelOperating point threshold performance for specific link modes.
This class represents performance data with a single operating point threshold, typically used for standards like DVB-S2 where only quasi-error-free (QEF) operating points are published.
- Parameters:
modes (list[LinkMode]) – The link mode configurations.
metric (ErrorMetric) – Type of error metric (bit error rate, codeword error rate, etc.).
ebn0 (float) – Eb/N0 threshold in dB for quasi-error-free operation.
error_rate (float) – Error rate at the threshold point (dimensionless).
ref (str, optional) – Reference or source of the performance data (default: “”).
-
metric:
ErrorMetric
-
ebn0_val:
float
-
error_rate_val:
float
-
ref:
str
- property ebn0: Annotated[Quantity, Unit('dB(1)')]
Get the Eb/N0 threshold with proper units.
- Returns:
Eb/N0 threshold value.
- Return type:
Decibels
- property error_rate: Annotated[Quantity, Unit(dimensionless)]
Get the error rate threshold with proper units.
- Returns:
Error rate threshold value.
- Return type:
Dimensionless
- check(ebn0)[source]
Check if the given Eb/N0 meets or exceeds the quasi-error-free threshold.
- Parameters:
ebn0 (Decibels) – Energy per bit to noise power spectral density ratio \(E_b/N_0\).
- Returns:
True where Eb/N0 meets or exceeds the threshold. Scalar if input is scalar, array if input is array.
- Return type:
bool or np.ndarray
- margin(ebn0)[source]
Calculate the margin (positive) or shortfall (negative) relative to threshold.
- Parameters:
ebn0 (Decibels) – Energy per bit to noise power spectral density ratio \(E_b/N_0\).
- Returns:
Margin in dB. Positive values indicate the link exceeds the threshold, negative values indicate it falls short. Same shape as
ebn0.- Return type:
Decibels
- coding_gain(uncoded)[source]
Calculate the coding gain relative to an uncoded threshold.
The coding gain is the difference in required Eb/N0 between the uncoded and coded systems at the threshold error rate.
- Parameters:
uncoded (ModePerformanceThreshold) – Threshold specification for the uncoded reference system. Must use the same error metric and have the same error rate threshold as this object.
- Returns:
Coding gain in decibels.
- Return type:
Decibels
- Raises:
ValueError – If the uncoded threshold has a different error metric or error rate.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- spacelink.phy.performance.ModePerformance
alias of
ModePerformanceCurve