?? 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 + -