您好,欢迎来到华佗小知识。
搜索
您的当前位置:首页数字锁相环参数设计与仿真

数字锁相环参数设计与仿真

来源:华佗小知识
%%***********************************************% % author: sjqian % date: 2013 07 17 % description: %**************************************************** %*************system initial************************* clc; clear all; close all; Legtick=['g-o';'k-x';'b-v';'r-o';'m-x';'c-v';'r-s';'y-v';'g-s';'k-x';'b-o';]; adB=10; Qb=10; % generate input signal f=100; fs=400; Ts=1/fs; N=10;% depth of lookuptable resulution=fs/(2^N); freqCon=round(f/resulution); Kd=2^(adB+Qb); K0=2*pi/(2^N); loop=1; BL=10; BWacq=0.42*BL; wn=BL/0.53; Tacq=1.2/BL/Ts; Gain=Kd*K0; zeta=sqrt(2)/2; c1=2*zeta*wn*Ts/Gain; c2=(wn*Ts)^2/Gain; t=0/fs:1/fs:2; fmod=f+BWacq; a=2^adB*sin(2*pi*fmod*t+pi/6)+10*randn(1,length(t)); a=round(a); b=zeros(1,length(a)); index=(0:2^N-1)/(2^N); table=round(2^Qb*sin(2*pi*index)); phaseindex=freqCon+1; b(1)=table(1);b(2)=table(freqCon+1); path2(1)=0; for i=2:length(t) dp(i)=a(i-1)*b(i)-a(i)*b(i-1); path1=c1*dp(i); path2(i)=path2(i-1)+c2*dp(i); phaseindex=phaseindex+freqCon+path1+path2(i); phaseindex=mod(round(phaseindex),2^N); b(i+1)=table(phaseindex+1); end figure; plot(a); hold on; plot(b,'r'); title('timing waveform'); grid on; figure; plot(dp); stit=sprintf('phase detector output,converge time=%d point',Tacq); title(stit); grid on; figure; plot(path2*resulution); title({'frequency offset estimation value ',num2str(BWacq)});

Published with MATLAB® R2013a

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- huatuo0.cn 版权所有 湘ICP备2023017654号-2

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务