% TITLE: Capacity Estimation for Users in Mobile-WiMAX
% Function: Main(1/3)
clc
clear all
disp(' APPLICATION DISTRIBUTION')
disp('------------------------------------------------')
disp(' APPLICATION DATA-RATE WEIGHT')
disp(' Interactive gaming 50kbps 25%')
disp(' VoIP and Video Conf. 32kbps 10%')
disp(' Streaming Media 64kbps 12.5%')
disp(' Web Browsing + Email nominal 30%+2.5%')
disp(' Media Content Downloading BE 20%')
disp('------------------------------------------------')
disp(' ')
disp('--->> SERVICE CLASS PARAMETERS(RESIDENTIAL/BUSINESS/OSR) <<---')
BW_res=input('Enter the DATA-RATE for RESIDENTIAL Class Subscribers(kbps):');
res=input('Enter the PERCENTAGE of RESIDENTIAL Class Subscribers(%):');
CR_r=input('Enter the CONTENTION RATIO for RESIDENTIAL Class Subscribers :');
BW_bus=input('Enter the DATA-RATE for BUSINESS Class Subscribers(kbps):');
bus=100-res;
if (BW_res<146 || BW_bus<146)
error('The input bandwidth can not support the applications');
end
disp(sprintf(' The PERCENTAGE of BUSINESS Class Subscribers is : %d%%',bus));
CR_b=input('Enter the CONTENTION RATIO for BUSINESS Class Subscribers :');
OSR=input('Enter the OVER SUBSCRIPTION RATIO(OSR) :');
disp(' ')
disp(' MODULATION DISTRIBUTION')
disp('------------------------------')
disp('MOD-TYPE OCR WEIGHT k')
disp(' 64QAM 3/4 40% 6')
disp(' 64QAM 2/3 40% 6')
disp(' 16QAM 3/4 5% 4')
disp(' 16QAM 1/2 5% 4')
disp(' QPSK 3/4 2.5% 2')
disp(' QPSK 1/2 2.5% 2')
disp(' BPSK 1/2 5% 1')
disp('------------------------------')
disp(' ')
disp('--->> SYSTEM PARAMETERS <<---')
BW_raw=input('Enter the channel bandwidth (5/10 MHz):');
if (BW_raw==5)
FFT_DL=360; FFT_UL=272; %Number of data sub-carriers for 5MHz
NsubCH_DL=15; NsubCH_UL=17; %Number of sub-channels considering PUSC for 5MHZ
elseif (BW_raw==10)
FFT_DL=720; FFT_UL=560; %Number of data sub-carriers for 10MHz
NsubCH_DL=30; NsubCH_UL=35; %Number of sub-channels considering PUSC for 10MHZ
end
CP=input('Enter the CYCLIC PREFIX RATE (4/8/16/32):');
DL=input('DL:UL SUBFRAME RATIO - Enter DL portion :');
UL=input('DL:UL SUBFRAME RATIO - Enter UL portion :');
DL_UL_traffic=input('Enter the DL/UL TRAFFIC RATIO :');
conn_PDU=input('Enter the average number of connections per PDU :');
PDU_burst=input('Enter the average number of PDUs per data burst :');
disp('--------------------------------------------------')
disp(' ')
Tb=0.0914; % Fixed Usful OFDM symbols duration(mS)
Ts=Tb+(Tb/CP); % Total Symbol duration(mS)
n=1; % Number of users
BW_DL=BWuseful_DL(n,FFT_DL,Ts,DL,UL,NsubCH_DL,conn_PDU,PDU_burst);
BW_UL=BWuseful_UL(n,FFT_UL,Ts,DL,UL,NsubCH_UL,conn_PDU,PDU_burst);
osr= ((n/100)*(res*BW_res+bus*BW_bus))/(FFT_DL/(2*Ts));
disp(sprintf('The PEAK data-rate in the is %g kbps',BW_DL));
disp(sprintf('The PEAK data-rate in the is %g kbps',BW_UL));
DL_demand=0; UL_demand=0;
% The following loop compares the [1]available BW (after removing the
% overheads caused by the system configuration based the number of users)
% with [2]minimum required data-rate to support users'demand (according to
% the subscribers classes based on the number of users) in both DL and UL.
% osr is calculated as the number of users raises and is compered with OSR
while (DL_demand < BW_DL && UL_demand < BW_UL && osr for %d simultaneous subscribers',DL_demand,n));
disp(sprintf('%g kbps is the MIN-DEMAND in the for %d simultaneous subscribers',UL_demand,n));
disp(sprintf('%g kbps is AVAILABLE BW in the for %d simultaneous subscribers',BWuseful_DL(n,FFT_DL,Ts,DL,UL,NsubCH_DL,conn_PDU,PDU_burst),n));
disp(sprintf('%g kbps is AVAILABLE BW in the for %d simultaneous subscribers',BWuseful_UL(n,FFT_UL,Ts,DL,UL,NsubCH_UL,conn_PDU,PDU_burst),n));
disp(sprintf('The achieved OSR=%g for %d simultaneous subscribers',((n/100)*(res*BW_res+bus*BW_bus))/(FFT_DL/(2*Ts)),n));
%Sub-FUNCTION 1 :
% TITLE: Capacity Estimation for Users in Mobile-WiMAX
% Function: Downlink(2/3)
Function BW_DL=BWuseful_DL(n,FFT_DL,Ts,DL,UL,NsubCH_DL,conn_PDU,PDU_burst)
% The function calculates the available data-rate in the downlink by
% removing the overheads originated from the system configuration and
% additional users. A generic modulation distribution is assumed.
% Modulation Distribution
% Mod Type OCR weight k
% 64QAM 3/4 40% 6
% 64QAM 2/3 40% 6
% 16QAM 3/4 5% 4
% 16QAM 1/2 5% 4
% QPSK 3/4 2.5% 2
% QPSK 1/2 2.5% 2
% BPSK 1/2 5% 1
% Raw bandwidth based on the modulation distribution
BW1=(FFT_DL/Ts)*(0.4*6*(3/4+2/3) + 0.05*4*(3/4+1/2) + 0.025*2*(3/4+1/2) + 0.05/2 );
BW2=(DL/(DL+UL))*BW1; % DL:UL Ratio
Tf=5; % Frame length (mS)
subf_DL=(DL/(DL+UL))*Tf; % Length of the downlink subframe ?(based on DL:UL ratio)
Tg=0.0114; % DL/UL Transission gap duration
Ns=floor((subf_DL-Tg)/Ts); % Number of complete symbols within ?the DL subframe
BW3=(Ns*Ts/subf_DL)*BW2; % Removing subframe overhead
BW4=BW3*(1-1/Ns); % Removing DL preamble overhead= ?one symbol
MAU=ceil((144*3/4)/NsubCH_DL); % Minimum Allocation Unit for worst ?case (64QAM-3/4)
N_PDU=ceil(n/conn_PDU); % Number of MAC-PDUs
N_burst=ceil(N_PDU/PDU_burst); % Number of MAC data burst 58
DL_map=(8+ n*4 +4)+ ceil((3+N_burst*9)*Tf/100)+MAU/2; % DL_map ?overhead(bytes)+ periodical DCD every 100mS
UL_map=(11+ n*6 +6) + ceil((8+N_burst*4)*Tf/100)+MAU/2; % UL_map ?overhead(bytes)+ periodical UCD every 100mS
% Note that a 50% mismatch of packing and fragmentation is considered
bytes_over=MAU+DL_map+UL_map; % Total number of overhead bytes ?per DL sub-frame sent by BPSK1/2
DR_bpsk=FFT_DL/(2*Ts); % Data-rate for BPSK1/2 (kbps)
dr_over1=8000*bytes_over/DR_bpsk; % Overhead data-rate sent by ?BPSK1/2
BW5=BW4-dr_over1; % Removing overheads for FCH and ?DL/UL_maps
MAC_PDU=N_PDU*(6+3+4); % MAC-PDU ?overhead(6GMH+3Fragmentation/Packing(SubH)+4CRC bytes)
MAC_burst=MAC_PDU + N_burst*(MAU/2);% Overhead per MAC_burst (PDUs ?overhead+burst mismach)
dr_over2=8000*MAC_burst/BW1; % MAC_Burst overhead data-rate sent ?by average modulation distribution for DL
% Final available bandwidth in DL with respect to the number of ?simultaneous users
BW_DL=BW5-dr_over2;
%Sub-FUNCTION 2 :
% TITLE: Capacity Estimation for Users in Mobile-WiMAX
% Function: Uplink(3/3)
Function BW_UL=BWuseful_UL(n,FFT_UL,Ts,DL,UL,NsubCH_UL,conn_PDU,PDU_burst)
% The function calculates the available data-rate in the uplink by
% removing the overheads originated from the system configuration and
% additional users. A generic modulation distribution is assumed.
% Modulation Distribution
% Mod Type OCR weight k
% 64QAM 3/4 40% 6
% 64QAM 2/3 40% 6
% 16QAM 3/4 5% 4
% 16QAM 1/2 5% 4
% QPSK 3/4 2.5% 2
% QPSK 1/2 2.5% 2
% BPSK 1/2 5% 1
% Raw bandwidth based on the modulation distribution
BW1=(FFT_UL/Ts)*(0.4*6*(3/4+2/3) + 0.05*4*(3/4+1/2) + 0.025*2*(3/4+1/2) + 0.05/2 );
BW2=(UL/(DL+UL))*BW1; % DL:UL Ratio
Tf=5; % Frame length (mS)
subf_UL=(UL/(DL+UL))*Tf; % Length of the Uplink subframe ?(based on DL/UL ratio)
Tg=0.0114; % DL/UL Transission gap duration
Ns=floor((subf_UL-Tg)/Ts); % Number of complete symbols within ?the UL subframe
BW3=(Ns*Ts/subf_UL)*BW2; % Removing subframe overhead
ranging = (Tf/2000)*(4/Ns); % Periodical Ranging Overhead(every ?2seconds=4Symbols)
BW4=BW3*(1-ranging); % Removing ranging overhead
MAU=ceil((144*3/4)/NsubCH_UL); % Minimum Allocation Unit for worst ?case (64QAM-3/4)
contention=ceil((n*10)/(MAU*NsubCH_UL)+1);% Contention region overhead ?symbols(BRH+preamble)
contention=(Tf/100)*(contention/Ns);% periodical Contention ?overhead(every 100mS)
BW5=BW4*(1-contention); % Removing contention overhead
N_PDU=ceil(n/conn_PDU); % Number of MAC-PDUs
N_burst=ceil(N_PDU/PDU_burst); % Number of MAC data burst
% MAC_PDUoverhead(bytes)(6Generic(MH)+3Fragmentation/Packing(SubH)+ ?2GrantManagement(subH)+4CRC)
MAC_PDU=N_PDU*(6+3+2+4);
% Overhead per MAC_burst (PDUs overhead+burst preamble+burst mismach)
MAC_burst=MAC_PDU + N_burst*(MAU+MAU/2);
dr_over=8000*MAC_burst/BW1; % MAC-burst overhead data-rate sent ?by average modulation distribution for UL
% Final available bandwidth in UL with respect to the number of ?simultaneous users
BW_UL=BW5-dr_over;