📄 pulsecompression_demo_fxj.m
字号:
% function pulsecompression_demo
% 分析LFM信号在不同距离时的脉压性能
% 不考虑噪声因素
% 结论:时延不会改变信号的幅度频谱,因此无论目标的远近,匹配滤波输出的峰值都是一样的。
% (匹配滤波即相关,可放在频域中完成,由于不同时延的回波的频谱一样,都和匹配滤波器的频谱重合,因此都能完全脉压)
% 2007-05-29
% Copyright (c) fuxiongjun 2007-2009
close all;
clear all;
cj=sqrt(-1);
c=3e8; % Propagation speed
pi2=2*pi;
ntarget=2;
% 参数设置
fc = 30e6; % 载频 central frequency
wc=pi2*fc;
B = 2e6; % chirp带宽
fs=80e6; % 采样率 sample frequency
Ts =1/fs;
Tp = 5e-6; % 脉宽,s
t0 = -Tp/2 : 1/fs : Tp/2-1/fs; % 时间刻度
Prt=30e-6; % 脉冲重复周期
k = B/ Tp
A=1; % LFM信号幅度
renta=c/fc;
Number=length(t0); % 一个LFM信号内的采样点数
freq=(fs/Number).*(0:Number-1); % 频率刻度, Hz
Xc=2.e3; % 设定参考点与雷达的绝对距离(采样波门起始位置)Reference point lacation, the start of sampling gate
distance=[100 375]; % 设定ntarget个目标与参考点的距离,必须>0。Distance between the target i and reference point (must >=0)
fn=1*ones(1,ntarget); % scatterer strenth
XObj(1)=Xc+distance(1); % Range distance of target 1 (m)
XObj(2)=Xc+distance(2); % Range distance of target 2 (m)
Xc0=Xc;
Xend=Xc0+max(distance)+Tp/4; % the farest distance among all the target, 多给出1/4个脉宽的接收距离(时间),作为裕量
Tstart=2*Xc/c; % Start time of sampling, absolute time雷达开始采样时的距离是本身距离的两倍
Tf=2*Xend/c+Tp; % End time of sampling , absolute time
% Measurement parameters
n=round((Tf-Tstart)/Ts); % Number of time samples
t=Tstart+(0:n-1)*Ts; % Time array for data acquisition, absolute time
td0=t-2*Xc/c; % 匹配滤波器位置在Xc处
weightingwindow1=[ones(1,length(t0)) zeros(1,n-length(t0))];%窗
s0=exp(cj*2*pi*(fc.*td0+0.5*k.*td0.^2)).*weightingwindow1;
% Baseband conversion
sb0=s0.*exp(-cj*wc*t);
sb0tmp=sb0;
sb0tmp=sb0tmp(1:length(t0));
sb0_matchfilter=conj(fliplr(sb0tmp));
s=zeros(1,n); % Initialize echoed signal array
sb=zeros(1,n);
fsb=zeros(1,n+length(t0)-1);
fsmb=zeros(1,n+length(t0)-1);
smb=zeros(1,n+length(t0)-1);
for i=1:ntarget;
td=t-2*XObj(i)/c;
LocateL=min(find(td>=0));
modify_k=1;
backwave1=i*fn(i).*exp(cj*2*pi*(fc.*td+0.5*k.*td.^2));
weightingwindow2=[zeros(1,LocateL-modify_k) ones(1,length(t0)) zeros(1,n-LocateL+modify_k-length(t0))];
s=s+backwave1.*weightingwindow2;
end;
sb=s.*exp(-cj*wc*t);
smb=conv(sb0_matchfilter,sb);
counter=5;
figure(counter);
xx=linspace(1,n+length(t0)-1,n+length(t0)-1);
xt=(xx-1).*Ts-(length(t0)-1)*Ts;
Rx=xt.*c/2;
smbtmp=abs(smb);
smbtmp_norm=smbtmp/max(smbtmp); % 归一化
smbtmp_norm_dB=20*log10(smbtmp_norm+realmin);
index_lowerThan60dB=find(smbtmp_norm_dB<-60); % if the dB value is lower than -60,than put it as -60
smbtmp_norm_dB(index_lowerThan60dB)=-60;
plot(Rx,smbtmp);
title('Matched Filtering of single pulse') %
axis tight;
xlabel('Range /m')
ylabel('dB');
% 测试实际产生的两个目标的回波的频谱与匹配滤波器频谱的关系 (已去除载频,所以频谱分布在低频)
for i=1:ntarget;
td=t-2*XObj(i)/c;
LocateL=min(find(td>=0));
modify_k=1;
backwave1(i,:)=fn(i).*exp(cj*2*pi*(fc.*td+0.5*k.*td.^2));
weightingwindow=[zeros(1,LocateL-modify_k) ones(1,length(t0)) zeros(1,n-LocateL+modify_k-length(t0))];
s(i,:)=backwave1(i,:).*weightingwindow;
sb(i,:)=s(i,:).*exp(-cj*wc*t);
end;
freqs21=abs(fft(sb(1,:)));
freqs22=abs(fft(sb(2,:)));
freqmatch=abs(fft(sb0_matchfilter,n));
freqpadzero=(fs/n).*(0:n-1); % 频率刻度, Hz
counter=counter+1;
figure(counter);
plot(freqpadzero,freqmatch);
hold on;
plot(freqpadzero,freqs21,'g');
hold on;
plot(freqpadzero,freqs22,'r');
hold off;
xlabel('Frequency /Hz');
legend('spectrum of no delay','spectrum of with delay 1','spectrum of with delay 2');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -