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

📄 func_link_lv_simu.m

📁 基于OFDM的无线宽带系统仿真It contains mainly two parts, i.e. link-level simulator and system-level simulator.
💻 M
字号:
% link-level simulator% provide BLER-SNR map and LUT (LUT = threshold + margin)%% yy, 01-july-2007function [LA_thres, BLER_SINR_map] = func_link_lv_simu(Comm_conf,Root_path,allow_load_oldtab)filename = ['table_','s',num2str(Comm_conf.state),'_f',num2str(Comm_conf.fd),'_t',num2str(Comm_conf.t_rms),'_N',num2str(Comm_conf.subN),'_L',num2str(Comm_conf.F_LA),...    '_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),'.mat'];% filename = ['table_','s',num2str(Comm_conf.state),'_f',num2str(Comm_conf.fd),'_t',num2str(Comm_conf.t_rms),'_N',num2str(Comm_conf.subN),'_L',num2str(Comm_conf.F_LA),...%     'P',num2str(Comm_conf.F_PA),'_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),'.mat'];dirname = [Root_path,'/sys_link_result/link_lv_result'];filepath = [dirname,'/',filename];if allow_load_oldtab && exist(filepath,'file')&&0,    load(filepath);else    %% find threshold    TS_frame = 1000;%400 % No. of frames for simulation    TS_dir = 'find_thres';    TS_allow_load = 1;    % to find the threshold    TS_conf = ts_config(Comm_conf,TS_frame,TS_dir,TS_allow_load);    %% find margin    MG_frame = 10000; %4000% No. of frames for simulation    MG_dir = 'find_marg';    MG_allow_load = 1;    MG_LAmarg = 0; % start margin    MG_delt = 0.1; % margin resolution    MG_buff = 40;  % BLER average duration (No. of frames)    MG_snr = 40;   % margin found at this SINR    %    MG_conf = mg_config(Comm_conf,MG_frame,MG_dir,MG_allow_load,MG_LAmarg,MG_delt,MG_buff,MG_snr);    %%    stp = 1;    misnr = zeros(3,3); % start SNR    mxsnr = [10 12 16; 16 18 20; 26 26 26]+5; % stop SNR    col_ix = 0;    M_ix = 0;    Ms = [4 16 64]; % modulations    Cs = [1/3 1/2 2/3]; % FECs    for M = Ms        M_ix = M_ix + 1;        cdrt_ix = 0;        for cdrt = Cs            col_ix = col_ix + 1;            cdrt_ix = cdrt_ix + 1;            [LA_thres(M_ix,cdrt_ix),SNRs{col_ix},BLERs{col_ix}] = find_thres(TS_conf,M,cdrt,misnr(M_ix,cdrt_ix),mxsnr(M_ix,cdrt_ix),stp,Root_path);            [runtime_BLER(M_ix,cdrt_ix,:),runtime_marg(M_ix,cdrt_ix,:)] = find_marg(MG_conf,M,cdrt,LA_thres(M_ix,cdrt_ix),Root_path);            LA_marg(M_ix,cdrt_ix) = mean(runtime_marg(M_ix,cdrt_ix,(end-floor(MG_conf.Nframe/MG_conf.buffer_length*2/3):end)));        end    end    %%    map_min = -10; % min SINR in the map    map_max = 50;  % max SINR in the map    BLER_SINR_map = ones(length(0:1:map_max),col_ix + 2);    for k = 1:col_ix        BLER_SINR_map(1:min(map_max,length(BLERs{k})),k+1) = BLERs{k};        BLER_SINR_map(min(map_max,length(BLERs{k}))+1:end,k+1) = 0;            end    BLER_SINR_map = [ones((0-map_min),col_ix+2);BLER_SINR_map];    BLER_SINR_map(:,1) = map_min:1:map_max;    BLER_SINR_map(:,end) = 0;    %st_initConfig.FerdB    %%    tmp1 = LA_thres + LA_marg;    tmp2 = tmp1';    tmp3 = tmp2(:);    tmp4 = Cs' * log2(Ms);    tmp5 = tmp4(:);    [tmp,p] = max(tmp3(3:4));    tmp3(3-1+p) = NaN;    [tmp,p] = max(tmp3(5:2:7));    tmp3(5-2+p*2) = NaN;    LA_thres = [tmp3 [2 2 2 4 4 4 6 6 6]' [1/3 1/2 2/3 1/3 1/2 2/3 1/3 1/2 2/3 ]'];    %st_initConfig.thresholdAtFivePcFerdB    if ~exist(dirname,'dir'),        mkdir(dirname);    end;    save(filepath,'LA_thres','BLER_SINR_map');end

⌨️ 快捷键说明

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