PAPR

Inheritance diagram of hermespy.core.evaluators.PAPREvaluation, hermespy.core.evaluators.PAPR, hermespy.core.evaluators.PAPRArtifact

The PAPR evaluator collects information about the Peak-to-Average Power Ratio (PAPR) of a signal. The PAPR is defined as the ratio of the peak power to the average power

\[\text{PAPR} = \frac{P_{\mathrm{Peak}}}{P_{\mathrm{Avg}}}\]

where \(P_{peak}\) is the peak power and \(P_{avg}\) is the average power as indicated by the sum of squared complex voltages divided by the number of samples. Within the context of a simulation, the evaluator can be configured like this:

 1# Create a new simulation featuring two devices
 2simulation = Simulation()
 3device_alpha = simulation.new_device()
 4device_beta = simulation.new_device()
 5
 6# Create a transmitting and receiving modem for each device, respectively
 7modem_alpha = TransmittingModem(waveform=RRCWaveform())
 8device_alpha.transmitters.add(modem_alpha)
 9modem_beta = ReceivingModem(waveform=RRCWaveform())
10device_beta.receivers.add(modem_beta)
11
12# Configure the simulation
13papr = PAPR(device_alpha, AntennaMode.TX)
14simulation.add_evaluator(papr)
15simulation.new_dimension('noise_level', dB(0, 2, 4, 8, 10, 12, 14, 16, 18, 20), device_beta)
16simulation.num_samples = 1000
17result = simulation.run()
class PAPR(device, direction, confidence=1.0, tolerance=0.0, min_num_samples=1024, plot_scale='linear', tick_format=ValueType.LIN, plot_surface=True)[source]

Bases: ScalarEvaluator

Peak-to-average power ratio (PAPR) evaluator.

Computes the average PAPR of radio-frequency band signals transmitted and received by devices during evaluation runtime.

Parameters:
  • device (Device) – The device to evaluate the PAPR of.

  • direction (AntennaMode) – The direction of the PAPR evaluation. Can be AntennaMode.TX or AntennaMode.RX.

  • 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:

PAPREvaluation

initialize_result(grid)[source]

Initialize the respective result object for this evaluator.

Parameters:

grid (Sequence[GridDimensionInfo]) – The parameter grid over which the simulation iterates.

Return type:

ScalarEvaluationResult

Returns: The initialized evaluation result.

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 PAPREvaluation(instantaneous_power)[source]

Bases: Evaluation[PlotVisualization]

Peak-to-average power ratio (PAPR) evaluation.

Parameters:

instantaneous_power (ndarray) – The instantaneous power in \(V^2\) for each antenna stream.

artifact()[source]

Generate an artifact from this evaluation.

Returns: The evaluation artifact.

Return type:

PAPRArtifact

property instantaneous_power: ndarray[source]

The instantaneous power in \(V^2\) for each antenna stream.

property title: str[source]

Title of the visualizable.

Returns: Title string.

class PAPRArtifact(stream_papars)[source]

Bases: Artifact

Artifact of a peak-to-average power ratio evaluation.

Parameters:

stream_papars (ndarray) – PAPRs of each antenna stream.

to_scalar()[source]

Scalar representation of this artifact’s content.

Used to evaluate premature stopping criteria for the underlying evaluation.

Return type:

float

Returns:

Scalar floating-point representation. None if a conversion to scalar is impossible.