clc;
clear;
close all;
warning off;
RandStream.setDefaultStream(RandStream.create('mt19937ar','seed',1));
%定义2*2天线
M = 2;
N = 2;
% Pt = 14;%发射功率
% Gt = 64;%发送天线的增益
% Gr = 64;%接收天线的增益
% R = 0.6;%小区半径
% Phatloss = 128.1 + 37.6*log10(R);%路径损耗
% Shadowfading = 8;%阴影衰落
% PN = 5;%噪声功率
% SNRs = Pt + Gt + Gr - Phatloss - Shadowfading - PN;
SNRs = 10;
tc = 10;
Num_user = 24;
sel = 1;%1,2,3,4,选择四种不同的方法进行仿真
sel2 = 0;%0直接出图,1进行逐个仿真
if sel2 == 1
for j=1:Num_user
j
%计算第一个用户的相关值
In_index = zeros(1,10*j);
though_Output = zeros(1,10*j);
though_Input = zeros(1,10*j);
SNR = SNRs*rand(1,10*j);
%调用调度函数
if sel == 1
[H,number] = func_No_Scheduling(10*j,M,N);
end
if sel == 2
[H,number] = func_Random_Paring_Scheduling(10*j,M,N);
end
if sel == 3
[H,number] = func_Orthogonal_Paring_Scheduling(10*j,M,N);
end
if sel == 4
[H,number] = func_Determinant_Paring_Scheduling(10*j,M,N);
end
%基于MMSE的接收
[M,Nes] = func_MMSE_receiver(H,SNR(number));
sirer = zeros(1,10*j);
sirer(number) = log2(1+Nes);
[though_Output,indexout,uenow]=func_calc(sirer,though_Input,tc,In_index,number);
though_Input = though_Output;
In_index = indexout;
S(1) = sum(log2(1+Nes));
%计算其余用户的相关值
for k=2:10*j
M = 2;
H = zeros();
%调用调度函数
if sel == 1
[H,number] = func_No_Scheduling(10*j,M,N);
end
if sel == 2
[H,number] = func_Random_Paring_Scheduling(10*j,M,N);
end
if sel == 3
[H,number] = func_Orthogonal_Paring_Scheduling(10*j,M,N);
end
if sel == 4
[H,number] = func_Determinant_Paring_Scheduling(10*j,M,N);
end
%基于MMSE的接收
[M,Nes] = func_MMSE_receiver(H,SNR(number));
sirer = zeros(1,10*j);
sirer(number) = log2(1+Nes);
[though_Output,indexout,uenow]=func_calc(sirer,though_Input,tc,In_index,number);
though_Input = though_Output;
In_index = indexout;
S(k) = sum(log2(1+Nes));
end
fair(j) = sum(though_Output)^2/(length(though_Output)*sum(though_Output.^2));
%计算信道容量
SNR_Linear = 10^(SNRs/10);
Capacity(j) = 0.5 * log10(1 + (SNR_Linear * sum(abs(fair(j)))));
end
%根据信道容量计算CDF值
CDFs=func_CDF(Capacity,Num_user);
if sel == 1
save data0.mat CDFs
end
if sel == 2
save data1.mat CDFs
end
if sel == 3
save data2.mat CDFs
end
if sel == 4
save data3.mat CDFs
end
else
load data0.mat
figure
plot(1:0.5:12,CDFs,'k','LineWidth',2);grid on
hold on;
load data1.mat
plot(1:0.5:12,CDFs,'b','LineWidth',2);grid on
hold on;
load data2.mat
plot(1:0.5:12,CDFs,'r','LineWidth',2);grid on
hold on;
load data3.mat
plot(1:0.5:12,CDFs,'g','LineWidth',2);grid on
hold on;
axis([1,12,0,1]);
legend('Receive Diverse','Random Pairing','Orthogonal Pairing','Determinant Pairing');
xlabel('Thoughout');
ylabel('CDF');
end
这里,主要是对论文最后的四个图进行仿真,下面一一对四个图的仿真进行介绍:
Figure3:
下面在MATLAB中给出这个图的仿真:
从上面的仿真结果可以看到,采用行列式配对的方法后的系统容量大于采用正交配对后的系统容量大于随机配对后的信道容量,而直接传输方法的系统容量最小。
Figure4:
下面在MATLAB中给出这个图的仿真及对应的分析:
从上面的仿真结果可以看到,配对的PF方法的容量大于配对的RR方法的容量大于一般PF方法大于一般RR方法。
Figure5:
下面在MATLAB中给出这个图的仿真及对应的分析:
从上面的仿真结果可知,当用户到达率标高的时候,PF算法具有最大的丢包率,其次为RR算法,然后是配对后的PF算法,配对后的RR算法丢包率最低。
Figure6:
下面在MATLAB中给出这个图的仿真及对应的分析:
从上面的仿真结果可知,采用全配对的方法,可以获得较大的数据吞吐量,但是其数据丢失率也较大,所以设计了基于SINR的配对算法,这样可以根据实际的噪声等干扰因素的影响来进行合理的配对。由于仿真较慢,所以仿真的点数较少,所以看起来不是很平滑。
A01-39