├── .gitattributes ├── ECSE610F_Amen_Memmi.pdf ├── Matlab_code ├── AMP.m ├── EPinMassiveMIMO.m ├── MMSE_AMP.m └── MMSE_SIC.m └── Readme.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /ECSE610F_Amen_Memmi.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mn9891/massive-mimo-detection/a25c2df0b7bef418e76afed681a8a515908dae0d/ECSE610F_Amen_Memmi.pdf -------------------------------------------------------------------------------- /Matlab_code/AMP.m: -------------------------------------------------------------------------------- 1 | % AMP function 2 | % Amen Memmi 3 | 4 | function xhat=AMP(y,H,sigma2,sigmas2,iterAMP,m,n) 5 | % AMP detector in Massive MIMO 6 | 7 | r=zeros(m,1); 8 | xhat=zeros(n,1); 9 | alpha=sigmas2;%initial estimation variance 10 | for t=1:iterAMP 11 | r=y-H*xhat+(n/m)*sigmas2/(sigmas2+alpha)*r; 12 | alpha=sigma2+(n/m)*sigmas2*alpha/(sigmas2+alpha); 13 | xhat=(sigmas2/(sigmas2+alpha))*(H'*r+xhat); 14 | end 15 | xhat=sign(real(xhat))+sqrt(-1)*sign(imag(xhat)); 16 | end -------------------------------------------------------------------------------- /Matlab_code/EPinMassiveMIMO.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mn9891/massive-mimo-detection/a25c2df0b7bef418e76afed681a8a515908dae0d/Matlab_code/EPinMassiveMIMO.m -------------------------------------------------------------------------------- /Matlab_code/MMSE_AMP.m: -------------------------------------------------------------------------------- 1 | % MMSE - AMP 2 | % Amen Memmi 3 | 4 | %% Code 5 | tic 6 | clc;clear; close all; 7 | n=16;% # of transmitters 8 | m=16;% # of receivers 9 | 10 | SNRrange=1:11; 11 | % snrLinear = 10^(0.1*SNRrange); 12 | count=0; 13 | for s=SNRrange 14 | SNRdb=s; 15 | for monte=1:10000 16 | x=(2*randi([0,1],n,1)-ones(n,1))+sqrt(-1)*(2*randi([0,1],n,1)-ones(n,1)); 17 | sigmas2=2;%signal variance in QPSK 18 | H=1/sqrt(2*m)*randn(m,n)+sqrt(-1)/sqrt(2*m)*randn(m,n); 19 | sigma2=2*n/m*10^(-SNRdb/10); %noise variance in control by SNR in DB 20 | w=sqrt(2*sigma2)*randn(m,1)+sqrt(-1)*sqrt(2*sigma2)*randn(m,1); 21 | y=H*x+w; %channel model 22 | 23 | %iterAMP is # of iterations in AMP 24 | iterAMP1=2; 25 | xhat1=AMP(y,H,sigma2,sigmas2,iterAMP1,m,n); 26 | iterAMP2=4; 27 | xhat2=AMP(y,H,sigma2,sigmas2,iterAMP2,m,n); 28 | iterAMP3=6; 29 | xhat3=AMP(y,H,sigma2,sigmas2,iterAMP3,m,n); 30 | 31 | 32 | x_mmse=(sigma2/sigmas2*eye(n)+H'*H)^(-1)*H'*y; 33 | x_mmse=sign(real(x_mmse))+sqrt(-1)*sign(imag(x_mmse)); 34 | errorAMP1(monte)=sum(x~=xhat1); 35 | errorAMP2(monte)=sum(x~=xhat2); 36 | errorAMP3(monte)=sum(x~=xhat3); 37 | errorMMSE(monte)=sum(x~=x_mmse); 38 | 39 | end 40 | count=count+1; 41 | serAMP1(count)=0.1*mean(errorAMP1); 42 | serAMP2(count)=0.1*mean(errorAMP2); 43 | serAMP3(count)=0.1*mean(errorAMP3); 44 | serMMSE(count)=0.1*mean(errorMMSE); 45 | end 46 | figure(2)% plot the SER 47 | semilogy(SNRrange,serAMP1,'-+', SNRrange,serAMP2,'-p',SNRrange,serAMP3,'-o',SNRrange, serMMSE,'-v'); 48 | grid on; 49 | legend(['AMP iteration=' int2str(iterAMP1)], ['AMP iteration=' int2str(iterAMP2)], ['AMP iteration=' int2str(iterAMP3)], 'MMSE'); 50 | xlabel('SNR (dB)'); ylabel('SER'); 51 | title(['BER performance comparison in system m= ' int2str(m) ' n=' int2str(n)]); 52 | toc 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /Matlab_code/MMSE_SIC.m: -------------------------------------------------------------------------------- 1 | function estMMSE=MMSE_SIC(r,H,sigma2,sigmas2,N) 2 | % MMSE_SIC detector in Massive MIMO 3 | % written by Amen Memmi 4 | modOrd = 2; 5 | % Create PSK modulator and demodulator System objects 6 | pskModulator = comm.PSKModulator(... 7 | 'ModulationOrder', 2^modOrd, ... 8 | 'PhaseOffset', 0, ... 9 | 'BitInput', true); 10 | pskDemodulator = comm.PSKDemodulator( ... 11 | 'ModulationOrder', 2^modOrd, ... 12 | 'PhaseOffset', 0, ... 13 | 'BitOutput', true); 14 | estMMSE = zeros(N*modOrd, 1); 15 | orderVec = 1:N; 16 | k = N+1; 17 | % Start MMSE nulling loop 18 | for n = 1:N 19 | % Shrink H to remove the effect of the last decoded symbol 20 | H = H(:, [1:k-1,k+1:end]); 21 | % Shrink order vector correspondingly 22 | orderVec = orderVec(1, [1:k-1,k+1:end]); 23 | % Select the next symbol to be decoded 24 | G = (H'*H + ((N-n+1)*sigma2/sigmas2)*eye(N-n+1)) \ eye(N-n+1); % Same as inv(H'*H + Sigma_n/Es *I ), but faster 25 | [~, k] = min(diag(G)); %select smallest diagonal element in the covariance matrix 26 | symNum = orderVec(k); 27 | 28 | decBits = pskDemodulator(G(k,:) * H' * r); 29 | estMMSE(2 * (symNum-1) + (1:modOrd)) = decBits; 30 | 31 | if n < N 32 | r = r - H(:, k) * pskModulator(decBits); 33 | end 34 | end 35 | 36 | end -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # Massive MIMO Detection using MMSE-SIC and Expectation Propagation 2 | 3 | ### Term project - Wireless Communications [ECSE610] - McGill - Winter 2017 4 | 5 | For the detection of large-scale MIMO systems, the following algorithms have been implemented, evaluated and compared: 6 | - Minimum-Mean Squared Error (MMSE) detector 7 | - MMSE with successive interference cancellation (MMSE-SIC) algorithm 8 | - Approximated Message Passing (AMP) algorithm 9 | - Expecatation Propagation (EP) algorithm 10 | 11 | The therotical modelization and results could be found in the [report](ECSE610F_Amen_Memmi.pdf). 12 | --------------------------------------------------------------------------------