Contents
Measure performance of MIMO-MBM using Monte Carlo simulation
clc
clear all
Set input parameters
Nt = 1; % Number of transmit units Nr = 8; % Number of receive antennas R = 16; % Rate of constellation (bits/sec/HZ) nRedundancy = 0; % Number of redundant bits to achieve selection gain M = 2 ^ (R + nRedundancy); % Primary number of points in constellation EbN0dB = -2; % Energy per bit to noise power spectral density ratio(dB) SNRdB = EbN0dB + 10*log10(R); % Signal to Noise Ratio(dB) SNR = 10 .^ (SNRdB/10); % Signal to Noise Ratio Es = Nt; % Transmit power equal to unity at each transmit units N0 = Es ./ SNR; % White Gaussian noise spectral density minNumError = 60; % Minimum of number of errors to be seen nSim = 1e2; % Number of realization of LMIMO-MBM constellation nT = 1e2; % Number of symbol transmissions per each realization of a constellation
Inline functions
Function to add white Gaussian noise
addNoise = @(tSignal, n0) tSignal + sqrt(n0/2) * (randn(size(tSignal)) + 1i * randn(size(tSignal)));
Function to calculate number of symbols in error
compute_num_errors = @(message, messageHat) numel(find(message-messageHat));
Monte Carlo simulation loop
nSNR = numel(SNR); SER = zeros(1, nSNR); % the array holding Symbol Error Rate counter = zeros(1, nSNR); % holds number of simulations performed to reach minNumError for iSNR = 1 : nSNR while (SER(iSNR) < minNumError) % simulate until minNumError is observed display_status(EbN0dB(iSNR), SER(iSNR), counter(iSNR) * nT * nSim); nError = 0; % hold number of errors counter(iSNR) = counter(iSNR)+1; parfor iSim = 1 : nSim
%Generate a realiztion of MIMO-MBM constellation [hPrimary, cPrimary] = generate_mbm_constellation(Nr, Nt, M); % select points in higher energy shells to realize selection gain C = pick_higher_energy(cPrimary, 2^R);
%Generate nT symbols and transmit corresponding signal message = randi(2^R, 1, nT); tSignal = C(:, message); % transmit Signal
%Add AWGN and decode rSignal = addNoise(tSignal, N0(iSNR)); % add AWGN % Search for a signal at minimum distance to recieved points messageHat = find_linearly(C, rSignal); % Exhaustive search ML(minimum distance) decoder
%calculate number of symbols in error
nError = nError + compute_num_errors(message, messageHat);
end SER(iSNR) = SER(iSNR) + nError; end end
Output variables
SER = SER ./ (counter * nT * nSim); % Symbol Error Rate