⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 initconfig.m

📁 基于OFDM的无线宽带系统仿真It contains mainly two parts, i.e. link-level simulator and system-level simulator.
💻 M
📖 第 1 页 / 共 2 页
字号:
    otherwise
        sprintf(' ncells per cluster is not defined correctly \n')
        break
end

% change the coverage area scale factor depending on whether g factor is
% being measured by handoff or not
switch st_initConfig.handOffFlg
    case 'nohandoff' % in case of no handoff the users are limited to a 
                     % certain area but the g-factor distribution must be
                     % maintained
        switch st_initConfig.scenarioLabel
            case {'macro1','macro3'}
                st_initConfig.scaleFactor=4;% to match the SINR (g factor) distribution
            case {'micro1'}
                st_initConfig.scaleFactor=2;%2;% to match the SINR (g factor) distribution
            otherwise
        end
    case 'handoff'% for G-factor calculations
        % scalefactor already defined earlier
    otherwise
        sprintf('HandOff setting not configured correctly\n')
        break
end

%defining empty variable for area over which users will be generated
st_initConfig.rombvec=nan; % rohmbus for coverage area.


% Rms delay spread model: Can�t do anything here, but put in the channel impulse response generator
% The power decay profile: 	�exponential�
% 				�pdp�  This means power decay
% Can�t do anything here but must be put into channel impulse response generator
% Based on the value, the 'channel' object will be initialized
% Another value can be 'pdp'
% If 'exponenitial' is used, then the rms
% delay spread value has to be generated
% by the model for rms delay spread
% which is a function of the distance
% between the mobile and the base station
st_initConfig.pdp = 'exponential' ; 





%-------------------------------------------------------------------------%
%                                                                         %
%                .---------------------------------------.                %
%                | SETTINGS ON THE BASE STATION (Node B) |                %
%                '---------------------------------------'                %
%                                                                         %
%-------------------------------------------------------------------------%




%Base Station max transmit power
st_initConfig.maxPowBS = 1e-3*(10.^(st_initConfig.maxPowBSdBm/10));% Converting logerithmic scale to linear scale.

% % POWER PER SUB CARRIER
st_initConfig.maxPowBsSubCdBm = st_initConfig.maxPowBSdBm - 10*log10(st_initConfig.nuSubCarr);%28.1;% as per wimax calculations
%st_initConfig.maxPowBsSubCarr = ((10.^(st_initConfig.maxPowBsSubCdBm/10))*1e-3)
st_initConfig.maxPowBsSubCarr = st_initConfig.maxPowBS/(Comm_conf.subN * floor(st_initConfig.nuSubCarr/Comm_conf.subN)); 

%Number of Sector Stations
st_initConfig.nuBs=st_initConfig.ncell_per_cluster*st_initConfig.nuCluster*st_initConfig.sps;% Number of base stations


% Number of antennas at the base station
% AS OF NOW USE ONLY ONE ANTENNA UNTILL PROPER ALGORITHMS ARE IMPLEMENTED
st_initConfig.nuAntennaBS = Comm_conf.T_div;%2; % This can be given values up to 12 !
% Location of base stations, this is kept here to run the system faster
st_initConfig.locBS=nan(1,st_initConfig.ncell_per_cluster);


%indexes of base stations which cause interference in the cell center
%region, and in case of reuse factor of one, in the outer region as well
%st_initConfig.listIntfBSIdx=[39 27 46 28 6 15 14 40 42 41 30 49 31 32 29 7 16 19 18 17];

%indexes of base stations which cause interference in the outer cell region
%in case of fractional reuse factor
%st_initConfig.listIntfBSFRFIdx=[40 41 31 29 7 16 18];

%Index of sectors
st_initConfig.listBs = 1:st_initConfig.nuBs;

% list of interfering base stations
st_initConfig.intfBsIdxvector = st_initConfig.listBs(st_initConfig.listBs~=st_initConfig.desiredBsIdx);




%-------------------------------------------------------------------------%
%                                                                         %
%                 .------------------------------------.                  %
%                 | SETTINGS ON THE USER EQUIPMENT (UE)|                  %
%                 '------------------------------------'                  %
%                                                                         %
%-------------------------------------------------------------------------%




%noise figure in receivers
st_initConfig.noiseFiguredB=9;
st_initConfig.noiseFigureLin=10^(st_initConfig.noiseFiguredB/10);
st_initConfig.noisePowerPerSubc=(1.3806503e-23)*300*st_initConfig.subCarrBw*st_initConfig.noiseFigureLin;
st_initConfig.noisePower=st_initConfig.noisePowerPerSubc*st_initConfig.nuSubCarr;

% UMTS Receiver sensitivity: Node B: -121dBm, Mobile -117dBm at BER of 10-3
% UMTS specs: Mobile peak power: Power class 1: +33 dBm (+1dB/-3dB) = 2W;
% class 2: +27 dBm, class 3: +24 dBm, class 4: +21 dBm
% WiMAX: receiver sensitivity: -30 dBm, 3.5 MHz bandwidth at 3.5 GHz/5 GHz
% WiMAX: Transmit power can vary!


% Number of mobiles:
st_initConfig.nuMob = NumberActiveMobiles;% 2e1; 1e4; % This can be varied. use 1e4  to check the
% coverage area in one shot

st_initConfig.dT = st_initConfig.tSymb ; %st_initConfig.subFramePeriod;%st_initConfig.tSymb ; % Interval at which the mobile
% locations are updated , we need to discuss this.

% Number of antennas at the mobiles:
% AS OF NOW USE ONLY ONE ANTENNA UNTILL PROPER ALGORITHMS ARE IMPLEMENTED
st_initConfig.nuAntennaMS =  Comm_conf.R_div;% ; % This can be varied.

st_initConfig.vMean = fixVeloUnderTestkmph; % average velocity of mobiles in kmph.
st_initConfig.vFactor = 1/3;
st_initConfig.max_veloms = (1+st_initConfig.vFactor)*st_initConfig.vMean;
st_initConfig.min_veloms = (1-st_initConfig.vFactor)*st_initConfig.vMean;

%st_initConfig.max_veloms = 50; %18/5*3e8/st_initConfig.cf/(10*st_initConfig.tSymb);
% This needs to be changed later
% when different mobiles can have
% different velocities
st_initConfig.aMean = st_initConfig.vMean*.01; % average acceleration of Mobiles

st_initConfig.doppMeanMax = st_initConfig.vMean*5/18*st_initConfig.cf/3e8;

% mobile locations,
st_initConfig.locMS=nan(st_initConfig.nuMob,1);

%Mobile velocities
st_initConfig.veloMS=nan(st_initConfig.nuMob,1);

% st_initConfig.rateReqMS=nan(st_initConfig.nuMob,1); % not being used now.
% st_initConfig.bitErrRateReqMS=nan(st_initConfig.nuMob,1);

st_initConfig.saveUserInfo_factor = 1000;%1000; % save user information per 100 subframes





%-------------------------------------------------------------------------%
%                                                                         %
%        .---------------------------------------------------.            %
%        | SETTINGS ON LINK ADAPTATION & RESOURCE ALLOCATION |            %
%        '---------------------------------------------------'            %
%                                                                         %
%-------------------------------------------------------------------------%





%st_initConfig.feedBackDelayRate = 10*st_initConfig.doppMeanMax; % Delay
% between CSI fed back to BS for LA and
% scheduling and use in subsequent
% frame Given in Hz
%  The above method of defining delay in terms of Doppler is good from
%  analysis point of view. But, when studying system, one should use real
%  parameters which are specified in the seconds as in the next variable.
st_initConfig.feedBackDelayInterval = st_initConfig.tSymb*Comm_conf.DELAY;%st_initConfig.FramePeriod;%1/st_initConfig.feedBackDelayRate;% The same as
% above but in seconds

