📄 input_config.m
字号:
%__________________________________________________________________________
% Type: : File Header
% File name : input_config
% File Description : Instructions / function calls to initialize the
% Different objects / components of the simulator
%__________________________________________________________________________
%
%__________________________________________________________________________
% Type: : Function Header
% Function name : input_config
% input : st_initConfig,rombvec
% output : st_initConfig, st_baseStations,
% st_mobileStations
% calling functions :
% called functions : testConfig,initialize_baseStation,
% initialize_baseStation
%
% Function Description : Instructions / function calls to initialize the
% Different objects / components of the simulator
%
% The functional flow of the input module
% 1. Read the configuration file & Initial Test Conditions
% 2. Initialize the cells. i.e
% a. create cell objects,
% b. give them initial dimensions
% 3. Initialize Base Stations, i.e.
% a. Create Base station objects
% b. Give them initial values, which have been read from the configuration file
% 4. Initialize Mobile Station objects, i.e.
% a. Create Mobiles objects
% b. Initialize them as per configuration file.
% 5. Initialize channel conditions, i.e
% a. Create the channel object
% b. Initialize it
% % i. Generate the path loss + shadowing grid
% % ii. Initialize rms delay spread model
% % iii. Initialize the power delay profile model
% 6. Transfer control to the main simulator engine
% % a. With information about the scheduling and link adaptation algorithm under test, test conditions
% __________________________________________________________________________
function [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)
%-----------------------------
% Bring in a GUI
%-----------------------------
% When there is the GUI, then the settings must be saved , as of now it can
% be a .mat file, but if a text format is used, that would have helped a
% lot.
% Read the config file and load the testConfig structure
%Call the test definition
test_definition;
initConfig;
%-----------------------------
% Initialize the cells
%-----------------------------
[st_initConfig] = initialize_base_station(st_initConfig);
%-----------------------------
% Initialize the mobile stations
%-----------------------------
[st_initConfig,st_mobileStations] = initialize_mobile_station(st_initConfig);
%-----------------------------
% Initialize the short term fading channel objects. They are stored in the
% structures for mobile stations
%-----------------------------
% %create a lognmap for shadowing.
[st_channelGrid.lognmapShadow, st_channelGrid.mapvecShadow] = crelognmap(st_initConfig.locBS, st_initConfig.rombvec, st_initConfig.corrDist);
%if ~exist([Root_path,'/sys_lv_simu/sys_lv_main_funcs/ch_mat.mat'],'file')
ch = channelgenerator2(Comm_conf.t_rms,Comm_conf.fd,Comm_conf.sampling_rate,Comm_conf.N,Comm_conf.cp_l,Comm_conf.BW,10100,Comm_conf.divn);
fft_ch2 = fft(ch,Comm_conf.N,1);
fft_ch = fft_ch2(1:st_initConfig.nuSubCarr,:,:);
gain_ch = abs(fft_ch).^2;
% save ch_mat gain_ch
%end
%load ch_mat gain_ch %ch
st_channelGrid.gain_ch=gain_ch;
st_channelGrid.logn = uselognmap(st_initConfig.locMS, st_channelGrid.lognmapShadow, st_channelGrid.mapvecShadow);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -