📄 res_pdf_range_may22.m
字号:
% PDF of allocated bit, coding rate, rate, per block throughput% three figures for each case, corresponds to three distance ranges.clear all;close all;clc%%for steps = 1:2close all;clcswitch steps case 1 figdir = 'RRPFMX'; MIMO = {'SISO','SISO','SISO','SISO','SISO','SISO'}; LARArate = [1 1 1 1 1 1]; test_resource_allocation_idx = [1 1 2 2 3 3]; case 2 figdir = 'PFmore'; MIMO = {'SISO','SISO','SISO','SISO','MRC','MRC'}; LARArate = [1 1 2 2 1 1]; test_resource_allocation_idx = [2 2 2 2 2 2];end%%loaddir = '..';UE = [4 10 4 10 4 10];RAs = {'RR','PF','MX'};tmp1 = [0 0.6667 1.0000 1.3333 2.0000 2.6667 3.0000 4.0000];xlims = {(0:2:6), [0 1/3 1/2 2/3],tmp1,tmp1 * 6 * 12 / 5e-4};datas = {'save_bs_mod','save_bs_fec','save_bs_rate','save_bs_TPblk'};datas2 = {'mods_tmp','fecs_tmp','rate_tmp'};levels = [-1e-5 30 60 inf];for file_idx = 1:6 file_idx LGD{file_idx} = [RAs{test_resource_allocation_idx(file_idx)},',UE',num2str(UE(file_idx)),',F',num2str(LARArate(file_idx)),',',MIMO{file_idx}]; filename = ['RA',num2str(test_resource_allocation_idx(file_idx)),'_UE',num2str(UE(file_idx)),'_LARA',num2str(LARArate(file_idx)),MIMO{file_idx},'.mat']; load([loaddir,'/',filename],'save_bs_mod','save_bs_fec','save_bs_dist'); mods = double(reshape(save_bs_mod,[],1)); fecs = reshape(save_bs_fec,[],1); dist = reshape(save_bs_dist,[],1); rate = double(mods) .* fecs; [dist_sort,idx] = sort(dist); mods_sort = mods(idx); fecs_sort = fecs(idx); rate_sort = rate(idx); for pt = 1:length(levels) - 1 interest_idx = find((dist_sort<levels(pt + 1)) & (dist_sort >= levels(pt))); mods_tmp = mods_sort(interest_idx); fecs_tmp = fecs_sort(interest_idx); rate_tmp = rate_sort(interest_idx); for data_idx = 1:3 tmpV = eval(datas2{data_idx}); [N{data_idx,pt,file_idx}, X{data_idx,pt,file_idx}] = hist(tmpV,xlims{data_idx}); end endendsave(['PDF_Dist',num2str(steps),'.mat'],'X','N','LGD');%%load(['PDF_Dist',num2str(steps),'.mat'],'X','N','LGD');k = 0;desps1 = {'mod','fec','rate','TPblk'};desps2 = {'Allocated Bits','Allocated Coding Rate','Allocated Rate','Per Block Throughput'};for data_idx = 1:3 for pt = 1:length(levels) - 1 clear N1 X1 for file_idx = 1:6 N1(:,file_idx) = N{data_idx,pt,file_idx}; X1(:,file_idx) = X{data_idx,pt,file_idx}; end Y = N1 ./ repmat(sum(N1,1),size(N1,1),1); k = k + 1; cfigure(k); bar(X1,Y,1);%bar3(X1(:,1),Y,1)); colors = [0.5 0.5 0.5;0 0 0;0 0.5 1;0 0 1;1 0 0.5;1 0 0]; colormap(colors); grid on; grid minor; ylim([min(min(Y)) 1.1 * max(max(Y))]); lgd = legend(LGD); set(lgd,'Location','North','FontSize',14,'Box','on','fontname','times','FontWeight','normal'); xlabel([desps2{data_idx},' Distance: ',num2str(round(levels(pt))),' m - ',num2str(round(levels(pt + 1))),' m'],'fontname','times','FontSize',14,'FontWeight','b'); ylabel(['PDF of ',desps2{data_idx}],'fontname','times','FontSize',14,'FontWeight','b'); figname{data_idx} = ['PDF_of_',desps1{data_idx},'_part',num2str(pt)]; savefigs(figname{data_idx},figdir); endendend
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -