91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 402KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-23
  • 語言: Matlab
  • 標簽: matlab程序??

資源簡介

詳細介紹了鎖相環的原理,并給出了一個基于matlab的仿真程序,對理解鎖相環的原理非常有用!

資源截圖

代碼片段和文件信息

%頻偏:-60Hz
%相偏:在0--2*pi內隨機分布
%QQ:22069605
%程序及結果如下:
clear?all;
close?all;
%定義鎖相環的工作模式:單載波為“1”、BPSK調制為“2”、QPSK調制為“3”
PLL_Mode?=?1;
%仿真數據長度
Simulation_Length=1000;
%基帶信號
if?PLL_Mode?==?1
I_Data=ones(Simulation_Length1);
Q_Data=I_Data;
else?if?PLL_Mode?==?2
I_Data=randint(Simulation_Length1)*2-1;
Q_Data=zeros(Simulation_Length1);
else
I_Data=randint(Simulation_Length1)*2-1;
Q_Data=randint(Simulation_Length1)*2-1;
end
end
Signal_Source=I_Data?+?j*Q_Data;
%載波信號
Freq_Sample=2400;%采樣率,Hz
Delta_Freq=-60;?%頻偏,Hz
Time_Sample=1/Freq_Sample;
Delta_Phase=rand(1)*2*pi;?%隨機初相,Rad
Carrier=exp(j*(Delta_Freq/Freq_Sample*(1:Simulation_Length)+Delta_Phase));
%調制處理
Signal_Channel=Signal_Source.*Carrier‘;
snr=20;
Signal_Channel=awgn(Signal_Channelsnr‘measured‘);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%以下為鎖相環處理過程
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%參數清零
Signal_PLL=zeros(Simulation_Length1);
NCO_Phase?=?zeros(Simulation_Length1);
Discriminator_Out=zeros(Simulation_Length1);
Freq_Control=zeros(Simulation_Length1);
PLL_Phase_Part=zeros(Simulation_Length1);
PLL_Freq_Part=zeros(Simulation_Length1);
%環路處理
C1=0.022013;
C2=0.00024722;
for?i=2:Simulation_Length
Signal_PLL(i)=Signal_Channel(i)*exp(-j*mod(NCO_Phase(i-1)2*pi));
I_PLL(i)=real(Signal_PLL(i));
Q_PLL(i)=imag(Signal_PLL(i));
if?PLL_Mode?==?1
Discriminator_Out(i)=atan2(Q_PLL(i)I_PLL(i));
else?if?PLL_Mode?==?2
Discriminator_Out(i)=sign(I_PLL(i))*Q_PLL(i)/abs(Signal_PLL(i));
else
Discriminator_Out(i)=(sign(I_PLL(i))*Q_PLL(i)-sign(Q_PLL(i))*I_PLL(i))...
/(sqrt(2)*abs(Signal_PLL(i)));
end
end
PLL_Phase_Part(i)=Discriminator_Out(i)*C1;
Freq_Control(i)=PLL_Phase_Part(i)+PLL_Freq_Part(i-1);
PLL_Freq_Part(i)=Discriminator_Out(i)*C2+PLL_Freq_Part(i-1);
NCO_Phase(i)=NCO_Phase(i-1)+Freq_Control(i);
end
%畫圖顯示結果
figure
subplot(221)
plot(-PLL_Freq_Part(2:Simulation_Length)*Freq_Sample);
grid?on;
title(‘鎖相環頻率響應曲線‘);
axis([1?Simulation_Length?-100?100]);
subplot(222)
plot(PLL_Phase_Part(2:Simulation_Length)*180/pi);
title(‘鎖相環相位響應曲線‘);
axis([1?Simulation_Length?-2?2]);
grid?on;
%設定顯示范圍
Show_D=300;?%起始位置
Show_U=900;?%終止位置
Show_Length=Show_U-Show_D;
subplot(223)
plot(Signal_Channel(Show_D:Show_U)‘*‘);
title(‘進入鎖相環的數據星座圖‘);
axis([-2?2?-2?2]);
grid?on;
hold?on;
subplot(223)
plot(Signal_PLL(Show_D:Show_U)‘r*‘);
grid?on;
subplot(224)
plot(Signal_PLL(Show_D:Show_U)‘r*‘);
title(‘鎖相環鎖定及穩定后的數據星座圖‘);
axis([-2?2?-2?2]);
grid?on;

figure
%設定顯示范圍
Show_D=300;?%起始位置
Show_U=350;?%終止位置
Show_Length=Show_U-Show_D;
subplot(221)
plot(I_Data(Show_D:Show_U));
grid?on;
title(‘I路信息數據‘);
axis([1?Show_Length?-2?2]);
subplot(222)
plot(Q_Data(Show_D:Show_U));
grid?on;
title(‘Q路信息數據‘);
axis([1?Show_Length?-2?2]);
subplot(223)
plot(I_PLL(Show_D:Show_U));
grid?on;
title(‘鎖相環輸出I路信息數據‘);
axis([1?Show_Length?-2?2]);
subplot(224)
plot(Q_PLL(Show_D:Show_U));
grid?on;
title(‘鎖相環輸出Q路信息數據‘);
a

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2011-11-02?16:44??PLL\
?????文件????????3237??2011-10-26?11:10??PLL\PLL.m
?????文件??????452172??2011-10-26?14:43??PLL\鎖相環原理.pdf

評論

共有 條評論