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

📄 mainofdma.m

📁 基于OFDM的无线宽带系统仿真It contains mainly two parts, i.e. link-level simulator and system-level simulator.
💻 M
字号:
%__________________________________________________________________________
% Type:                 :   File Header
% File name             :   main
% File Description      :   Instructions / function calls to run the
%                           simulator. It will call the functions input,
%                           the simulator engine, and the measurement unit
%                           version 3: This will contain codes to simulate
%                           and compare cases with fixed modulation against
%                           one using adaptive modulation and coding. The
%                           comparison will be in terms of throughput Vs
%                           Distance, as a function of number of users in
%                           the system under round robin scheduling with
%                           equal number of sub carriers allocated to each
%                           user. The coding is present now 28th Nov 06. It
%                           needs to used propoperly, a good measurement
%                           module has to be coded. 28Nov2006
%
%                           Plans for later version: we are writing it here
%                           so that in the next version when this file is
%                           copied, we can see what was in the plans:
%                           Later versions will follow the steps as below
%                           1. FER requirement + Equal number of sub carriers + round robin
%                           + 8 sub carriers , therefore frame size
%                           increased to 2 ms, at different velocities, 20,
%                           50, 100, 200 kmph
%                           This is a test case and has been noted in the
%                           test case design file. The way to implement
%                           this would require changing some parts of the
%                           link adaptation and resource allocation. A
%                           timer needs to be present, on whose expiery a
%                           new RA + LA will be done. 28Nov2006

%                           2. FER requirement + Equal number of sub carriers + round robin
%                           scheduling , but different number of users,
%                           i.e. different sub channel... Code is in such a
%                           state that this can be done easily when the
%                           test case date is reached. it will take 1/2 to
%                           1 day's programing 28Nov2006
%
%                           3. FER requirement + equal number of sub carriers but
%                           proportional fair scheduling, under all
%                           conditions of velocities and sub channel
%                           sizes... Code is ready with PF. PF needs to be
%                           discussed with Troels, and correct parameters
%                           needs to be used. Therefore it will be 1/2 to 1
%                           day's programing before the testing can begin.
%                           28Nov2006
%
%                           4. FER requirement + data rate requirement
%                            (WHICH ALSO IMPLIES DIFFERENT LA ADAPTATION WINDOWS)+ different number
%                           of users and velocity conditions, but round
%                           robin *** HYBRID LINK ADAPTATION
%
%                           5. same as above but with proportional fair
%                           scheduling ***
%
%                           6. No FER requirement, data rate requirement,
%                           different number of users and different
%                           mobility conditions, round robin ***
%
%                           7. same as above but p.f.
%
%                           8.to14. same as 1:7 but with power control ***
%
%                           15 to 28 same as above but with annular ring
%                            with frequency planning for outer ring ***
%
%                           29 to 42 same as above but with fractional
%                           reuse ***
%
%                           43 + same as above with transmit and receive
%                           diversity, but one spatial stream to a user ***
%
%                           *** an SDMA scenario ***
%
%                           44 + same as above but with channel estimation
%                           error, i.e. estimation error in SINR, Doppler,
%                           rms delay spread, (using markov process, etc
%                           for the modeling of these errors) ***
%
%                           45 + Bring out the gap between round robin and
%                           P.F. with link adaptation ***
%
%                           46 + same as above but with simultaneous
%                           existance of different mobility
%                           conditions.Therefore proposal for a new
%                           Scheduling scheme which can handle different
%                           mobility conditions ***
%
%                           47 All of above with three sector antenna
%__________________________________________________________________________

function mainOFDMA(test_avg_velo_kmph,test_nu_active_users,test_scenario,test_resource_allocation,lp_nu_drops,st_initConfig,Comm_conf,Root_path)
%-----------------------------
% Prepare for simulation
%-----------------------------
%close all open files handlers
%fclose('all');
tic % tic to begin clock, and toc to end clock
% set the random number generators to a random (real random taking the clock state) state
rand('state',sum(100*clock));
randn('state',sum(100*clock));
%-----------------------------
% Read Input settings
%-----------------------------
% SchedulingAlgoChoiceNumber=4;%4;%2; % Which scheduling algorithm to be used.
% See the config file, it is called from the
% input_config
% 2 for RR
% 4 for max C/I
% 5 for simple PF
% set figures to display curves

% CALL THE INPUT CONFIG FUNCTION, SO THAT THE VARIABLES ARE INITIALIZED
[st_initConfig, st_baseStation,st_measurement,st_channelGrid,st_mobileStations] = input_config(test_avg_velo_kmph,test_nu_active_users,test_scenario,test_resource_allocation,st_initConfig,Comm_conf,Root_path);

%make directory for the test case defined above to store the result
test_case_name=[Root_path,'/sys_link_result/sys_lv_result/',st_initConfig.test_case_name,'Drp',num2str(lp_nu_drops),'_trms',num2str(Comm_conf.t_rms),'f',num2str(Comm_conf.fd),'_s',num2str(Comm_conf.state),'N',num2str(Comm_conf.N),'subN',num2str(Comm_conf.subN),'_E',num2str(Comm_conf.flg_csi_err),'c',num2str(Comm_conf.flg_offset),'D',num2str(Comm_conf.DELAY),'BO',num2str(Comm_conf.BO_dB),'HPA',num2str(Comm_conf.use_HPA_flg),'_BLER',num2str(Comm_conf.targetFER)];
if ~exist(test_case_name,'dir'),mkdir(test_case_name);end;
%change over to the directory to save the results
cd(test_case_name);
%-----------------------------
% Call the main simulator engine
%-----------------------------
st_initConfig = ofdma_sfn_Cellular_la_dl_simulator(st_channelGrid, st_initConfig,st_baseStation,st_measurement,st_mobileStations);
save dataSimConfig	st_initConfig
% just to measure the time taken to simulate (this is not at all important)
total_time_sec = toc; total_time_min = total_time_sec/60
cd(Root_path)

⌨️ 快捷键说明

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