PLL.zip

  • PUDN用户
    了解作者
  • matlab
    开发工具
  • 1KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 9
    下载次数
  • 2011-06-24 13:54
    上传日期
Performance of Phase Lock Loop in fading channel
PLL.zip
  • PLL
  • deeppll02.m
    2.9KB
内容介绍
samp=400; X = (floor(2*rand(1,400))-0.5)/0.5 + i*(floor(2*rand(1,400))-0.5)/0.5 ; h=rcosine(1,4,'sqrt',0.5,6); %%%%%%%% NYQUIST FILTER h1=h/max(h); hh=reshape([h1 0 0 0],4,13); reg=zeros(1,13); m=1; for n = 1:400; reg = [X(n) reg(1:12)]; x2(m) = reg*hh(1,:)'; x2(m+1) = reg*hh(2,:)'; x2(m+2) = reg*hh(3,:)'; x2(m+3) = reg*hh(4,:)'; m = m + 4; end figure; subplot(2,1,1); plot(x2(1:4:1600),'rx'); title('constellation diagram after nyquist filter'); grid on; axis([-2 2 -2 2]); subplot(2,1,2); plot(0,0); hold on; for n=1:8:1600-8 plot(-1:1/4:1,x2(n:n+8)) end hold off; title('eye diagram after nyquist filter'); grid on; ch=awgn(x2,38); x3=x2*exp(j*2*pi/20); figure; subplot(2,1,1); plot(x3(1:4:1600),'rx'); title('constellation diagram after spinning'); grid on; axis([-2 2 -2 2]); subplot(2,1,2); plot(0,0); hold on; for n=1:8:1600-8 plot(-1:1/4:1,x3(n:n+8)) end hold off; title('eye diagram after spinning'); grid on; scale=h1*h1'; h2=h1/scale; if rem(size(h2,2),4) ~=0 h2 =[h2 zeros(1,4-rem(size(h2,2),4))]; end theta=2*pi/500; eta=sqrt(2)/2; kp = (4*eta*theta)/((theta^2)+2*eta*theta+1); ki = (4*theta*theta)/((theta^2)+2*eta*theta+1); reg1 = zeros(1,1); reg2 = zeros(1,52); dphi_hold = 0; add = 0; for n=1:4:4*samp for m=0:3 derr(m+n) = exp(-j*reg1*2*pi); x4 = x3(n+m)*derr(m+n); reg2 = [x4 reg2(1:51)]; x4a(n+m) = x4; x5 = reg2*h2'; x5a(m+n) = x5; reg1 = reg1+dphi_hold; reg1_a(m+n) = reg1; end %%%%%%% detector x6(n) = x5a(n); x_det_r=sign(real(x6(n))); if abs(real(x6(n)))<2/3 x_det_r=x_det_r*1/3; end x_det_i=sign(imag(x6(n))); if abs(imag(x6(n)))<2/3 x_det_i=x_det_i*1/3; end x_det=x_det_r+j*x_det_i; x_prod=x_det*conj(x6(n)); %%%%%% ATAN error=-angle(x_prod)/(2*pi); phase_err(n)=error; %%%%%%% Loop Filter add=add+ki*error; dphi=add+kp*error; loop_fil(n)=dphi; dphi_hold=dphi; end figure; subplot(2,1,1); plot(x5a(1:4:1600),'o'); hold on; plot(x5a(100+1:4:1600),'ro'); title (' Constellation after Matched filter'); hold off; grid; subplot(2,1,2); plot(0,0); hold on for n=1:8:1600-8 plot(-1:1/4:1,real(x5a(n:n+8))); end hold off grid on title('Eye diagram of matched filter ') %%%%%%%%%%%%%%%%%%%% PART--E %%%%%%%%%%%%%%%%%%%%%% %Loop Filter Output figure; subplot(2,1,1); plot(loop_fil(1:4:1600)); title ('Loop Filter Output'); xlabel('Time (samples)'); ylabel('Error'); grid; %Phase error Output subplot(2,1,2); plot(phase_err(1:4:1600)); title ('Phase error Output'); xlabel('Time (samples)'); ylabel('Error'); grid;
评论
    相关推荐
    • pll.rar
      Freescale K60 PLL时钟配置 各种PLL模式之间转换
    • Taiwan-University-PLL-lecture-.rar
      台湾大学PLL讲义讲稿 讲稿里包括Phase-Locked Loops的工作方式,简化模型,仿真图及其应用。
    • PLL.rar
      飞思卡尔单片机编程,涉及到里面的PLL模块编程,能够直接调用
    • c51_pll.rar
      C51IC,锁相环MC145151-2集成电路完整资料,对研究PLL编程很有帮助,好好理解,事倍功半.
    • PLL.zip
      lpc2378嵌入式的PLL例程,可以直接运行,共4个小例子,大家可以尝试下!
    • PLL and Grid Synchronization.rar
      phase lock loops (PLL) controled sytem
    • pll_sweep_lock_test_medium.rar
      软件锁相环摆脱了模拟锁相环和数字锁相环中复杂的硬件电路设计和器件的非线性对跟踪精度的影响 ,具有结构简单、参数设计灵活等优点。利用软件方式实现信号处理 ,使软件锁相环比硬件锁相环具有更好的灵活性和通用性。...
    • PLL_on_C2000_by_DQ_3ph.zip
      this is a 3 phase PLL program
    • PLL_on_C2000_by_DQ.zip
      this is a PLL of sine inverter program
    • matlabcnhelp.rar
      matlab中文帮助很难找的,快速下载