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'
class spacelink.phy.performance.ModePerformance(*, modes: list[LinkMode], metric: ErrorMetric, points: list[tuple[float, float]], ref: str = '')[source]

Bases: BaseModel

Performance characteristics for specific link modes.

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: “”).

modes: list[LinkMode]
metric: ErrorMetric
points: list[tuple[float, float]]
ref: str
classmethod validate_minimum_points(v)[source]
classmethod validate_points_sorted(v)[source]
classmethod validate_error_values_decreasing(v)[source]
__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].