comnum.MimoTraining#

class comnum.MimoTraining(p)#

A training matrix P (t x N) for the estimation of a flat MIMO channel from S = H P + V (Biguesh & Gershman 2006).

The estimators are linear, H_hat = S A: "ls" (no prior), "sls" (scaled LS, the trace of R_H = E[H^H H] and the noise), "mmse" (the LMMSE of R_H), "rmmse" (the LMMSE of R_H replaced by tr(R_H)/t I), and "ls-sls" and "ls-rmmse", whose trace is estimated from the LS estimate. mse is the closed-form mean square error E||H - H_hat||_F^2.

Parameters:

p (array_like) – the (t, N) training, N >= t.

Raises:

ValueError – for an empty matrix, fewer columns than rows or a non-finite entry.

Examples

>>> import comnum, numpy as np
>>> p = comnum.MimoTraining.orthogonal(4, total_power=10.0)
>>> r_h = 2 * np.eye(4)
>>> round(p.mse("ls", r_h, 0.5, 2), 6)   # sigma^2 t^2 r / P, eq. (12)
1.6
>>> round(p.mse("sls", r_h, 0.5, 2) / 8, 4)   # t / (P / sigma^2 + t), eq. (20)
0.1667
static mmse_optimal(r_h, noise_var, n_rx, total_power, n=None)#

The training that minimises the MSE of the LMMSE estimator: the power water-filled on the eigenvectors of r_h (eqs. (41)-(44)).

Parameters:
  • r_h (array_like) – the (t, t) correlation E[H^H H].

  • noise_var (float) – the noise variance per entry.

  • n_rx (int) – the receive antennas r.

  • total_power (float) – ||P||_F^2.

  • n (int | None) – the training symbols N >= t (t by default).

Returns:

the training.

Return type:

MimoTraining

Raises:

ValueError – for a correlation that is not square, n < t, or a noise or a power that is not positive.

static orthogonal(n_tx, n=None, total_power=1.0)#

The DFT training of orthogonal rows, P P^H = (total_power / t) I (eq. (10)).

Parameters:
  • n_tx (int) – the transmit antennas t.

  • n (int | None) – the training symbols N >= t (t by default).

  • total_power (float) – ||P||_F^2.

Returns:

the training.

Return type:

MimoTraining

Raises:

ValueError – for n < n_tx, no antenna or a power that is not positive.

estimate(s, estimator='ls', noise_var=0.0, *, r_h=None, trace=None)#

The estimate H_hat = S A of the channel from the received training.

Parameters:
  • s (array_like) – the (r, N) received training.

  • estimator (str) – "ls", "sls", "ls-sls", "mmse", "rmmse" or "ls-rmmse".

  • noise_var (float) – the noise variance per entry (unused by LS).

  • r_h (array_like | None) – the correlation E[H^H H] of "mmse".

  • trace (float | None) – tr(R_H) of "sls" and "rmmse".

Returns:

the (r, t) estimate.

Return type:

numpy.ndarray

Raises:

ValueError – for an unknown estimator, a missing prior, inconsistent shapes or LS on a training of rank below t.

mse(estimator, r_h, noise_var, n_rx, prior=None)#

The closed-form MSE E||H - H_hat||_F^2 of estimator on a channel of correlation r_h (eqs. (7), (13), (28), (46) of Biguesh & Gershman).

Parameters:
  • estimator (str) – "ls", "sls", "mmse" or "rmmse" ("ls-sls" and "ls-rmmse" have no closed form).

  • r_h (array_like) – the true (t, t) correlation E[H^H H].

  • noise_var (float) – the noise variance per entry.

  • n_rx (int) – the receive antennas r.

  • prior (array_like | float | None) – the prior the estimator assumes, a correlation for "mmse", a trace for "sls" and "rmmse"; the true one by default.

Returns:

the error, summed over the r t entries.

Return type:

float

Raises:

ValueError – for an estimator without a closed form, or inconsistent shapes.

symbols#

The (t, N) training symbols P.

total_power#

The power ||P||_F^2.