The complete project of OFDMA system.
It tries to maximize the network capacity.

Paper_Loop.m

% People can use the results and the codes freely if they refer to this job.
% To download the report of this job please check the following link:
% http://ens.ewi.tudelft.nl/~ramezani/Errata01.pdf
% These Matlab codes are provided by Hamid Ramezani.
% Ver01 - 08-Dec-2011
%% Clear all parameters, close all figures, and clear the command window
clear
%close all
clc
%% loading basic variables
simulate.Stt = 0;
Paper_Para;
%% Simulation
simulate.Stt = 1;
% 0 : just run the simulation for a single time
% 1 : sweep over percentage of power between data and pilots
% 2 : sweep over Average SNR , defined as Ptotal/(N0*B)
% 3 :
%% loading parameters
switch simulate.Stt
case 0 % 0 : just run the simulation for a single time
loop.Vector = [];
case 1 % 1 : sweep over percentage of power between data and pilots
loop.Vector = power.AlphaV;
case 2 % 2 : sweep over Average SNR , defined as Ptotal/(N0*B)
loop.Vector = power.ASNRdBV;
case 3
end
loop.VectorL = length(loop.Vector);
loop.NIteration = 500; % number of iteration
% temparary variables
loop.out1 = zeros(loop.NIteration,loop.VectorL);
loop.out2 = zeros(loop.NIteration,loop.VectorL);
loop.out3 = zeros(loop.NIteration,loop.VectorL);
% temporary variables
loopCnt = 0;
loopCnt1 = 0;
loopCnt2 = 0;
%% main loop
for loopCnt2 = 1 : loop.VectorL
% updating the loop variable
switch simulate.Stt
case 0 % 0 : just run the simulation for a single time
case 1 % 1 : sweep over percentage of power between data and pilots
power.Alpha = loop.Vector(loopCnt2);
Paper_Para;
case 2 % 2 : sweep over Average SNR , defined as Ptotal/(N0*B)
power.ASNRdB = loop.Vector(loopCnt2);
Paper_Para;
case 3
end
% loop for number of iteration
for loopCnt1 = 1 : loop.NIteration
% building channel coefficients
Paper_ChannelStateInfo;
% running different algorithms
Paper_RA_ALGs
% storing the results
loop.Out1(loopCnt1,loopCnt2) = analyze.FCSIMaxCapacityWithPdata;
loop.Out2(loopCnt1,loopCnt2) = analyze.ECSIEqPowCapacityWithPdataMMSE;
loop.Out3(loopCnt1,loopCnt2) = analyze.ECSIIterativeCapacityWithPdataMMSE;
% update the temp variable
loopCnt = loopCnt + 1;
end
% evaluation of percentage of running
disp([num2str(round(loopCnt./loop.VectorL/loop.NIteration*100)),...
'% is completed']);
end
%% Graphical observation
graph.Loop.Stt = 1;
graph.OneRun.Stt = 0;
Paper_Graph;