|
1 | | -# Authors: Veeresh Taranalli < veeresht @ gmail.com > & Bastien Trotobas < bastien.trotobas @ gmail.com > |
| 1 | +# Authors: Veeresh Taranalli <veeresht@gmail.com> & Bastien Trotobas <bastien.trotobas@gmail.com> |
2 | 2 | # License: BSD 3-Clause |
3 | 3 |
|
4 | 4 | """ |
|
19 | 19 |
|
20 | 20 | from __future__ import division, print_function # Python 2 compatibility |
21 | 21 |
|
22 | | -from numpy import complex, abs, sqrt, sum, zeros, identity, hstack, einsum, trace, kron, absolute, fromiter, array, exp |
| 22 | +from numpy import complex, abs, sqrt, sum, zeros, identity, hstack, einsum, trace, kron, absolute, fromiter, array, exp, \ |
| 23 | + pi, cos |
23 | 24 | from numpy.random import randn, random, standard_normal |
24 | 25 | from scipy.linalg import sqrtm |
25 | 26 |
|
@@ -416,6 +417,47 @@ def _update_corr_KBSM(self, betat, betar): |
416 | 417 | # updating of correlation matrices |
417 | 418 | self.fading_param = self.fading_param[0], alpha * self.fading_param[1] * Et, self.fading_param[2] * Er |
418 | 419 |
|
| 420 | + |
| 421 | + def specularH(self, thetar, dr, thetat, dt): |
| 422 | + |
| 423 | + """ |
| 424 | + Calculate the specular components of H the channel gain as in [1]. |
| 425 | + ref: [1] Lee M. Garth, Peter J. Smith, Mansoor Shafi, "Exact Symbol Error Probabilities for SVD Transmission |
| 426 | + of BPSK Data over Fading Channels", IEEE 2005. |
| 427 | +
|
| 428 | + Parameters |
| 429 | + ---------- |
| 430 | + thetat : float |
| 431 | + the angle of departure. |
| 432 | +
|
| 433 | + dt : postive float |
| 434 | + the antenna spacing in wavelenghts of departure. |
| 435 | +
|
| 436 | + thetar : float |
| 437 | + the angle of arrival. |
| 438 | +
|
| 439 | + dr : positie float |
| 440 | + the antenna spacing in wavelenghts of arrival. |
| 441 | +
|
| 442 | + Returns |
| 443 | + ------- |
| 444 | + H : 2D ndarray of shape (nb_rx, nb_tx) |
| 445 | + the specular components of channel gains to be use as mean in Rician fading. |
| 446 | +
|
| 447 | + Raises |
| 448 | + ------ |
| 449 | + ValueError |
| 450 | + If dt or dr are negative. |
| 451 | +
|
| 452 | + """ |
| 453 | + if dr < 0 or dt < 0 : |
| 454 | + raise ValueError("the distance must be positive ") |
| 455 | + H = zeros((self.nb_rx,self.nb_tx),dtype=complex) |
| 456 | + for n in range(self.nb_rx): |
| 457 | + for m in range(self.nb_tx): |
| 458 | + H[n,m] = exp(1j*2*pi*(n*dr*cos(thetar)-m*dt*cos(thetat))) |
| 459 | + return H |
| 460 | + |
419 | 461 | @property |
420 | 462 | def fading_param(self): |
421 | 463 | """ Parameters of the fading (see class attribute for details). """ |
|
0 commit comments