Bit Error Rate

Inheritance diagram of hermespy.modem.evaluators.BitErrorEvaluator, hermespy.modem.evaluators.BitErrorArtifact, hermespy.modem.evaluators.BitErrorEvaluation

Considering two linked modems denoted by \((\alpha)\) and \((\beta)\), with modem \((\alpha)\) transmitting a bit stream

\[\mathbf{b}_{\mathrm{Tx}}^{(\alpha)} = \left[ b_{\mathrm{Tx}}^{(\alpha,1)}, b_{\mathrm{Tx}}^{(\alpha,2)}, \ldots, b_{\mathrm{Tx}}^{(\alpha,B)} \right]^{\mathsf{T}} \in \lbrace 0, 1 \rbrace^{B}\]

and modem \((\beta)\) receiving a bit stream

\[\mathbf{b}_{\mathrm{Rx}}^{(\beta)} = \left[ b_{\mathrm{Rx}}^{(\beta,1)}, b_{\mathrm{rx}}^{(\beta,2)}, \ldots, b_{\mathrm{Rx}}^{(\beta,B)} \right]^{\mathsf{T}} \in \lbrace 0, 1 \rbrace^{B}\]

Hermes defines the bit error rate (BER) as the average number of bit errors between the streams

\[\mathrm{BER}^{(\alpha,\beta)} = \frac{ \lVert \mathbf{b}_{\mathrm{Tx}}^{(\alpha)} - \mathbf{b}_{\mathrm{Rx}}^{(\beta)} \rVert_2^2 }{ B} \ \text{.}\]

In practice, the number of bits \(B\) may differ between transmitter and receiver. In this case, the shorter bit stream is padded with zeros.

The following minimal examples outlines how to configure this evaluator within the context of a simulation campaign:

 1# Create a new simulation featuring two devices
 2simulation = Simulation()
 3device_alpha = simulation.new_device(bandwidth=1e8, oversampling_factor=8)
 4device_beta = simulation.new_device(bandwidth=1e8, oversampling_factor=8)
 5
 6# Create a transmitting and receiving modem for each device, respectively
 7modem_alpha = TransmittingModem()
 8device_alpha.transmitters.add(modem_alpha)
 9modem_beta = ReceivingModem()
10device_beta.receivers.add(modem_beta)
11
12# Configure the modem's waveform
13waveform_configuration = {
14    'num_preamble_symbols': 10,
15    'num_data_symbols': 100,
16}
17modem_alpha.waveform = RootRaisedCosineWaveform(**waveform_configuration)
18modem_beta.waveform = RootRaisedCosineWaveform(**waveform_configuration)
19
20simulation.add_evaluator(BitErrorEvaluator(modem_alpha, modem_beta))
21simulation.new_dimension('noise_level', dB(0, 2, 4, 8, 10, 12, 14, 16, 18, 20), device_beta)
22simulation.num_samples = 1000
23result = simulation.run()
24
class BitErrorEvaluator(transmitting_modem, receiving_modem, confidence=1.0, tolerance=0.0, min_num_samples=1024, plot_scale='log', tick_format=ValueType.LIN, plot_surface=True)[source]

Bases: CommunicationEvaluator, Serializable

Evaluate bit errors between two modems exchanging information.

Parameters:
  • transmitting_modem (TransmittingModem) – Communication modem transmitting information.

  • receiving_modem (ReceivingModem) – Communication modem receiving information.

  • confidence (float) – Required confidence level for the given tolerance between zero and one.

  • tolerance (float) – Acceptable non-negative bound around the mean value of the estimated scalar performance indicator.

  • min_num_samples (int) – Minimum number of samples required to compute the confidence bound.

  • plot_scale (str) – Scale of the plot. Can be 'linear' or 'log'.

  • tick_format (ValueType) – Tick format of the plot.

  • plot_surface (bool) – Enable surface plotting for two-dimensional grids. Enabled by default.

evaluate()[source]

Evaluate the state of an investigated object.

Implements the process of extracting an arbitrary performance indicator, represented by the returned Artifact \(X_m\).

Returns: Artifact \(X_m\) resulting from the evaluation.

Return type:

BitErrorEvaluation

property abbreviation: str[source]

Short string representation of this evaluator.

Used as a label for console output and plot axes annotations.

property title: str[source]

Long string representation of this evaluator.

Used as plot title.

class BitErrorArtifact(artifact)[source]

Bases: ArtifactTemplate[float64]

Artifact of a bit error evaluation between two modems exchanging information.

Generated by artifact() of BitErrorEvaluation.

Parameters:

artifact (TypeVar(FAT, bound= SupportsFloat)) – Artifact value.

class BitErrorEvaluation(evaluation)[source]

Bases: ErrorEvaluation

Bit error evaluation between two modems exchanging information.

Generated by evaluate() of BitErrorEvaluator.

Parameters:

evaluation (TypeVar(ET, bound= object)) – The represented evaluation.

artifact()[source]

Generate an artifact from this evaluation.

Returns: The evaluation artifact.

Return type:

BitErrorArtifact

property title: str[source]

Title of the visualizable.

Returns: Title string.