www.pudn.com > tryGUI.rar > MRC_Rake.m


function yn=MRC_Rake(Tao,Atten,rt,Dg,Tf,Ts,Num_Data,PN_code,ref_st) 
%Tao--------path delays 
%Atten------path attenuations 
%rt---------received multipath signal 
%Num_Data---表示未扩频的数据个数 
%Tf---------frame duation 
%Ts---------sample period 
%Dg----pulse duation 
%ef_st---------local reference pulse,含占空比的波形,持续时间为Tf。 
%算法是先将多径对齐合并,再相关接收 
n_path=length(Tao);%the number of multipath 
com_wei=Atten./sum(Atten.*Atten);%the weigth values to be combined  
PN_len=length(PN_code); 
cor_st=reshape(ref_st'*PN_code,1,[]); 
cor_len=length(cor_st); 
Total_samples=Num_Data*cor_len; 
for i=1:n_path 
    rx(i,:)=com_wei(i)*rt(round(Tao(i)/Ts):(Total_samples-1)+round(Tao(i)/Ts));%对接收信号的延时进行处理 
end 
%多径合并 
if n_path>1 
    for i=1:n_path 
        for j=1:Num_Data 
            rx(i,(j-1)*cor_len+1:j*cor_len)=rx(i,(j-1)*cor_len+1:j*cor_len).*cor_st; 
        end 
    end 
    rx=sum(rx); 
else 
    for j=1:Num_Data 
            rx((j-1)*cor_len+1:j*cor_len)=rx((j-1)*cor_len+1:j*cor_len).*cor_st; 
    end 
end 
%cor_xn=xn.*St;          %correlation processing 
for j=1:Num_Data 
    int_xn(j)=Ts*sum(rx((j-1)*cor_len+1:j*cor_len));   %在一个脉冲持续时间Dg内积分 
end 
yn=int_xn>0;