Quality Assessment

class QualityAssessment.BitErrorRatio(constellation)[source]

Computes bit error ratios.

compute(correct_symbols, recovered_symbols)[source]

Computers the bit error ratio between two symbol vectors.

Parameters:
  • correct_symbols (numpy.array(complex)) – Vector of symbols drawn from the constellation.
  • received_symbols (numpy.array(complex)) – Vector of symbols drawn from the constellation of the same length as correct_symbols.
Returns:

  • ber (float) – Bit error ratio, n_err/n_bits.
  • n_err (int) – Number of bit errors.
  • n_bits (integer) – Total number of bits.

class QualityAssessment.ConstellationDiagram(constellation)[source]

Plots a constellation diagram.

plot(symbols, show_bits=False, title=None, new_fig=False)[source]

Plots a constellation diagram with both the received symbols and the original modulation alphabet.

Parameters:
  • symbols (numpy.array(complex)) – Vector of symbols.
  • show_bits (bool) – If True, the corresponding bit patterns are shown together with the constellation alphabet.
  • title (str or None) – Title of the figure
  • new_fig (bool) – If true, a new figure is created for the plot.
Returns:

The created Matplotlib figure (only if new_fig==True).

Return type:

object

class QualityAssessment.ErrorVectorMagnitude[source]

Computes error vector magnitudes.

in_dB(correct_symbols, recovered_symbols)[source]

Error vector magnitude in decibel.

Parameters:
  • correct_symbols (numpy.array(complex)) – Vector with correct symbols.
  • recovered_symbols (numpy.array(complex)) – Vector with received symbols (same length as correct_symbols).
Returns:

10*log10(P_error / P_reference)

Return type:

float

class QualityAssessment.ModulationEfficiency(percentage=99)[source]

Estimates modulation efficiency.

compute(t, q_tx, q_rx, nerr, nbits)[source]

Estimates the modulation efficiency in bits/s/Hz.

The estimated modulation efficiency is computed as nbits/duration/bandwidth, where

  • nbits is the number of transmitted bits,
  • duration is t[-1]-t[0], and
  • the bandwidth is the width of the frequency interval [-f,f] that contains the percentage of the total signal energy specified during construction.
Parameters:
  • t (numpy.array(float)) – Vector of time points in s.
  • q_tx (numpy.array(complex)) – Vector containing the value of the fiber input at the time points specified at the time points in t.
  • q_rx (numpy.array(complex)) – Vector containing the value of the fiber output at the time points specified at the time points in t.
  • nerr (int) – Number of bit errors observed after the transmission.
  • nbits (int) – Number of bits transmitted.
Returns:

  • float – The modulation efficiency in bits/s/Hz.
  • float – The gross bit rate in bits/s.
  • float – The percent bandwidth in Hz.