Code covered by the BSD License  

Highlights from
Capacity Maximization in Multiuser OFDMA system

image thumbnail

Capacity Maximization in Multiuser OFDMA system

by

 

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

Paper_RA_ALGs.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

% different algorithms for resource allocation    
%% Full channel state information given pilots power
    % subcarrier allocation : allocated each subcarrier to a user who hase
    % the best channel respone at that
    chan.SelSubchan = max(chan.Hdata.' );
    chan.SelSubchan = chan.SelSubchan(:);   % convert to culumn vector
    % waterfilling algorithm to find the maximum capacity
    [analyze.FCSIMaxCapacityWithPdata analyze.FCSIAllocPowWithPdata ] = ...
        WaterFilling(ofdm.N,power.Pdatas,abs(chan.SelSubchan),ofdm.BW,noise.N0);

%% MMSE capacity with equal power allocation given pilots power    
    % subcarrier allocation : allocated each subcarrier to a user who hase
    % the best channel respone at that
    chan.SelSubchan = max(chan.HhatMMSEdata.' );
    chan.SelSubchan = chan.SelSubchan(:);   % convert to culumn vector

    analyze.ECSIEqPowCapacityWithPdataMMSE = 1/ofdm.N*sum( log2(1+...
            power.Pdatas/ofdm.Ns .*abs(chan.SelSubchan).^2./...
            (noise.sigma + power.Pdatas/ofdm.Ns*chan.Est.SigmaMMSE   ) ) );
%% MMSE maximum capacity trough Iterative algorithm
    % subcarrier allocation : allocated each subcarrier to a user who hase
    % the best channel respone at that
    chan.SelSubchan = max(chan.HhatMMSEdata.' );
    chan.SelSubchan = chan.SelSubchan(:);   % convert to culumn vector

    % initialization
    alg.MMSE.M                  = 1:ofdm.Ns; % series of all subchannels
    alg.MMSE.Mz                 = [];        % series of zero power subchannel
    % temp variable
    Pdata                       = power.Pdatas/ofdm.Ns * ones(ofdm.Ns,1);   
    Mnz                         = alg.MMSE.M;% series of non-zero power subchannel
    capacityNew                 = 0;
    capacityOld                 = analyze.ECSIEqPowCapacityWithPdataMMSE;
    capacityIteration           = zeros(alg.MMSE.maxIterationNumber,1); % to store the capacity trend
    cnt                         = 0;    % counter
    A                           = ones(1,ofdm.Ns);
    dx                          = 0;
    % loop
    while ...(abs(capacityNew-capacityOld)/capacityOld > alg.MMSE.Threshold  ) && ...
          (cnt < alg.MMSE.maxIterationNumber)
      
      % update the counter
      cnt = cnt + 1;
      capacityOld = capacityNew;
      
      capacityIteration(cnt) = 1/ofdm.N*sum( log2(1+...
       Pdata(Mnz).*abs(chan.SelSubchan(Mnz)).^2./(noise.sigma + Pdata(Mnz)*chan.Est.SigmaMMSE) ) );
      
     % compute g,H,w,dp
      g      = -1/log(2) * abs(chan.SelSubchan(Mnz)).^2 * noise.sigma ...
          ./ ( (noise.sigma+ Pdata(Mnz).*chan.Est.SigmaMMSE ).*...
               (noise.sigma+ Pdata(Mnz).*chan.Est.SigmaMMSE + Pdata(Mnz).*abs(chan.SelSubchan(Mnz)).^2) );


      H      = diag(...
          1/log(2) * abs(chan.SelSubchan(Mnz)).^2 * noise.sigma .* ...
          ( 2*Pdata(Mnz).*chan.Est.SigmaMMSE .*(  chan.Est.SigmaMMSE + abs(chan.SelSubchan(Mnz)).^2) + ...
                           noise.sigma        *(2*chan.Est.SigmaMMSE + abs(chan.SelSubchan(Mnz)).^2) ) ...
          ./ ...
          ( (noise.sigma+ Pdata(Mnz).*chan.Est.SigmaMMSE).*...
            (noise.sigma+ Pdata(Mnz).*chan.Est.SigmaMMSE + Pdata(Mnz).*abs(chan.SelSubchan(Mnz)).^2) ).^2 ) ;

      w = 1./(A(Mnz)*H^-1*A(Mnz).') * (-A(Mnz)*H^-1 * g);

      dx = -H^-1*(A(Mnz).'*w+g);

      Pdata(Mnz) = Pdata(Mnz) + alg.MMSE.ConvergeCoeff*dx;
      if sum(Pdata<0)
          alg.MMMSE.Mz        = find(Pdata<=0); % find the location of the pilots with negative power
          Pdata(alg.MMMSE.Mz) = 0;
          Mnz                 = find(Pdata > 0);% non zero location
      end

     Pdata = Pdata./sum(Pdata) * power.Pdatas;

     capacityNew = 1/ofdm.N*sum( log2(1+...
       Pdata(Mnz).*abs(chan.SelSubchan(Mnz)).^2./(noise.sigma + Pdata(Mnz)*chan.Est.SigmaMMSE) ) );

    end
    
    % display the graphical 
    graph.OneRun.Stt = 1;
    Paper_Graph;
    analyze.ECSIIterativeCapacityWithPdataMMSE = capacityNew;
    
    % display the result on command window
    graph.Loop.Stt        = 0;
    showResult.OneRun.Stt = 1;
    Paper_ShowResult;
    
    % clear temporary variables
    %clear g H w dx Pdata A capacityNew capacityOld capacityIteration cnt
    

Contact us