资源描述:
《利用锁相环实现载波同步》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、利用锁相环实现载波同步一:实验目的:利用matlab验证锁相环实现载波同步的原理和方法。二:实验要求:设输入已调信号为FM信号,该调频信号由100Hz的消息正选拨调制1kHz的载频而成。试用锁相环从已调信号中提取载波信号,实现载波同步。三:实验原理:FM调制原理:FM是由基带信号来调制载波信号的角频率,使其随基带信号线性变化;锁相环提取载波原理:环路滤波器LF入信号VCO出U0(t)鉴相器PD压控振荡器VCO四:实验源码:clearall;closeall;f=1000;%Carrierfs=100000;%SamplefrequencyN=5000;%Number
2、ofsamplesTs=1/fs;t=(0:Ts:(N*Ts)-Ts);%Createthemessagesignalf1=100;%Modelatingfrequencymsg=sin(2*pi*f1*t);kf=.0628;%Modulationindex%CreatetherealandimaginarypartsofaCWmodulatedcarriertobetracked.Signal=exp(j*(2*pi*f*t+2*pi*kf*cumsum(msg)));%ModulatedcarrierSignal1=exp(j*(2*pi*f*t));%Unm
3、odulatedcarrier%InitilizePLLLoopphi_hat(1)=30;e(1)=0;phd_output(1)=0;vco(1)=0;%DefineLoopFilterparameters(Setsdamping)kp=0.15;%Proportionalconstantki=0.1;%Integratorconstant%PLLimplementationforn=2:length(Signal)vco(n)=conj(exp(j*(2*pi*n*f/fs+phi_hat(n-1))));%%ComputeVCOphd_output(n)=i
4、mag(Signal(n)*vco(n));%ComplexmultiplyVCOxSignalinpute(n)=e(n-1)+(kp+ki)*phd_output(n)-ki*phd_output(n-1);%Filterintegratorphi_hat(n)=phi_hat(n-1)+e(n);%UpdateVCOend;%Plotwaveformsstartplot=1;endplot=1000;figure(1);subplot(3,2,1);plot(t(startplot:endplot),msg(startplot:endplot));title(
5、'消息信号(频率100Hz)');%xlable(‘Time(seconds)’);ylabel('幅度');grid;figure(1);subplot(3,2,2);plot(t(startplot:endplot),real(Signal(startplot:endplot)));title('FM已调信号(用100Hz的消息信号调制1KHz的载波)');%xlable(‘Time(seconds)’);ylabel('幅度');grid;figure(1)subplot(3,2,3);plot(t(startplot:endplot),e(startplot
6、:endplot));title('环路虑波器的输出');ylabel('幅度');grid;subplot(3,2,4);plot(t(startplot:endplot),real(vco(startplot:endplot)));title('压控振荡器的输出');xlabel('Time(seconds)');ylabel('幅度');grid;subplot(3,2,5);plot(t(startplot:endplot),phd_output(startplot:endplot));title('鉴相器的输出');xlabel('Time(seconds
7、)');ylabel('幅度');grid;subplot(3,2,6);plot(t(startplot:endplot),real(Signal1(startplot:endplot)));title('载波(频率1kHz)');xlabel('Time(seconds)');ylabel('幅度');grid;五:实验结果及分析:消息信号是一个单音频信号见subplot(3,2,1),由它来调制载波得已调信号见subplot(3,2,2),锁相环从已调信号中提取载波信号,见subplot(3,2,5)是与载波同频同相的本地载波。