% check if the feedback delay is less than one OFDM symbol, which is not
% valid. If it is so, then make it at least one OFDM symbol period
if (st_initConfig.feedBackDelayInterval*1e6) < (st_initConfig.tSymb*1e6)
    st_initConfig.feedBackDelayInterval = st_initConfig.tSymb;
    st_initConfig.feedBackDelayRate = 1/st_initConfig.feedBackDelayInterval;
end

% Compute the number of ofdm symbols equivalent of the update rate
st_initConfig.feedBackDelayIntervalNuOfdms = ceil(st_initConfig.feedBackDelayInterval/st_initConfig.tSymb);

% This value will be used to find mobile whose channel condition is bad.
% then other conditions will determine whether the mobile is to dropped
% from service or not
st_initConfig.SINR_Threshold=0; 


% Define the structure for channel , it will store the shadowing grid, and
% the tau_rms grid
st_channelGrid.epsilon = 0.5 ;% model parameter for tau_rms
st_channelGrid.T1 = 1.0e-6;% rms delay spread at a distance of 1 km in urban macro cell


%1 ; % 1 --> Very simple uniform resource allocation,
% a group of sub carriers is allocated to one user
% A random group is allocated to one user
% uniform power allocation across sub carriers
st_baseStation.nuSubCarrPerSubChan = Comm_conf.subN;%floor(st_initConfig.nuDataSubCarr/st_initConfig.nuMob);
st_baseStation.nuSubChannels = floor(st_initConfig.nuSubCarr/st_baseStation.nuSubCarrPerSubChan);

st_baseStation.tcNuSubFrames=test_pf_thpt_avg_time_window_factor;%100; % the averaging time is 50 Frame periods

st_baseStation.tc=st_initConfig.subFramePeriod*st_baseStation.tcNuSubFrames;
% Scheduling Algorithm
st_baseStation.scheduler_Algo  = SchedulingAlgoChoice; % Round Robin, but fixed modulation and coding rate

% This is the index, which rolls and is used in looking back the history of
% a mobile to terminate it
%st_initConfig.nuFrmPerSlot=max(50,st_baseStation.tcNuSubFrames);
st_initConfig.MAX_OFDM_SYMBOL_WAIT=test_user_time_out_period_factor;

%slot value should be at least 1 more than the drop/average value.
% for average per 2 frame, 3 values are needed to get the 2 differences.
% Same for drop user.
st_initConfig.nuFrmPerSlot=max(st_initConfig.MAX_OFDM_SYMBOL_WAIT + 1,st_baseStation.tcNuSubFrames)+1;


%The following variable from update_mobile_structure_before_frame.m has been shifted here
%st_initConfig.MAX_OFDM_SYMBOL_WAIT=min(test_user_time_out_period_factor,st_initConfig.nuFrmPerSlot-10);%st_initConfig.nuOfdmSymbPerFrame;%4*1;

switch st_baseStation.scheduler_Algo
    case 0 % Round Robin, but fixed modulation and coding rate
        st_baseStation.FixModulation=FixMod;
        st_baseStation.FixFec=FixRate; % Need to change the resource allocation codes
%         st_baseStation.nuSubCarrPerSubChan = 16;%floor(st_initConfig.nuDataSubCarr/st_initConfig.nuMob);
%         st_baseStation.nuSubChannels = st_initConfig.nuSubCarr/st_baseStation.nuSubCarrPerSubChan;
%         st_initConfig.nuMob = st_baseStation.nuSubChannels;
        if floor(st_baseStation.nuSubChannels/st_initConfig.nuMob)==0
            st_baseStation.nuSubChannelsMAX_RR=1;
        else
            st_baseStation.nuSubChannelsMAX_RR=floor(st_baseStation.nuSubChannels/st_initConfig.nuMob);
        end
    case {1 2}
        %st_baseStation.nuSubCarrPerMs = floor(st_initConfig.nuDataSubCarr/st_initConfig.nuMob);
        if floor(st_baseStation.nuSubChannels/st_initConfig.nuMob)==0
            st_baseStation.nuSubChannelsMAX_RR=1;
        else
            st_baseStation.nuSubChannelsMAX_RR=ceil(st_baseStation.nuSubChannels/st_initConfig.nuMob);
        end
    case 4
        % max c/I
        %         sub_channel_counter=0;
    case 5
        % Proportional Fair
        % Simple PF. with no constraints!
    otherwise
end
% st_initConfig.maxPowBsSubCarrSet = st_baseStation.nuSubCarrPerSubChan*(10.^(st_initConfig.maxPowBsSubCdBm/10))*1e-3;
% st_initConfig.noisePowerPerSubCarrSet = st_baseStation.nuSubCarrPerSubChan*st_initConfig.noisePowerPerSubc;
% rx_snr=10*log10(st_initConfig.noisePower/st_initConfig.maxPowBsRevCalc)
% rx_snr=10*log10(st_initConfig.noisePowerPerSubc/st_initConfig.maxPowBsSubCarr)
%
% allocation units
st_baseStation.allocation = nan(st_baseStation.nuSubChannels,st_initConfig.nuAntennaMS,st_initConfig.nuAntennaBS);

% rates as mentioned by LA for each mobile's link, each spatial + frequency
% domain link
st_baseStation.mod = nan(st_baseStation.nuSubChannels,st_initConfig.nuAntennaMS,st_initConfig.nuAntennaBS);
st_baseStation.fec = nan(st_baseStation.nuSubChannels,st_initConfig.nuAntennaMS,st_initConfig.nuAntennaBS);
st_baseStation.transmitPower = nan(st_baseStation.nuSubChannels,st_initConfig.nuAntennaMS,st_initConfig.nuAntennaBS);


switch (st_baseStation.FreqPlan)
    case 'SFN'
        %st_baseStation.transmitPower = 10^(st_initConfig.maxPowBSdBm/10)/(st_initConfig.nuDataSubCarr*st_initConfig.nuAntennaBS)*ones(st_initConfig.nuMob ,st_initConfig.nuDataSubCarr,st_initConfig.nuAntennaMS,st_initConfig.nuAntennaBS);
    case 'fractionalSFNannular'

    case 'fractionalSFN'
end

% st_measurement = nan;
% st_measurement.sinr_avg=zeros(1,round(1.5*st_initConfig.cellRadius));
% st_measurement.cnt = zeros(1,round(1.5*st_initConfig.cellRadius));
st_measurement.outageCnt = 0;
st_measurement.totalBitsSent = 0;
st_measurement.totalFramesinError=uint32(0);
st_measurement.sinrCnt =0 ;
st_measurement.sinrAvg = 0;
st_measurement.sinrAvgDist = 0;
st_measurement.amcCnt = 0 ;
st_measurement.mod = 0;
st_measurement.fec = 0;
st_measurement.mdfcDist = 0;

% Thresholds for non power adaptation scenario
% The throughput threshold look up is used to find the rate at a certain
% SNR in dB, the first column is the SNR, while the second column is the
% modulation order and the third column is the FEC rate
% @ 16 SUB CARRIERS IN ONE SUB CHANNEL @ 200 kmph
st_initConfig.lookUpTableMargindB=0;%1.5;%in dB
% initilize 5% FER lookup table
%init_tables;
%%%%%%%%%%%%%%%%%%%%%% yy added %%%%%%%%%%
st_initConfig.chnums_max = 10030;
st_initConfig.chnums_min = 30;
%st_initConfig.tast_file_size_max_ratio = tast_file_size_max_ratio;


%%
st_initConfig.F_LA = Comm_conf.F_LA;
st_initConfig.F_PA = Comm_conf.F_PA;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -