资源简介
进行了中继选择的描述和仿真,和传统的中继选择算法进行比较
代码片段和文件信息
clear all;
echo off;
% Performance of Onat_Threshold Scheme
% Variable Parameters
R=3;
snrdB=[8101214161820222426];
N1=1;
N2=1;
N_l=1;
be=1;
NI=10^6;
% Model
prb_O=zeros(1length(snrdB));
numerr_O=zeros(1length(snrdB));
r=zeros(1R);
y=zeros(1R);
for i=1:10
i
SNR=exp((snrdB(i)/10)*log(10))/(R+1);
Th=log(SNR).*R/be;
%Th=log(SNR+1)./2;
for ii=1:NI
s=zeros(1R);
f=sqrt(N1./2).*(randn(1R)+j.*randn(1R));
g=sqrt(N2./2).*(randn(1R)+j.*randn(1R));
v=sqrt(1./2).*(randn(1R)+j.*randn(1R));
w=sqrt(1./2).*(randn(1R)+j.*randn(1R));
f_l=sqrt(N_l./2).*(randn(11)+j.*randn(11));
v_l=sqrt(1./2).*(randn(11)+j.*randn(11));
Mg=(f_l*f_l‘)*SNR;
y_l=SNR^(1/2)*f_l+v_l;
dy1=(y_l-SNR^(1/2)*f_l)*(y_l-SNR^(1/2)*f_l)‘;
dy2=(y_l+SNR^(1/2)*f_l)*(y_l+SNR^(1/2)*f_l)‘;
if (dy1>dy2)
s_m=-1;
else
s_m=+1;
end
for iii=1:R
Nf=((f(iii))*(f(iii))‘)*SNR;
Ng=((
评论
共有 条评论