您好,欢迎访问三七文档
当前位置:首页 > 建筑/环境 > 工程监理 > Matlab雷达回波数据模拟
clear,holdoffformatcompactJ=sqrt(-1);closeall%Getrootfilenameforsavingresultsfile=input('Enterrootfilenamefordataandlistingfiles:','s');%formradarchirppulseT=10e-6;%pulselength,secondsW=10e6;%chirpbandwidth,Hzfs=12e6;%chirpsamplingrate,Hz;oversamplebyalittlefprintf('\nPulselength=%gmicroseconds\n',T/1e-6)fprintf('Chirpbandwidth=%gMhz\n',W/1e6)fprintf('Samplingrate=%gMsamples/sec\n',fs/1e6)s=git_chirp(T,W,fs/W);%120-by-1arrayplot((1e6/fs)*(0:length(s)-1),[real(s)imag(s)])title('RealandImaginaryPartsofChirpPulse')xlabel('time(usec)')ylabel('amplitude')gridNp=20;%20pulsesjkl=0:(Np-1);%pulseindexarray,慢时间采样的序列,注意第一个PRI标记为0是为了慢时间起始时刻从零开始PRF=10.0e3;%PRFinHzPRI=(1/PRF);%PRIinsecT_0=PRI*jkl;%relativestarttimesofpulses,insecg=ones(1,Np);%gainsofpulsesT_out=[1240]*1e-6;%startandendtimesofrangewindowinsec,这个就是接收窗的时间宽度TrecT_ref=0;%systemreferencetimeinusec,T_ref=0指T_0=0时,r_at_T_0=ri;当T_0~=0时,r_at_T_0=ri-vi*T_0(j)fc=10e9;%RFfrequencyinHz;10GHzisX-bandfprintf('\nWearesimulating%gpulsesatanRFof%gGHz',Np,fc/1e9)fprintf('\nandaPRFof%gkHz,givingaPRIof%gusec.',PRF/1e3,PRI/1e-6)fprintf('\nTherangewindowlimitsare%gto%gusec.\n',...T_out(1)/1e-6,T_out(2)/1e-6)%ComputeunambiguousDopplerintervalinm/sec%Computeunambiguousrangeintervalinmetersvua=3e8*PRF/(2*fc);%第一盲速rmin=3e8*T_out(1)/2;rmax=3e8*T_out(2)/2;rua=3e8/2/PRF;fprintf('\nTheunambiguousvelocityintervalis%gm/s.',vua)fprintf('\nTherangewindowstartsat%gkm.',rmin/1e3)fprintf('\nTherangewindowendsat%gkm.',rmax/1e3)fprintf('\nTheunambiguousrangeintervalis%gkm.\n\n',rua/1e3)%Definenumberoftargets,thenrange,SNR,and%radialvelocityofeach.TheSNRwillbetheactualSNRofthetargetin%thefinaldata;itwillnotbealteredbyrelativerange.Ntargets=4;del_R=(3e8/2)*(1/fs)/1e3;%inkmranges=[23.84.44.4]*1e3;%inkmSNR=[-35107];%dBvels=[-0.4-0.20.20.4]*vua;%inm/sec%FromSNR,wecomputerelativeRCSusingtheideathatSNRisproportional%toRCS/R^4.StudentswillbeaskedtodeducerelativeRCS.rel_RCS=(10.^(SNR/10)).*(ranges.^4);rel_RCS=db(rel_RCS/max(rel_RCS),'power')fprintf('\nThereare%gtargetswiththefollowingparameters:',Ntargets)fori=1:Ntargetsfprintf('\nrange=%5.2gkm,SNR=%7.3gdB,rel_RCS=%7.3gdB,vel=%9.4gm/s',...ranges(i)/1e3,SNR(i),rel_RCS(i),vels(i))end%Nowformtherangebin-pulsenumberdatamapdisp('')disp('')disp('...formingsignalcomponent')y=radar(s,fs,T_0,g,T_out,T_ref,fc,ranges,SNR,vels);%y是337-by-20的矩阵%addthermalnoisewithunitpowerdisp('...addingnoise')%randn('seed',77348911);[My,Ny]=size(y);nzz=(1/sqrt(2))*(randn(My,Ny)+J*randn(My,Ny));%产生方差为1的复高斯白噪声y=y+nzz;%createlog-normal(ground)clutterwithspecifiedC/Nand具体原理不清楚,需要时套用此格式即可!%log-normalstandarddeviationforamplitude,uniformphase%Clutterisuncorrelatedinrange,fullycorrelatedinpulse#disp('...creatingclutter')CN=20;%clutter-to-noiseratioinfirstbin(dB)SDxdB=3;%indB(thisisNOTthesigmaofthecompleteclutter)ncc=10.^((SDxdB*randn(My,Ny))/10);ncc=ncc.*exp(J*2*pi*rand(My,Ny));%ForcethepowerspectrumshapetobeGaussiandisp('...correlatingandaddingclutter')G=exp(-(0:4)'.^2/1.0);G=[G;zeros(Ny-2*length(G)+1,1);G(length(G):-1:2)];fori=1:Myncc(i,:)=ifft(G'.*fft(ncc(i,:)));end%rescalecluttertohavedesiredC/Nratiopcc=var(ncc(:));ncc=sqrt((10^(CN/10))/pcc)*ncc;%10*log10(var(ncc(:))/var(nzz(:)))%checkactualC/N%NowweighttheclutterpowerinrangeforassumeR^2(beam-limited)losscweight=T_out(1)*((T_out(1)+(0:My-1)'*(1/fs)).^(-1));cweight=cweight*ones(1,Np);ncc=ncc.*cweight;%var(ncc)可以看出20列clutter的方差均在30左右y=y+ncc;[My,Ny]=size(y);d=(3e8/2)*((0:My-1)*(1/fs)+T_out(1))/1e3;%T_out(1))/1e3是接收窗的起始时刻plot(d,db(y,'voltage'))xlabel('distance(km)')ylabel('amplitude(dB)')grid%Savethedatamatrixinspecifiedfile.%Savethestudentversioninthemysteryfile.%Alsosaveallparametervaluedisplaysincorrespondingfiledata_file=[file,'.mat'];mystery_file=[file,'_mys.mat'];listing_file=[file,'.lis'];eval(['save',data_file,'JTWfssNpPRFPRIT_outfcvua',...'rminrmaxruaNtargetsrangesvelsSNRrel_RCSy']);eval(['save-v6',mystery_file,'JTWfssNpPRFT_outfcy']);fid=fopen(listing_file,'w');fprintf(fid,['\rDESCRIPTIONOFDATAINFILE',file,'.matAND',file,'_mys.mat\r\r']);fprintf(fid,'\rPulselength=%gmicroseconds\r',T/1e-6);fprintf(fid,'Chirpbandwidth=%gMhz\r',W/1e6);fprintf(fid,'Samplingrate=%gMsamples/sec\r',fs/1e6);fprintf(fid,'\rWearesimulating%gpulsesatanRFof%gGHz',Np,fc/1e9);fprintf(fid,'\randaPRFof%gkHz,givingaPRIof%gusec.',PRF/1e3,PRI/1e-6);fprintf(fid,'\rTherangewindowlimitsare%gto%gusec.\r',...T_out(1)/1e-6,T_out(2)/1e-6);fprintf(fid,'\rTheunambiguousvelocityintervalis%gm/s.',vua);fprintf(fid,'\rTherangewindowstartsat%gkm.',rmin/1e3);fprintf(fid,'\rTherangewindowendsat%gkm.',rmax/1e3);fprintf(fid,'\rTheunambiguousrangeintervalis%gkm.\r\r',rua/1e3);fprintf(fid,'\rThereare%gtargetswiththefollowingparameters:',...Ntargets);fori=1:Ntargetsfprintf(fid,'\rrange=%5.2gkm,SNR=%7.3gdB,rel_RCS=%7.3gdB,vel=%9.4gm/s',...ranges(i)/1e3,SNR(i),rel_RCS(i),vels(i));endfclose(fid);fprintf(['\n\nDataisinfile',data_file])fprintf(['\nStudentdataisinfile',mystery_file])fprintf(['\nListingisinfile',listing_file,'\n\n'])__________________________________________________________
本文标题:Matlab雷达回波数据模拟
链接地址:https://www.777doc.com/doc-2887936 .html