comnum.MimoTraining#
- class comnum.MimoTraining(p)#
A training matrix
P(t x N) for the estimation of a flat MIMO channel fromS = H P + V(Biguesh & Gershman 2006).The estimators are linear,
H_hat = S A:"ls"(no prior),"sls"(scaled LS, the trace ofR_H = E[H^H H]and the noise),"mmse"(the LMMSE ofR_H),"rmmse"(the LMMSE ofR_Hreplaced bytr(R_H)/t I), and"ls-sls"and"ls-rmmse", whose trace is estimated from the LS estimate.mseis the closed-form mean square errorE||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:
- Returns:
the training.
- Return type:
- 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:
- Returns:
the training.
- Return type:
- 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 Aof the channel from the received training.- Parameters:
- Returns:
the
(r, t)estimate.- Return type:
- 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^2ofestimatoron a channel of correlationr_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)correlationE[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 tentries.- Return type:
- Raises:
ValueError – for an estimator without a closed form, or inconsistent shapes.
- symbols#
The
(t, N)training symbolsP.
- total_power#
The power
||P||_F^2.