comnum.phase_error_std#

comnum.phase_error_std(rx, tx)#

The standard deviation (rad) of the phase error of received symbols against the transmitted ones, once the constant gain and phase of the least-squares fit are removed: sqrt(mean(arg(g z x*)^2)), the metric of Ip & Kahn (J. Lightw. Technol. 26(20), 2008) for a phase-modulated signal; over AWGN at high SNR it tends to 1 / sqrt(2 SNR). Transmitted symbols at zero are skipped.

Parameters:
  • rx (array_like) – the received symbols.

  • tx (array_like) – the transmitted symbols, of the same length.

Returns:

the standard deviation of the phase error (rad).

Return type:

float

Raises:

ValueError – for sequences of different lengths.

Examples

>>> import comnum, numpy as np
>>> x = np.exp(1j * np.pi / 4 * np.array([1, 3, 5, 7]))
>>> z = x * np.exp(1j * (0.3 + 0.01 * np.array([1, -1, 1, -1])))
>>> round(comnum.phase_error_std(z, x), 9)
0.01