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 >
22# License: BSD 3-Clause
33
44"""
1919
2020from __future__ import division , print_function # Python 2 compatibility
2121
22- from numpy import complex , abs , sqrt , sum , zeros , identity , hstack , einsum , trace , kron , absolute , fromiter
22+ from numpy import complex , abs , sqrt , sum , zeros , identity , hstack , einsum , trace , kron , absolute , fromiter , array , exp
2323from numpy .random import randn , random , standard_normal
2424from scipy .linalg import sqrtm
2525
@@ -381,6 +381,41 @@ def propagate(self, msg):
381381 self .unnoisy_output = einsum ('ijk,ik->ij' , self .channel_gains , msg )
382382 return self .unnoisy_output + self .noises
383383
384+ def _update_corr_KBSM (self , betat , betar ):
385+
386+ """
387+ Update the correlation parameters to follow the KBSM-BD-AA.
388+
389+ Parameters
390+ ----------
391+ betat : positive float
392+ Constant for the transmitter.
393+
394+ betar : positive float
395+ Constant for the receiver.
396+
397+ Raises
398+ ------
399+ ValueError
400+ If betat or betar are negative.
401+ """
402+
403+ if betar < 0 or betat < 0 :
404+ raise ValueError ("beta must be positif " )
405+
406+ # Creation or Er and Et
407+ Er = array ([[exp (abs (m - n )) for m in range (self .nb_rx )] for n in range (self .nb_rx )])
408+ Et = array ([[exp (abs (m - n )) for m in range (self .nb_tx )] for n in range (self .nb_tx )])
409+
410+ # Compute gain to the keep K-factor
411+ NLOS_before = trace (self .fading_param [1 ]) * trace (self .fading_param [2 ])
412+ NLOS_after = trace (self .fading_param [1 ] * Et ) * trace (self .fading_param [2 ] * Er )
413+
414+ alpha = NLOS_before / NLOS_after
415+
416+ # updating of correlation matrices
417+ self .fading_param = self .fading_param [0 ], alpha * self .fading_param [1 ] * Et , self .fading_param [2 ] * Er
418+
384419 @property
385420 def fading_param (self ):
386421 """ Parameters of the fading (see class attribute for details). """
@@ -413,12 +448,17 @@ def uncorr_rayleigh_fading(self, dtype):
413448 """
414449 self .fading_param = zeros ((self .nb_rx , self .nb_tx ), dtype ), identity (self .nb_tx ), identity (self .nb_rx )
415450
416- def expo_corr_rayleigh_fading (self , t , r ):
417- """ Set the fading parameters to a complex correlated Rayleigh channel following the exponential model.
451+ def expo_corr_rayleigh_fading (self , t , r , betat = 0 , betar = 0 ):
452+ """ Set the fading parameters to a complex correlated Rayleigh channel following the exponential model [1].
453+ A KBSM-BD-AA can be used as in [2] to improve the model.
418454
419- See: S. L. Loyka, "Channel capacity if MIMO architecture using the exponential correlation matrix ", IEEE
455+ ref: [1] S. L. Loyka, "Channel capacity if MIMO architecture using the exponential correlation matrix ", IEEE
420456 Commun. Lett., vol.5, n. 9, p. 369-371, sept. 2001.
421457
458+ [2] S. Wu, C. Wang, E. M. Aggoune, et M. M. Alwakeel, "A novel Kronecker-based stochastic model for massive
459+ MIMO channels", in 2015 IEEE/CIC International Conference on Communications in China (ICCC), 2015, p. 1‑6.
460+
461+
422462 Parameters
423463 ----------
424464 t : complex with abs(t) = 1
@@ -427,10 +467,21 @@ def expo_corr_rayleigh_fading(self, t, r):
427467 r : complex with abs(r) = 1
428468 Correlation coefficient for the receiver.
429469
470+ betat : positive float
471+ Constant for the transmitter.
472+ *Default* = 0 i.e. classic model
473+
474+ betar : positive float
475+ Constant for the receiver.
476+ *Default* = 0 i.e. classic model
477+
430478 Raises
431479 ------
432480 ValueError
433481 If abs(t) != 1 or abs(r) != 1
482+
483+ ValueError
484+ If betat or betar are negative.
434485 """
435486 # Check inputs
436487 if abs (t ) - 1 > 1e-4 :
@@ -449,6 +500,9 @@ def expo_corr_rayleigh_fading(self, t, r):
449500 # Set fading
450501 self .fading_param = zeros ((self .nb_rx , self .nb_tx ), complex ), t ** expo_tx , r ** expo_rx
451502
503+ # Update Rr and Rt
504+ self ._update_corr_KBSM (betat , betar )
505+
452506 def uncorr_rician_fading (self , mean , k_factor ):
453507 """ Set the fading parameters to an uncorrelated rician channel.
454508
@@ -467,13 +521,19 @@ def uncorr_rician_fading(self, mean, k_factor):
467521 mean = mean * sqrt (k_factor * NLOS_gain / einsum ('ij,ij->' , absolute (mean ), absolute (mean )))
468522 self .fading_param = mean , identity (self .nb_tx ) * NLOS_gain / nb_antennas , identity (self .nb_rx )
469523
470- def expo_corr_rician_fading (self , mean , k_factor , t , r ):
471- """ Set the fading parameters to a complex correlated rician channel following the exponential model.
524+ def expo_corr_rician_fading (self , mean , k_factor , t , r , betat = 0 , betar = 0 ):
525+ """ Set the fading parameters to a complex correlated rician channel following the exponential model [1].
526+ A KBSM-BD-AA can be used as in [2] to improve the model.
472527
473- See: S. L. Loyka, "Channel capacity if MIMO architecture using the exponential correlation matrix ", IEEE
528+ ref: [1] S. L. Loyka, "Channel capacity if MIMO architecture using the exponential correlation matrix ", IEEE
474529 Commun. Lett., vol.5, n. 9, p. 369-371, sept. 2001.
475530
476- mean and correlation matricies will be scaled to fit the required k-factor.
531+ [2] S. Wu, C. Wang, E. M. Aggoune, et M. M. Alwakeel, "A novel Kronecker-based stochastic model for massive
532+ MIMO channels", in 2015 IEEE/CIC International Conference on Communications in China (ICCC), 2015, p. 1‑6.
533+
534+
535+ mean and correlation matricies will be scaled to fit the required k-factor. The k-factor is also preserved is
536+ beta are provided.
477537
478538 Parameters
479539 ----------
@@ -489,10 +549,21 @@ def expo_corr_rician_fading(self, mean, k_factor, t, r):
489549 r : complex with abs(r) = 1
490550 Correlation coefficient for the receiver.
491551
552+ betat : positive float
553+ Constant for the transmitter.
554+ *Default* = 0 i.e. classic model
555+
556+ betar : positive float
557+ Constant for the receiver.
558+ *Default* = 0 i.e. classic model
559+
492560 Raises
493561 ------
494562 ValueError
495563 If abs(t) != 1 or abs(r) != 1
564+
565+ ValueError
566+ If betat or betar are negative.
496567 """
497568 # Check inputs
498569 if abs (t ) - 1 > 1e-4 :
@@ -516,6 +587,9 @@ def expo_corr_rician_fading(self, mean, k_factor, t, r):
516587 # Set fading
517588 self .fading_param = mean , t ** expo_tx * NLOS_gain / nb_antennas , r ** expo_rx
518589
590+ # Update Rr and Rt
591+ self ._update_corr_KBSM (betat , betar )
592+
519593
520594def bec (input_bits , p_e ):
521595 """
0 commit comments