📄 simu_find_thres_find_marg.m
字号:
% clear all;close all;clc% %%% fd = 50;% t_rms = 0.5;% F_LA = 1;% BO_dB = 0;% use_HPA_flg = 0;% flg_offset = 0;% flg_csi_err = 0;% BW = 5e6;% N = 512;% subN = 16;% cp_L = 128;% Nsymbol = 6;% state = 1;% targetFER = 0.05;% chnums = 1000;% sampling_rate = 1.536;% %% Comm_conf = ...% comm_config(fd,t_rms,F_LA,BO_dB,use_HPA_flg,flg_offset,flg_csi_err,BW,N,subN,cp_L,Nsymbol,state,targetFER,chnums,sampling_rate);%%function [LA_thres, BLER_SINR_map] = func_link_lv_simu(Comm_conf,Root_path)filename = ['table_','s',num2str(state),'_f',num2str(fd),'_t',num2str(t_rms),'_N',num2str(subN),'_L',num2str(F_LA),... 'P',num2str(F_PA),'E',num2str(flg_csi_err),... 'c',num2str(flg_offset),'D',num2str(DELAY),'BO',num2str(BO_dB),'HPA',num2str(use_HPA_flg),'.mat'];filepath = [Root_path,'/sys_link_result/link_lv_result','/',filename];if allow_load_oldtab && exist(filepath,'file'), load(filepath);else %% TS_frame = 20; TS_dir = 'find_thres'; TS_allow_load = 1; % TS_conf = ts_config(Comm_conf,TS_frame,TS_dir,TS_allow_load); %% MG_frame = 100; MG_dir = 'find_marg'; MG_allow_load = 1; MG_LAmarg = 0; MG_DELAY = 4; MG_delt = 0.2; MG_buff = 20; MG_snr = 20; % MG_conf = mg_config(Comm_conf,MG_frame,MG_dir,MG_allow_load,MG_LAmarg,MG_DELAY,MG_delt,MG_buff,MG_snr); %% stp = 5; misnr = zeros(3,3); mxsnr = [10 12 16; 16 18 20; 26 26 26]; col_ix = 0; M_ix = 0; Ms = [4 16 64]; Cs = [1/3 1/2 2/3]; 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); [runtime_BLER(M_ix,cdrt_ix,:),runtime_marg(M_ix,cdrt_ix,:)] = find_marg(MG_conf,M,cdrt,LA_thres(M_ix,cdrt_ix)); 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; map_max = 50; 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) = BLERs{k}; 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; desp = [sys{state},filename]; save(filepath,'LA_thres','BLER_SINR_map');end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -