• 大小: 673KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-12
  • 语言: 其他
  • 标签: algorithm  

资源简介

Selection-algorithm中继选择算法

资源截图

代码片段和文件信息

clear all;
echo off;

% Variable Parameters

R=3;

snrdB=[8101214161820222426];

N1=1;

N2=1;

N_l=1;

be=2;

al=1;

c1=(4/be)/N1;

c2=(4/be)/N2;

c_l=(4/be)/N_l;


NI=6*10^6;

% Model 

prb_TM=zeros(1length(snrdB));

numerr_TM=zeros(1length(snrdB));

r=zeros(1R);
y=zeros(1R);

for i=10:10
     i
     SNR=exp((snrdB(i)/10)*log(10))/(R+1); 
     
    %Th1=c1*log(SNR)*N1;
    %Th2=c2*log(SNR)*N2;
    %Th_l=c_l*log(SNR)*N_l;
   
     
     Th1=c1*log(1+SNR)*N1/4;
     Th2=c2*log(1+SNR)*N2/4;
     Th_l=c_l*log(1+SNR)*N_l/4;
    
     for ii=1:NI
        
         
          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));
         y_l=SNR^(1/2)*f_l+v_l;
         
         un=0;
         MC1=0;
         MC2=0;
         
         Nf_l=((f_l)*(f_l)‘)*SNR;
         
         s_l=0;
          
         if ((Nf_l>Th_l))   
               
            un=un+1;
     
              MC1=y_l*SNR^(1/2)*(f_l)‘-Nf_l;
              MC2=y_l*SNR^(1/2)*(f_l)‘+Nf_l; 
              
         end
          
          
          
          s=zeros(1R);
          
   
          for iii=1:R
              
            Nf=((f(iii))*(f(iii))‘)*SNR;
            Ng=((g(iii)).*(g(iii))‘)*SNR;
              
           if ((Nf>Th1)& (Ng>Th2))   
               
              un=un+1;
              
              r(iii)=SNR^(1/2)*f(iii)+v(iii);
              dr1=(r(iii)-SNR^(1/2)*f(iii))*(r(iii)-SNR^(1/2)*f(iii))‘;
              dr2=(r(iii)+SNR^(1/2)*f(iii))*(r(iii)+SNR^(1/2)*f(iii))‘;
           
               if (dr1>dr2)
           
                  s(iii)=-1;
           
               else
               
                  s(iii)=+1;
           
               end;    

               y(iii)=SNR^(1/2)*g(iii)*s(iii)+w(iii);          
                
               
                MC1= MC1+y(iii)*SNR^(1/2)*(g(iii))‘-Ng;
                MC2= MC2+y(iii)*SNR^(1/2)*(g(iii))‘+Ng;
              
               
           end;        
  
     end; 
         
           
              MRC1=MC1*MC1‘;
              MRC2=MC2*MC2‘;
                        
             if (MRC2                 
                   numerr_TM(i)=numerr_TM(i)+1;
               
                 else 
                 
                if (MRC2==MRC1)
                   numerr_TM(i)=numerr_TM(i)+1/2;    
                 end;
               
             end;                      
                
                       
        
        
           
     end; 
     
end;


prb_TM=numerr_TM/NI;

format short e; 

prb_TM

%  Curve-Drawin

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       3109  2010-12-03 19:07  Research on relay selection algorithm in cooperative wireless Networks\MRC_Scheme.m

     文件       2672  2010-12-03 19:07  Research on relay selection algorithm in cooperative wireless Networks\Onat_Scheme.m

     文件         54  2010-12-03 19:07  Research on relay selection algorithm in cooperative wireless Networks\qfunc.m

     文件        154  2010-12-03 19:07  Research on relay selection algorithm in cooperative wireless Networks\SNR_eq.m

     文件     358945  2010-12-03 19:08  Research on relay selection algorithm in cooperative wireless Networks\Wang1.pdf

     文件     447591  2010-12-03 19:09  Research on relay selection algorithm in cooperative wireless Networks\Wang2.pdf

     文件       2615  2010-12-03 19:09  Research on relay selection algorithm in cooperative wireless Networks\Wang_Scheme.m

     目录          0  2011-03-13 09:40  Research on relay selection algorithm in cooperative wireless Networks

----------- ---------  ---------- -----  ----

               815140                    8


评论

共有 条评论