comnum.bpsk_llr#

comnum.bpsk_llr(y, noise_var)#

The LLRs of BPSK (0 ↦ +1, 1 ↦ -1) received in real Gaussian noise of variance noise_var per dimension: 2y/σ² (positive for a 0, as every decoder of the package expects).

Parameters:
  • y (array_like) – the received real samples.

  • noise_var (float) – the noise variance per dimension σ².

Returns:

one LLR per sample (float64).

Return type:

numpy.ndarray

Raises:

ValueError – for an input that is not an array of numbers of the expected shape.

Examples

>>> import comnum
>>> comnum.bpsk_llr([1.0, -0.5], 0.5).tolist()
[4.0, -2.0]