You are on page 1of 5

10.1049/ip-rsn:19951904 .........

Calculating the K-distribution by saddlepoint integration

10.1049/ip-f-1:19870090 10.1109/EURAD.2005.1605550 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% Radar Return Generation function[P]=simRangeData(N,iN,S,iS) % [P]=simRangeData(N,iN,S,iS) produces a vector P that corresponds to % the power over range gates with complex gaussian white noise and % Swerling I/II targets. % %Vector N determines the power of the complex gaussian white noise across % Range Cells controlled by indices iN. % % Vector S determines the power of a Swerling I/II target in Range Cells % dictated by vector iS pwrSig=10.^(S/10); %Converting signal power from dB tolinear pwrNoise=10.^(N/10); %Converinting noise power from dB tolinear nRangeGate=iN(end); %The total number of range gates %%GENERATING NOISE voltNoise_I=zeros(nRangeGate,1); %Pre-allocating for speed voltNoise_Q=zeros(nRangeGate,1); %Pre-allocating for speed I=length(iN); %Number of range gate segments withdifferent noise power iLead=1; %This loop produces the voltage waveform for the gaussian white n oise. %Every range gate segment between iLead and iLag will have its own power of %N(i) fori=1:IiLag=iN(i); voltNoise_I(iLead:iLag)=sqrt(pwrNoise(i)/2)*randn(iLag-iLead+1,1); %voltNoise_I Channel voltNoise_Q(iLead:iLag)=sqrt(pwrNoise(i)/2)*randn(iLag-iLead+1,1); %voltNoise_Q Channel iLead=iLag; end noise=voltNoise_I+j*voltNoise_Q; %Voltage waveform of the noise %%GENERATING TARGET RETURN signal=zeros(size(noise)); %Pre-allocating for speed I=length(iS); %The total number of signal returns fori=1:I %Power of the signal follows an exponential distribution pwrSwerling=exprnd(pwrSig(i),1,1); %Voltage waveform fo the signal signal(iS(i))=sqrt(pwrSwerling/2)+j*sqrt(pwrSwerling/2); end %%GENERATING OVERALL SIGNAL data=signal+noise; P=abs(data).^2;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function[T,iCFARwin]=CA_CFAR1(varargin) % [T,iCFARwin]=CA_CFAR(Pfa,N,nGuardCell, signal) produces a vector T, % that is the threshold produced by the Cell-Averaging CFAR (CA-CFAR) % method from the vector, signal, that is a one-dimension of range % power. %% % [T,iCFARwin]=CA_CFAR(Pfa,N,signal) produces a vector T, that isthe % threshold produced by the Cell-Averaging CFAR (CA-CFAR) methodfrom the % vector, signal, that is a one-dimension of range power. nGuard-Cell % defaults to one %% INPUT: % Pfa - the desired probability of False Alarm % % N - the total number of CFAR windows-- with N/2 in the leadingwindow % and N/2 in the lagging window. % % nGuardCell- the number of guard cells to either side of the testcell % % Signal - the power of the recieved waveform after having passedthrough % a square law detector. It is upon this that the threshold is set. %% OUTPUT: % T is the threshold set according to the functional inputs. % % iCFARwin are the indicies corresponding to the range gates wherea CFAR % threshold is produced. When the first few and last few range binsare % used as test cells, they don't allow enough room for the entireCFAR % reference window. Subsequently, they are ignored and scipped. %% ASSUMPTION: % signal noise/clutter, after passing through a square law detec-tor, will

% have an exponential distribution %% SOURCE: % Threshold Multiplier equation taken from Chapter 7 of M.A. Rich-ard's % "Fundamentals of Radar Signal Processing" % % AUTHORSHIP: % James Jen % Cal Poly Pomona % % UPDATE HISTORY: % May 28th, 2011 - Code Comment % May 30th, 2011 - Vectorize operations switch nargin case 3 Pfa=varargin{1}; N=varargin{2}; signal=varargin{3}; nGuardCell=1; case 4 Pfa=varargin{1}; N=varargin{2}; nGuardCell=varargin{3}; signal=varargin{4}; otherwise error('Unexpected Number of Inputs') end %CFAR Computations and Parameters a=N*(Pfa^(-1/N)-1);%Threshold multiplier %Number of Range Gates L=length(signal);

%If range gate inputs is a vector, then perform CFAR along entirerange %gate: ifmin(size(signal))==1 %Organizing linear index into a matrix iWindow=1:N+1+2*nGuardCell; nCUT=L-N-2*nGuardCell; shiftCFAR=(0:nCUT-1).'; index=repmat(iWindow,nCUT,1)+repmat(shiftCFAR,1,N+1+2*nGuardCell); %Linear Index for the reference window iRefWin=index; i=N/2+(1:2*nGuardCell+1); iRefWin(:,i)=[]; %Lienar index for the CUT i=N/2+nGuardCell+1; iCUT=index(:,i); %Summing the content of each reference window B=sum(signal(iRefWin),2)/N; %Outuptted thershold T=zeros(L,1); %For CUT too small or too big for complete %reference window, we set T to zero T(iCUT)=a*B; %Multiplying threshold multiplier

%If range gate input is a matrix, then treat each row as one experi-mental % trial with one test cell else %Row index for the Cell Under Test (CUT) iCUT=N/2+nGuardCell+1; %Rwo index cor the Reference Cells iRefCell=1:N+2*nGuardCell+1; notRefCell=N/2+(1:1+2*nGuardCell);

iRefCell(notRefCell)=[]; %Calculating the threshold B=sum(signal(:,iRefCell),2)/N; %sum of each cell in refer-ence win T=a*B; %Multiplying, a, the thresh-old mult end %Range Cells where Thrsholds are set: iCFARwin=1:L; iCFARwin(T==0)=[];

You might also like