%%demo of LFM pulse radar
%==================================================================
function LFM_radar(T,B,Rmin,Rmax,R,RCS)
% 感谢亲亲使用此代码,此代码解决您的问题了吗~(@^_^@)~
% 没解决的话告诉亲亲一个好消息,登录淘宝店铺“大成软件工作室”,可以下载(????)1分钱成品代码(′▽`〃)哦~
% 是的,亲亲真的没有看错,挠破头皮的问题真的1分钱就可以解决了(づ??????)づ
% 小的这就把传送门给您,记得要收藏好哦(づ ̄3 ̄)づ╭?~
% 传送门:https://item.taobao.com/item.htm?spm=a1z10.1-c.w4004-15151018122.5.uwGoq5&id=538759553146
% 如果传送门失效,亲亲可以来店铺讨要,客服MM等亲亲来骚扰哦~(*/ω╲*)
if nargin==0
T=10e-6; %pulse duration 10us
B=30e6; %chirp frequency modulation bandwidth 30MHz
Rmin=10000;Rmax=15000; %range bin
R=[10500,11000,12000,12008,13000,13002]; %position of ideal point targets
RCS=[1 1 1 1 1 1]; %radar cross section
end
%==================================================================
%%Parameter
C=3e8; %propagation speed
K=B/T; %chirp slope
Rwid=Rmax-Rmin; %receive window in meter
Twid=2*Rwid/C; %receive window in second
Fs=5*B;Ts=1/Fs; %sampling frequency and sampling spacing
Nwid=ceil(Twid/Ts); %receive window in number
fprintf('b=%d\n',Nwid);
%==================================================================
%%Gnerate the echo
t=linspace(2*Rmin/C,2*Rmax/C,Nwid); %receive window
%open window when t=2*Rmin/C
%close window when t=2*Rmax/C
M=length(R); %number of targets
td=ones(M,1)*t-2*R'/C*ones(1,Nwid);
fprintf('c=%d',td);
fprintf('a=%d\n',length((abs(td)<T/2)));
%Srt=RCS*(exp(j*pi*K*td.^2));
Srt=RCS*(exp(j*pi*K*td.^2).*(abs(td)<T/2));%radar echo from point targets
figure(1)
plot(t*1e6,real(Srt));axis tight;
xlabel('时间/s');ylabel('振幅')
title('雷达回波信号');
%==================================================================
%%Digtal processing of pulse compression radar using FFT and IFFT
Nchirp=ceil(T/Ts); %pulse duration in number
Nfft=2^nextpow2(Nwid+Nwid-1); %number needed to compute linear
%convolution using FFT algorithm
Srw=fft(Srt,Nfft); %fft of radar echo
t0=linspace(-T/2,T/2,Nchirp);
St=exp(j*pi*K*t0.^2); %chirp signal
Sw=fft(St,Nfft); %fft of chirp signal
Sot=fftshift(ifft(Srw.*conj(Sw))); %signal after pulse compression
figure
plot(real(Sot));axis tight;
xlabel('时间/s');ylabel('振幅')
title('脉冲压缩后信号');
%==================================================================
N0=Nfft/2-Nchirp/2;
Z=abs(Sot(N0:N0+Nwid-1));
Z=Z/max(Z);
Z=20*log10(Z+1e-6);
figure
plot(t*C/2,Z)
axis([10000,15000,-60,0]);
xlabel('距离');ylabel('振幅/dB')
title('归一化处理后');
%==================================================================
评论4