Matlab雷达回波数据模拟.docx

上传人:b****6 文档编号:5077247 上传时间:2022-12-13 格式:DOCX 页数:6 大小:33.96KB
下载 相关 举报
Matlab雷达回波数据模拟.docx_第1页
第1页 / 共6页
Matlab雷达回波数据模拟.docx_第2页
第2页 / 共6页
Matlab雷达回波数据模拟.docx_第3页
第3页 / 共6页
Matlab雷达回波数据模拟.docx_第4页
第4页 / 共6页
Matlab雷达回波数据模拟.docx_第5页
第5页 / 共6页
点击查看更多>>
下载资源
资源描述

Matlab雷达回波数据模拟.docx

《Matlab雷达回波数据模拟.docx》由会员分享,可在线阅读,更多相关《Matlab雷达回波数据模拟.docx(6页珍藏版)》请在冰豆网上搜索。

Matlab雷达回波数据模拟.docx

Matlab雷达回波数据模拟

clear,holdoff

formatcompact

J=sqrt(-1);

closeall%Getrootfilenameforsavingresultsfile=input('Enterrootfilenamefordataandlistingfiles:

','s');

%formradarchirppulseT=10e-6;    %pulselength,seconds

W=10e6;     %chirpbandwidth,Hz

fs=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-1array

plot((1e6/fs)*(0:

length(s)-1),[real(s)imag(s)])

title('RealandImaginaryPartsofChirpPulse')

xlabel('time(usec)')

ylabel('amplitude')

gridNp=20;             %20pulses

jkl=0:

(Np-1);      %pulseindexarray,慢时间采样的序列,注意第一个PRI标记为0是为了慢时间起始时刻从零开始

PRF=10.0e3;        %PRFinHz

PRI=(1/PRF);       %PRIinsec

T_0=PRI*jkl;       %relativestarttimesofpulses,insec

g=ones(1,Np);      %gainsofpulses

T_out=[1240]*1e-6;%startandendtimesofrangewindowinsec,这个就是接收窗的时间宽度Trec

T_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;                  %inkm

ranges=[23.84.44.4]*1e3;              %inkm

SNR=   [-35107];              %dB

vels=[-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:

Ntargets

 fprintf('\n range=%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)"clutter"withspecifiedC/N and 具体原理不清楚,需要时套用此格式即可!

%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:

My

 ncc(i,:

)=ifft(G'.*fft(ncc(i,:

)));

end

 

%rescalecluttertohavedesiredC/Nratio

pcc=var(ncc(:

));

ncc=sqrt((10^(CN/10))/pcc)*ncc;

%10*log10(var(ncc(:

))/var(nzz(:

))) %checkactualC/N%NowweighttheclutterpowerinrangeforassumeR^2(beam-limited)loss

cweight=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:

Ntargets

 fprintf(fid,'\r range=%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']) _________________________________________________________________________用到的函数functiony=radar(x,fs,T_0,g,T_out,T_ref,fc,r,snr,v)

%RADAR     simulateradarreturnsfromasinglepulseorburst

%           ofidenticalpulses

% usage:

%   R=radar(X,Fs,T_0,G,T_out,T_ref,Fc,R,SNR,V)

%     X:

     basebandsinglepulsewaveform(complexvector)

%     Fs:

    samplingfrequencyofinputpulse       [inHz]

%     T_0:

   starttime(s)ofinputpulse(s)         [sec]

%               (numberofpulsesinburstassumed=length(g))

%     G:

     complexgain(s)ofpulse(s),即慢时间,各个PRI对应的脉冲的前的加权20-by-1

%     T_out:

 2-vector[T_min,T_max]definesoutput

%               windowdelaytimesw.r.t.startofpulse

%     T_ref:

 system"reference"time,neededtosimulate

%                burstreturns.THISISTHE"t=0"TIME!

!

!

%     Fc:

    centerfreq.oftheradar.               [inHz]

