comnum.message_passing#

comnum.message_passing(h, y, constellation, noise_var, method='amp', *, iterations=Ellipsis, linear='lmmse', variance='postulated', px=None, real=False)#

The iterations of LAMA or OAMP on one received vector: the MMSE estimate of every iteration, and the decoupled channel of the last one (Jeon et al. 2018; Ma & Ping 2017).

Parameters:
  • h (array_like) – the channel (n_rx, n_tx).

  • y (array_like) – the received vector (n_rx,).

  • constellation (Constellation) – the alphabet of every stream.

  • noise_var (float) – noise variance per receive antenna E|w_i|².

  • method (str) – "amp" (LAMA) or "oamp".

  • iterations (int) – iterations.

  • linear (str) – the linear estimator of OAMP, "lmmse", "pinv" or "mf".

  • variance (str) – the variance of LAMA, "postulated" (Algorithm 2) or "residual" (eq. 38, better in small systems).

  • px (array_like, optional) – prior probabilities of the points (uniform by default).

  • real (bool) – a real model (real channel, symbols and noise).

Returns:

estimates ((iterations, n_tx), the MMSE estimate of every iteration), z ((n_tx,), the input of the last denoiser: the symbols in Gaussian noise), noise_var (its variance) and noise_vars (the variance of every iteration).

Return type:

dict

Raises:

ValueError – for an invalid parameter or input (the message names it).

Examples

>>> import comnum, numpy as np
>>> c = comnum.Constellation("qam", 4).normalized()
>>> rng = comnum.Rng(1)
>>> h = comnum.mimo_channel(64, 32, rng)
>>> x = c.points[rng.integers(4, 32)]
>>> out = comnum.message_passing(h, h @ x, c, 1e-4, "amp", iterations=15)
>>> bool(np.allclose(out["estimates"][-1], x, atol=1e-3))
True