%=======舷外有源干扰距离波门拖引干扰仿真==============================%function[]=main()clc;clearall;closeall;%=======================仿真参数======================================%c=3e8;%光速fo=1e6;%中心频率fs=4e6;%采样频率ts=1/fs;tau=100e-6;%脉冲宽度Tr=1e-3;%脉冲重复周期N=5;%雷达发射脉冲个数R=30e3;%弹目距离t_r=2*R/c;%回波时延A=2.5;%干扰信号与回波信号幅度比dlt_t=25e-6;%转发时延B=1e6;%信号带宽k=B/tau;%调频斜率%%t=0:ts:Tr-ts;rect=zeros(1,length(t));%产生调制函数矩形脉冲串fori=1:length(t)ift(i)=(0+t_r)&t(i)=(tau+t_r)rect(i)=1;endend%%t=0:ts:N*Tr-ts;Num=N*Tr/ts;Signal_Radar=repmat(rect,1,N);%目标回波信号%S=cos(2*pi*fo*(t-t_r));S=cos(2*pi*(fo*(t-t_r)+0.5*k*(t-t_r).^2));Signal_Radar=Signal_Radar.*S;t1=0:ts:Tr+dlt_t-ts;rect1=zeros(1,length(t1));%产生调制函数矩形脉冲串fori=1:length(t)ift(i)=(0+t_r)&t(i)=(tau+t_r)rect1(i)=1;endendt=0:ts:N*(Tr+dlt_t)-ts;Num=N*(Tr+dlt_t)/ts;Signal_Jam=repmat(rect1,1,N);%干扰信号Signal_Jam=A*Signal_Jam(1:length(S)).*S;figuresubplot(211)plot(Signal_Radar)ylim([-3,3])xlabel('采样点')ylabel('信号幅度')title('舰船回波信号')subplot(212)plot(Signal_Jam,'r')ylim([-3,3])xlabel('采样点')ylabel('信号幅度')title('舷外干扰拖引信号')%=============距离波门拖引效果图==================================%v=1000;%拖引速度t=0:ts:Tr-ts;SampleNumber=length(t);jlbm=zeros(1,SampleNumber);%波门宽度一般为脉冲宽度Signal_Radar_Single=Signal_Radar(1:SampleNumber);%单脉冲目标回波信号Signal_Jam_Single=A*Signal_Radar(1:SampleNumber);%单脉冲干扰回波信号Signal_Radar_Single_match=abs(fftshift(ifft(fft(Signal_Radar_Single).*fft(conj(fliplr(Signal_Radar_Single))))));%脉冲压缩Signal_Jam_Single_match=abs(fftshift(ifft(fft(Signal_Jam_Single).*fft(conj(fliplr(Signal_Jam_Single))))));%***********停拖期*****************************************************%假设tt为0~1s期间为停拖期t1=1st1=1;figuresubplot(2,2,1)plot((1:SampleNumber),Signal_Radar_Single_match);holdonplot((1:SampleNumber),Signal_Jam_Single_match,'r');[mem,Pos]=max(Signal_Jam_Single_match);jlbm((Pos-0.5*tau*fs+1):(Pos+0.5*tau*fs))=400;plot((1:SampleNumber),jlbm,'black');xlabel('采样点数');ylabel('幅度');title('t=1s时距离波门拖引效果');jlbm=zeros(1,SampleNumber);%*************拖引期(拖引时间tt=2s)***************************************************tt=2;RJ=R+v*(tt-t1);dlt_t=2*v*(tt-t1)/c;delayNum=fix(dlt_t*fs);Signal_Jam_Single_Tuoyin1=zeros(1,SampleNumber);Signal_Jam_Single_Tuoyin1(delayNum+1:SampleNumber+delayNum)=Signal_Jam_Single_match;subplot(2,2,2)plot((1:SampleNumber),Signal_Radar_Single_match);holdonplot((1:SampleNumber),Signal_Jam_Single_Tuoyin1(1:SampleNumber),'r')[mem,Pos]=max(Signal_Jam_Single_Tuoyin1);jlbm((Pos-0.5*tau*fs+1):(Pos+0.5*tau*fs))=400;plot((1:SampleNumber),jlbm,'black');xlabel('采样点数');ylabel('幅度');title('t=2s时距离波门拖引效果');jlbm=zeros(1,SampleNumber);%**********************拖引期(拖引时间tt=5s)******************************************tt=5;RJ=R+v*(tt-t1);dlt_t=2*v*(tt-t1)/c;delayNum=fix(dlt_t*fs);Signal_Jam_Single_Tuoyin2=zeros(1,SampleNumber);Signal_Jam_Single_Tuoyin2(delayNum+1:SampleNumber+delayNum)=Signal_Jam_Single_match;subplot(2,2,3)plot((1:SampleNumber),Signal_Radar_Single_match);holdonplot((1:SampleNumber),Signal_Jam_Single_Tuoyin2(1:SampleNumber),'r')[mem,Pos]=max(Signal_Jam_Single_Tuoyin2);jlbm((Pos-0.5*tau*fs+1):(Pos+0.5*tau*fs))=400;plot((1:SampleNumber),jlbm,'black');xlabel('采样点数');ylabel('幅度');title('t=5s时距离波门拖引效果');jlbm=zeros(1,SampleNumber);%***********************拖引期(拖引时间tt=10s)*****************************************tt=10;RJ=R+v*(tt-t1);dlt_t=2*v*(tt-t1)/c;delayNum=fix(dlt_t*fs);Signal_Jam_Single_Tuoyin3=zeros(1,SampleNumber);Signal_Jam_Single_Tuoyin3(delayNum+1:SampleNumber+delayNum)=Signal_Jam_Single_match;subplot(2,2,4)plot((1:SampleNumber),Signal_Radar_Single_match);holdonplot((1:SampleNumber),Signal_Jam_Single_Tuoyin3(1:SampleNumber),'r')[mem,Pos]=max(Signal_Jam_Single_Tuoyin3);jlbm((Pos-0.5*tau*fs+1):(Pos+0.5*tau*fs))=400;plot((1:SampleNumber),jlbm,'black');xlabel('采样点数');ylabel('幅度');title('t=10s时距离波门拖引效果');jlbm=zeros(1,SampleNumber);function[x_r,x_i]=chirp_signal(A,fs,W,B,pulse,T)N=fix(fs*pulse);%脉冲宽度M=fix(fs*T);%脉冲重复周期u=0.5*B/pulse;%调频斜率i=1:N;x_r(i)=A*cos(2*pi*(W*i/(fs)+u*i.*i/(fs^2)));%脉内线性调频信号调制x_i(i)=A*sin(2*pi*(W*i/(fs)+u*i.*i/(fs^2)));i=N:M;x_r(i)=0;x_i(i)=0;