%     R:

     vectorofrangestotarget(s)            [meters]

%                (numberoftargetsassumed=length(r))

%   SNR:

     vectoroftargetSNRs(unitnoisepowerassumed)

%             ThiswillbeSNR*after*allowingforR^4

%     V:

     vectoroftargetvelocities(optional)   [inm/sec]

%                (positivevelocitiesaretowardstheradar)

%

% note

(1):

VELOCITYinmeters/sec!

!

!

%          distancesinm,timesinsec,BWinHz.% note

(2):

assumeseachpulseisconstant(complex)amplitude

% note(3):

willaccomodateuptoquadraticphasepulses

% note(4):

vectorofranges,R,allowsDISTRIBUTEDtargets

%

%    (c)jMcClellan7/28/90

%        ModifiedbyM.A.Richards,August1991J=sqrt(-1);

c=3e8;                              %velocityoflightinm/sec

Mx=length(x);

delta_t=1/fs;                       %samplinginterval(sec)

t_y=[T_out

(1):

delta_t:

T_out

(2)]'; %outputsamplingtimes(sec),接收窗的宽度的等间隔采样337-by-1

T_p=Mx*delta_t;                     %lengthofinputpulse(sec),基带信号chirp的脉冲持续时间,即Te%Assumezerovelocities(stationarytargets)ifnovelocity

%vectorprovidedifnargin<7

   v=zeros(r);

end%ensurethatallvectorsarecolumnvectorsx=x(:

); g=g(:

); T_0=T_0(:

); r=r(:

);snr=snr(:

); v=v(:

);%determinethequadraticphasemodulationparametersfor

%laterinterpolationofpulsesamplest_x=delta_t*[0:

(Mx-1)]';

x_ph=unwrap(angle(x));%基带chirp信号的相位,可以看出x_ph是个抛物线

q=polyfit(t_x,x_ph,2);%目的是用q=ax^2+bx+c逼近x_ph%checkresultusingcorrelationcoefficientxfit=polyval(q,t_x);%看看用q=ax^2+bx+c拟合的xfit与x_ph的一致程度

if(x_ph'*xfit)/norm(x_ph)/norm(xfit)<0.99

   disp('pulsephaseisnotquadratic')

   keyboard

end%

%--- Form(initiallyempty)outputmatrix---

%

Mr=length(t_y); Nr=length(g);    %outputsamplesinamatrix

y=zeros(Mr,Nr);%337-by-20%Index'i'loopsoverthenumberoftargets

for i=1:

length(r)

   ri=r(i);

   vi=v(i);

   f_doppler=2*vi*fc/c; %看看目标以速度v接近雷达应该如何表示,f_doppler=2*v/lambda   %Index'j'loopsoverthenumberofpulses

   forj=1:

length(g)%20 pulses

       r_at_T_0=ri-vi*T_0(j);%一般T_0=0表示当下目标离雷达距ri,若T_0 =7则表示7秒前目标离雷达距ri,现在目标距雷达?

       %Computestartandendtimeofreflectedpulseatreceiver,

       %ensurethatitfallsatleastpartiallywithintherange(time)window

       tau=2*r_at_T_0/(c+vi);  tmax=tau+T_p;

       iftau>=T_out

(2)|tmax<=T_out

(1)

           fprintf('\nEchofromtarget#%gatrange%gkm',i,ri)

           fprintf('\nisCOMPLETELYOUTOFtherangewindow')

           fprintf('\nonpulse#%g.\n',j)

       else           %Figureoutwhichsamplelocationsintheoutputgridcontain

           %reflectedpulse

            t_vals=t_y-tau; %t_y是接收窗的区间  tau=2*r_at_T_0/(c+vi),表示tau时刻目标位于r_at_T_0,tau即书上的t0=2R0/c

           %用t_vals而不是t_y是为了用t_vals与[0,T_p]这两个上下界相比较,可以想象若用t_y应该和tau和T_p+tau比较     

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 军事

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1