?? ex9_12.asv
字號(hào):
clear all;
close all;
clc;
%%%%%%%%%%%%%%%產(chǎn)生雷達(dá)發(fā)射信號(hào)%%%%%%%%%%%%%%%%%%
code=[1,1,1,1,1,-1,-1,1,1,-1,1,-1,1]; %13位巴克碼
tao=0.5e-6;%脈沖寬度10us
f0=10e6;
fs=40e6; %采樣頻率l00MHz
ts=1/fs;
t_tao=0:1/fs:tao-1/fs;
n=length(code);
N=length(t_tao);
pha=0;
t=0:1/fs:13*tao-1/fs;
s=zeros(1,length(t));
for i=1:n;
if code(i)==1
pha=pi;
else pha=0;
end
s(1,(i-1)*N+1:i*N)=cos(2*pi*f0*t_tao+pha);
end
figure(1),subplot(2,1,1),plot(t,s),xlabel(‘t(單位:s)’),title(‘混合調(diào)制信號(hào)(13位巴克碼+線性調(diào)頻)’);
s_fft_result=abs(fft(s(1:N)));
subplot(2,1,2),plot((0:fs/N:fs/2-fs/N),abs(s_fft_result(1:N/2))),xlabel(‘頻率(單位:Hz)’),title(‘碼內(nèi)信號(hào)頻譜’);
%___________正交解調(diào)_________________%
N=length(t);
n=0:N-1;
local_oscillator_i=cos(n*f0/fs*2*pi);%i路本振信號(hào)
local_oscillator_q=sin(n*f0/fs*2*pi);%q路本振信號(hào)
fbb_i=local_oscillator_i.*s;%i路解調(diào)
fbb_q=local_oscillator_q.*s;%q路解調(diào)
window=chebwin(51,40);
[b,a]=fir1(50, 0.5,window);
fbb_i=[fbb_i,zeros(1,25)];
fbb_q=[fbb_q,zeros(1,25)];
fbb_i=filter(b,a,fbb_i);
fbb_q=filter(b,a,fbb_q);
fbb_i=fbb_i(26:end);%截取有效倍息
fbb_q=fbb_q(26:end);%截取有效信息
fbb=fbb_i+j*fbb_q;
%--------產(chǎn)生理想線性調(diào)頻脈沖壓縮匹配系數(shù)--------%
M=131072;%因?yàn)榛夭ㄐ盘?hào)數(shù)據(jù)長度為3600點(diǎn),所以利用FFT,做4096點(diǎn)FFT
t1=100e-6;
t=tao*length(code);
match_filter=2*ts*fliplr(conj(fbb))*2/t;
match_filter_fft=fft(match_filter,M);%第-次脈沖壓縮處理匹配系數(shù)
figure(2),
subplot(2,1,1),plot(real(match_filter_fft)),title(‘脈沖壓縮系數(shù)(實(shí)部)’);
subplot(2,1,2),plot(imag(match_filter_fft)),title(‘脈沖壓縮系數(shù)(虛部)’);
%%%%%%產(chǎn)生理想點(diǎn)目標(biāo)回波信號(hào)%%%%%%%%
signal=[zeros(1,(t1-2*t)/ts),s,zeros(1,t/ts)];
%%%%% 正交解調(diào)%%%%%
N=length(signal);
n=0:N-1;
local_oscillator_i=cos(n*f0/fs*2*pi);%i路本振信號(hào)
local_oscillator_q=sin(n*f0/fs*2*pi);%q路本振信號(hào)
fbb_i=local_oscillator_i.*signal;%i路解調(diào)
fbb_q=local_oscillator_q.*signal;%q路解調(diào)
window=chebwin(51,40);%這是采用50階cheby窗的FIR低通濾波器
[b,a]=fir1(50, 0.5,window);
fbb_i=[fbb_i,zeros(1,25)];
fbb_q=[fbb_q,zeros(1,25)];
fbb_i=filter(b,a,fbb_i);
fbb_q=filter(b,a,fbb_q);
fbb_i=fbb_i(26:end);%截取有效倍息
fbb_q=fbb_q(26:end);%截取有效信息
signal=fbb_i+j*fbb_q;
clear fbb_i;
clear fbb_q;
%%%%%%%%%%%脈壓處理%%%%%%%%%%
signal_fft=fft(signal,M);
pc_result_fft=signal_fft.*match_filter_fft;
pc_result=ifft(pc_result_fft,M);
figure(3),
subplot(2,1,1),plot((0:ts:t1-ts),signal),xlabel(‘時(shí)間,單位:s’),
title(‘回波信號(hào)(解調(diào)后)’);
subplot(2,1,2),plot((0:ts:length(signal)*ts-ts),abs(pc_result(1:length(signal)))),
xlabel(‘時(shí)間,單位:s’),
title(‘回波脈沖壓縮處理結(jié)果’);
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -