【增量中继】基于增量中继与机会中继的协同通信的matlab仿真
1.软件版本
matlab2013b
2.系统描述
在近年来提出的协同通信方案中,机会中继(OR,Opportunistic Relaying)是比较合理和可行的一种方案。它是一种分布式的单中继方案,其独特之处在于各中间节点根据其与源节点和目的节
点之间的信道状况自行设置倒计时,通过竞争找出最佳的节点作为中继节点。它在保持了单中继方案的简单、易于实现的优点的同时达到了多中继方案的分集阶数,且在中继节点的选择上付出的代价最小。解码中继(DF,Decode and Forward)策略的OR方案Opportunistic DF(ODF)的中断概率。利用目的节点的反馈,仅在直接传输(DT,Direct Transmission)不成功时才由中继节点进行重传。这样,重传的次数大大减少,频谱效率得到有效提高。OR与IR相结合的方案——Incremental Opportunistic Decode and Forward(IODF),中继节点对于源节点的信息采用DF策略,中继节点的选择类似于OR,由各中间节点根据其与目的节点之间的信道状况设置倒计时,通过竞争分布式地完成。
DF模式的基本原理:中继节点R直接将收到的来自源节点S的信号ys,r进行解调译码,并通过某种方式校验译码是否正确,如果错误则中继不再发送该信号,如果正确,则将该信号重新编码调制,然后转发给目的节点D(基站)。在编码过程中,可以选择与源节点一样的编码方案,或者采取不同的编码方式。
所谓的机会中继DF,其重要特点突出的是机会中继,机会中继的基本含义为:即通过统计瞬时信噪比,获得最大瞬时信噪比的中继路径作为我们的转发路径。
IODF模式,即增量中继和机会中继的DF模式,基本含义为:当直接模式中断的时候,启动机会中继策略进行传输,根据上面的原理,我们进行仿真.
3.部分源码
clc;
clear;
close all;
warning off;
pack;
addpath 'func\'
Snr_1 = 0;
Snr_2 = 20;
%信号功率
Power_signal = 0.1;
Monte_Times = 1000;
M = 4; %QPSK调制
N = 1e3;%仿真bit数
%产生信号源
Signal = randint(1,N,M);
Signal_mod = modulate(modem.pskmod(M),Signal);
Index = 0;
B = 2;
for SNR_dB=Snr_1:Snr_2
SNR_dB
Index = Index+1;
ERR = 0;
for Times = 0:Monte_Times
RandStream.setDefaultStream(RandStream('mt19937ar','seed',Times));
%产生信道
%Source and Destination
H_sd = func_Rayleigh_Channel(1);
%节点1信道
H_sr1 = func_Rayleigh_Channel(1);
H_rd1 = func_Rayleigh_Channel(1);
%节点2信道
H_sr2 = func_Rayleigh_Channel(1);
H_rd2 = func_Rayleigh_Channel(1);
%节点3信道
H_sr3 = func_Rayleigh_Channel(1);
H_rd3 = func_Rayleigh_Channel(1);
%节点4信道
H_sr4 = func_Rayleigh_Channel(1);
H_rd4 = func_Rayleigh_Channel(1);
sig = 10^(SNR_dB/10);
Power_Signals = Power_signal;
Power_Niose = Power_Signals / sig;
%直接模式下不通过中继节点直接进行传输
Y_S2D = awgn(sqrt(Power_Signals)*H_sd*Signal_mod,SNR_dB);
%DT,当DT失败的时候,启动中继
y_ODFs = demodulate(modem.pskdemod(M),H_sd'*Y_S2D);
%判断是否接受成功
T = func_check(Signal,y_ODFs);
if T < 1;%接受成功
y_ODF = y_ODFs;
else%接收不成功,启动中继
Y_S2R1 = awgn(sqrt(Power_Signals)*H_sr1*Signal_mod,SNR_dB);
Y_S2R2 = awgn(sqrt(Power_Signals)*H_sr2*Signal_mod,SNR_dB);
Y_S2R3 = awgn(sqrt(Power_Signals)*H_sr3*Signal_mod,SNR_dB);
Y_S2R4 = awgn(sqrt(Power_Signals)*H_sr4*Signal_mod,SNR_dB);
Y_S2R = [Y_S2R1;Y_S2R2;Y_S2R3;Y_S2R4];
H_sr = [H_sr1 H_sr2 H_sr3 H_sr4];
H_rd = [H_rd1 H_rd2 H_rd3 H_rd4];
%选瞬时信噪比最大的座位转发中继
R1 = SNR_dB*(abs(H_sr1))^2;
R2 = SNR_dB*(abs(H_sr2))^2;
R3 = SNR_dB*(abs(H_sr3))^2;
R4 = SNR_dB*(abs(H_sr4))^2;
R = [R1 R2 R3 R4];
[V,I] = max(R);
Y_S2RO = Y_S2R(I,:);
H_rdO = H_rd(I);
H_srO = H_sr(I);
%ODF
x_ODF = func_ODF(M,Y_S2RO,Signal);
y_rd = awgn( sqrt(2)*H_rdO * x_ODF, SNR_dB);
y_combine_ODF = func_MRC(H_sd,H_rdO,Power_Signals,Power_Niose,Y_S2D,y_rd);
y_ODF = demodulate(modem.pskdemod(M),y_combine_ODF);
H = abs(H_srO)*abs(H_rdO);
end
%计算速率
Rs(Times+1) = 0.5*B*log2(abs(H*sig)/10+1);
end
Rate(Index) = mean(Rs);
end
SNR_dB = Snr_1:1:Snr_2;
figure;
plot(SNR_dB,Rate,'r-o');
grid on;
ylabel('Rate');
xlabel('SNR(dB)');
axis([Snr_1,Snr_2,0,6]);
save IODF4.mat SNR_dB Rate
4.仿真结论
A01-65