⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nco_gen.m

📁 包括载波跟踪和伪码相位跟踪
💻 M
字号:
%%NCO数据,用于下变频
function [NCO_I_Quanti,NCO_Q_Quanti]=Nco_gen(Ts,fi,fd_estimate,N)
%------------------------ 载波NCO的计算---------------------%
    %%%%%% 载波NCO参数设定
    Accumu_Bit = 32;            % 相位累积器的位数
    factor = 2^Accumu_Bit;      % 基准频率对应的频率字
    scaled_factor = factor*Ts;  % 单位频率对应的频率
    A_NCO = 1;                  % 载波NCO的幅度
    NCO_Bit = 10;               % NCO量化位数10位
    NCO_L = 2^(NCO_Bit-1); 
    NCO_Step = 1/NCO_L;   
    f_ref = fi + fd_estimate; 
   
    %%%%%% 载波NCO计算
    Freq_Word = floor(f_ref * scaled_factor);                        % 某一个搜索频率点所对应的载波NCO的频率字
     Accumulator=0;
    for n=1:N
         Accumulator = Accumulator+Freq_Word;
         Accumulator = mod(Accumulator,factor);
         %-----高十位查找表
         % 实际送入查找表的是高10位,低22位被砍掉了 fix 表示截取高位
         lookup_index = floor(Accumulator/2^22);
         NCO_I_Quanti(n) = round(cos(2*pi*lookup_index/2^10)*2^9);
         NCO_Q_Quanti(n) = round(sin(2*pi*lookup_index/2^10)*2^9);
    end
    NCO_I_Quanti(find(NCO_L == NCO_I_Quanti)) = NCO_L - 1;
    NCO_Q_Quanti(find(NCO_L == NCO_Q_Quanti)) = NCO_L - 1;
    
   

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -