📄 main.m
字号:
%%20080411
%%卫星导航定位理论与方法第一次作业:Matlab实现DSSS捕获;
%%伪码速率为1.023Mcps,SNR=-20dB;
%%采用BPSK调制数据,不考虑数据位的影响
%%采用FFT捕获
%%采用固定门限 门限取4.5
%%采用唐检测判决
%%平方检波,进行5次非相干积累
%%输入的中频为1.4193MHz,多普勒频率范围-9kHz至9kHz
clc
clear
global EmulateIndex; %仿真次数
EmulateIndex=0;
%%%%设置参数
[code_cycle,SNR,Ts,T,T_interp,fi,M,N,fd,f0,delay_time,fd_estimate,sigma_n,fs,Bandwidth,dot_insert,coef,coef_mod,B,A1]=set_parameter;
%%%%产生接受中频信号伪码,抽头为1,8
code_phase=[1,8];
[inputcode]=code_gen(code_phase);
%%%%本地伪码
native_code=inputcode;
%%%%产生本地伪码FFT共轭
inputcode_2=[native_code,native_code];
[Code_native_fft_conj]=code_native_fft_conj(inputcode_2,fd_estimate,T_interp,T,f0,dot_insert);
%%%%多普勒频率搜索起始频率,搜索点数,搜索间隔
fd_estimate=0e3; %多普勒频率搜索起始频率
times_estimate=37; %频率检测次数
IntervalOfFreq=0.5e3; %搜索间隔步进,多普勒频率范围为-9kHz-9kHz
[snr,acq_flag,Correl_Peak_location]=Detection_Analysize_R_pd(Bandwidth,fd,f0,SNR,sigma_n,code_cycle,times_estimate,inputcode,T_interp,T,fd_estimate,Ts,fi,N,A1,B,M,fs,IntervalOfFreq,Code_native_fft_conj,dot_insert,delay_time,coef,coef_mod,EmulateIndex);
%%%%确定捕获的多普勒频率
if(acq_flag==1)
snr= sort(snr,2,'descend');
snr=snr(:,1:4);
snr_sum=sum(snr,2);
snr_max=max(snr_sum);
snr_index=find(snr_sum==snr_max);
disp('多普勒频率为:');
fd_estimate=(-1)^snr_index*round((snr_index-1)/2)*IntervalOfFreq
disp('码相位为:');
Correl_Peak_location_real=Correl_Peak_location(snr_index)-4
else
disp('未捕获到信号');
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -