Skip to content

whatshow/Phy_Detect_EP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Expectation Propagation Detection

This detection method is proposed in Expectation Propagation Detection for High-Order High-Dimensional MIMO Systems by Javier CĂ©spedes. It has three process: cavity distribution, Bayesian estimation and iterative update. Also, the initial version of this code is from Alva Kosasih.

Cespedes, J., Olmos, P. M., Sánchez-Fernández, M., & Perez-Cruz, F. (2014). Expectation propagation detection for high-order high-dimensional MIMO systems. IEEE Transactions on Communications, 62(8), 2840-2849.

The graph neural network aided version is also included as in Graph Neural Network Aided MU-MIMO Detectors and Graph Neural Network Aided Expectation Propagation Detector for MU-MIMO Systems. In this detector, a GNN is implemented after cavity distribution to calculate the probability of all possible x values. Then, the estimation is able to update the new mean and variance similar to the Bayesian estimation.

A. Kosasih, V. Onasis, V. Miloslavskaya, W. Hardjawana, V. Andrean and B. Vucetic, "Graph Neural Network Aided MU-MIMO Detectors," in IEEE Journal on Selected Areas in Communications, vol. 40, no. 9, pp. 2540-2555, Sept. 2022, doi: 10.1109/JSAC.2022.3191344.

Kosasih, A., Onasis, V., Hardjawana, W., Miloslavskaya, V., Andrean, V., Leu, J. S., & Vucetic, B. (2022, April). Graph neural network aided expectation propagation detector for MU-MIMO systems. In 2022 IEEE Wireless Communications and Networking Conference (WCNC) (pp. 1212-1217). IEEE.

How to install

Currently, we offer three options to install this tool.

  • Install through Matlab Add-Ons

    Go to releases to download the file whatshow_phy_detect_ep.mltbx in the latest release to install.
    The class EP will be automatically added in Matlab. (Don't forget to restart Matlab after installation).

  • Install through pip

    pip install whatshow-phy-detect-ep
    • import this module
      from whatshow_phy_detect_ep import EP
      
  • Install through git under another local repositiory

    git submodule add [email protected]:whatshow/Phy_Detect_EP.git Modules/Phy_Detect_EP
    • import this module
      • Matlab
        addpath("Modules/Phy_Detect_EP");
      • Python
        if '.' not in __name__ :
            from Modules.Phy_Detect_EP.EP import EP
        else:
            from .Modules.Phy_Detect_EP.EP import EP

How to use

All EP codes are uniform in matlab and python as a class of EP. This class contains the whole process. This section will illustrate the methods of this class following the process of detection.

  • EP(the parameter names follow the notations in Expectation Propagation Detection for High-Order High-Dimensional MIMO Systems)
    @constellation: the constellation, a vector
    @beta: the percentage for taking values from the previous iteration
    @epsilon: the default minimal variance
    @l: the maximal iteration
    @early_stop: whether stop early
    @early_stop_min_diff: the elemental minimal (element-wise) difference in mean and variance
    @batch_size(optional) : the batch size (only used in python).
    % matlab
    M = 16;
    constellation = qammod([0: M - 1], M, "UnitAveragePower", true);
    ep = EP(constellation, "beta", 0.1, "epsilon", 1e-13, "early_stop_min_diff", 1e-4);
    # python
    ep = EP(constellation, beta=0.1, epsilon=1e-13, early_stop_min_diff=1e-4); # no batch
    ep = EP(constellation, beta=0.1, epsilon=1e-13, early_stop_min_diff=1e-4, batch_size=10); # using batch
  • detect
    @y: the received signal, a vector of [(batch_size), rx_num], [(batch_size), rx_num, 1] or [(batch_size), 1, rx_num]
    @H: the channel matrix, a matrix of [(batch_size), rx_num, tx_num]
    @No: the noise (linear) power
    @sym_map: false by default. If true, the output will be mapped to the constellation
    # matlab
    syms = ep.detect(y, H, No); # no hard mapping
    syms = ep.detect(y, H, No, sym_map=True); # hard mapping
    # python
    syms = ep.detect(y, H, No); # no hard mapping
    syms = ep.detect(y, H, No, sym_map=True); # hard mapping

Samples

Before running any sample code, please make sure you are at the root path of this repository. Also, Matlab codes require running init in the command window first to load directories.

  • Alva: this is the original code from Alva Kosasih.
  • Tests
    • Tests/test_case_01: test the difference between the mature code from and newly proposed EP object (no early stop).
    • Tests/test_case_02: draw the SER vs SNR between the mature code from and newly proposed EP object (early stop).

Further Reading

The division of two Gaussian distribution

latex

latex

latex

Now we set latex and we are going to calculate X to see the distribution

latex

latex

Therefore, we can conclude that the the new mean and new variance is given as below (ignoring the constant part because this is just the likelihood of two Xs are same).

latex

latex

Cavity distribution

latex

Cavity Marginal

Now we are going to use the 2 Gaussian Distribution Division knowledge to calculatelatex

Now, we follow the Math symbols in the paper, suppose latex ( latex is the diagonal of the matrix latex ) and latex

Here, we need pay attention that the mean of p(x) is latex instead of latex. The proof is give below where we follow the exponential family.

latex

Here, we can see that the mean is latex

Now, we are going to find out latex in Lth iteration

latex

latex

latex

The Pair Update latex

From the step computing the mean latex and the variance latex of prediction latex, we can use those 2 results to calculate latex; that is, for (L+1)th iteration,

latex

Using 2 Gaussian Distribution Division knowledge, for the variance,

latex

latex For the mean,

latex

latex

latex

About

This repository is a fundamental toolbox of EP.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published