hslogic算法仿真—QPSK调制解调+costas载波同步+gardner时间同步matlab仿真
I_NCO = cos(wc_nco/Freq_Sample*((i-1-mul)*nsamp+1 : (i-1+mul)*nsamp+nsamp)+mod(NCO_Phase,2*pi));%NCO产生的I路输入信息数据
Q_NCO = - sin(wc_nco/Freq_Sample*((i-1-mul)*nsamp+1 : (i-1+mul)*nsamp+nsamp)+mod(NCO_Phase,2*pi));%NCO产生的Q路输入信息数据
I_RECE=rece((i-1-mul)*nsamp+1 : (i-1+mul)*nsamp+nsamp).*I_NCO; %I路输入信息数据
Q_RECE=rece((i-1-mul)*nsamp+1 : (i-1+mul)*nsamp+nsamp).*Q_NCO; %Q路输入信息数据
%根升余弦滤波
I_RRC_S = RRCrece(I_RECE,Freq_Data,nsamp,alpha,delay);%I路输入信息数据经过根升余弦匹配滤波
Q_RRC_S = RRCrece(Q_RECE,Freq_Data,nsamp,alpha,delay);%Q路输入信息数据经过根升余弦匹配滤波
I_PLL=I_RRC_S(delay*nsamp-nsamp/2+mul*nsamp+2+k); %鉴相器的I路输入信息数据
Q_PLL=Q_RRC_S(delay*nsamp-nsamp/2+mul*nsamp+2+k); %鉴相器的Q路输入信息数据
dataoutI((i-1)*nsamp+k) = I_PLL;%用来查看鉴相器的I路输入信息数据
dataoutQ((i-1)*nsamp+k) = Q_PLL;
%鉴相器处理
Discriminator_Out = (sign(I_PLL)*Q_PLL-sign(Q_PLL)*I_PLL)/sqrt(2);
dd((i-1)*nsamp+k) = Discriminator_Out;%用来查看鉴相器的输出
%环路滤波器处理
PLL_Phase_Part((i-1)*nsamp+k) = Discriminator_Out * C1;
Freq_Control((i-1)*nsamp+k) = PLL_Phase_Part((i-1)*nsamp+k)+PLL_Freq_Part((i-1)*nsamp+k-1);
PLL_Freq_Part((i-1)*nsamp+k) = Discriminator_Out * C2 + PLL_Freq_Part((i-1)*nsamp+k-1);
NCO_Phase = NCO_Phase + Freq_Control((i-1)*nsamp+k); %生成的相位
WC_frame((i-1)*nsamp+k) = FC_NCO + PLL_Freq_Part((i-1)*nsamp+k) * Freq_Sample;