Вы находитесь на странице: 1из 150

A STUDY OF CFAR IMPLEMENTATION COST AND PERFORMANCE

TRADEOFFS IN HETEROGENEOUS ENVIRONMENTS



A Thesis
Presented to the
Faculty of
California State Polytechnic University, Pomona


In Partial Fulfillment
Of the Requirements for the Degree
Master of Science
In
Electrical and Computer Engineering



By
James J. Jen
2011
SIGNATUREPAGE

THESIS: ASTUDYOFCFARIMPLEMENTATIONCOSTAND
PERFORMATIVETRADEOFFSINHETEROGENEOUS
ENVIRONMENTS

AUTHOR: JamesJ.Jen

DATESUBMITTED: Spring2011

ElectricalandComputerEngineering

Dr.ZekeriyaAliyazicioglu _________________________________________
ThesisCommitteeChair
ElectricalandComputerEngineering
CollegeofEngineering

Dr.H.KHwang _________________________________________
ElectricalandComputerEngineering
CollegeofEngineering

Dr.JamesKang _________________________________________
ElectricalandComputerEngineering
CollegeofEngineering
ii
ACKNOWLEDGEMENTS
Irecallclearlylastyearwhen,attheendofaSignalProcessinglecture,Profes
sorHwangaskedforinterestingraduateresearch.MytimeatCalPolyPomona,upun
tilthatpoint,hadbeenrockyandundistinguished.Tentative,Ialmostdidntapproach
theprofessorthat.ImgladIdid.ThelastyearofgraduateresearchwithProfessors
HwangandZekihadmeaningfullycoloredandenrichedmygraduatestudies.
MuchthankstoProfessorH.K.HwangandZekeriyaAliyazicioglu:firstly,forthe
opportunityforresearchandtheirmanyFridaymorningsspentonusstudents,and
secondly,fortheirinvaluableguidanceandencouragementthroughout.
AppreciationtootoThalesRaytheonforsupportingtheresearch,andparticu
larlytoTomNicholsWalkerBirrellfortheirexpertiseandinput.
ThankstootoNellieQian,who,formostofthepastyear,hadbeenmypartner
incrimeinMATLABventuresfromMinimaxbeamforming,toantennaarrayinterfer
encesuppression,andfinallytothisCFARthingthathadbecomeourthesis.
Andthanks,mostsincerely,tomymomanddadEmilyandChinPingJen
fortheirsupport,encouragement,andpatience.
iii
ABSTRACT
CFARConstantFalseAlarmRateisacriticalcomponentinRADARdetec
tion.Throughthejudicialsettingofdetectionthreshold,CFARalgorithmsallowRADAR
systemstosetdetectionthresholdsandreliablydifferentiatebetweentargetsofinter
estandinterferingnoiseorclutter.
Inmanyoperatingconditions,noiseandclutterdistributionsmaybehighlyhet
erogeneouswithsuddenjumpsinclutterpowerorwiththepresenceofmultipletar
getsincloseproximity.AgoodCFARalgorithmmustreliablyoperateinthesecondi
tionsbutwithoutprohibitivelyhighimplementationcosts.
Inthisthesis,weinvestigateanumberofCFARalgorithmsnewandoldall
thewhileassessingtheiroperationalflexibilityandcostofoperation.
Asbalanceofperformanceandimplementationcost,twoalgorithmsstoodout
asdesirable:VariabilityIndex(VI)CFARaprocedurethatallowedfordynamicallyse
lectionbetweentheleading,lagging,orwholeofthereferencewindowsandSwitch
ing(S)CFARatestcelltechniquethatallowedfortheselectionofrepresentative
subsetsofthereferencecellascomparedtothecellundertest.Weconcludewithde
velopinganewalgorithm:SwitchingVariabilityIndex(SVI)CFARthatcombinesthead
vantagesofbothVIandSCFAR.
iv
TABLEOFCONTENTS
SignaturePage
Acknowledgements...
Abstract..
TableofContents.
ListofTables...
ListofFigures..
1 Introduction..
1.1Background
1.2Objective.
1.3InvestigationTool.
2 Background.
2.1Introduction..
2.2TheRadarSystem.
2.3DopplerProcessing..
2.4RadarSignals.
2.4.1Target..
2.4.2Clutter.
2.4.3Noise
2.4.4SquareLawDetector...
2.5RadarSignalEnvironment..
2.5.1Homogeneous.

ii
iii
iv
v
ix
x
1
1
1
2
3
3
3
5
6
6
8
9
9
12
12
v
2.5.2MultipleTargets
2.5.3ClutterWall..
2.6AboutCFAR...
2.6.1ProbabilityofFalseAlarm..
2.6.2TheCFARWindow
2.6.3ProbabilityofDetection..
2.6.4CFARLoss
2.7MonteCarloSimulations.
3 CellAveragingCFAR.
3.1Implementation.
3.2HomogeneousEnvironment..
3.2.1ProbabilityofFalseAlarm
3.2.2Detection.
3.3MultipleTargets
3.4ClutterWall
3.4.1ClutterWallFalseAlarm
3.4.2ClutterWallDetection
3.5Summary:CACFARAdvantagesandDisadvantages..
3.6ACombatforMultipleTargets:SmallestOfCellAveragingCFAR.....
3.7ARemedyforClutterWalls:GreatestOfCellAveragingCFAR
4 VariabilityIndexCFAR
4.1Implementation.
13
14
15
15
17
18
19
20
22
22
24
24
25
27
29
29
31
31
32
37
42
42
vi
4.2VICFARDecisionLogic
4.3HomogeneousEnvironment
4.3.1ProbabilityofFalseAlarm
4.3.2ProbabilityofDetection
4.4MaskingTargets
4.5ClutterWall..
4.5.1ProbabilityofFalseAlarm
4.5.2ProbabilityofDetection
5 OrderedStatisticsCFAR.
5.1Implementation.
5.2Homogeneous.
5.2.1ProbabilityofFalseAlarm.
5.2.2Detection
5.3MultipleTargets
5.5ClutterWall..
6 OrderedStatisticsGreatestOfCFAR
6.1Implementation.
6.2Homogeneous.
6.2.1ProbabilityofFalseAlarm.
6.2.2Detection
6.3MultipleTargets
6.5ClutterWall..
45
50
50
51
53
58
58
59
61
61
63
63
63
66
71
74
74
75
76
77
79
83
vii
7 ConclusionsandFinalAssessment.
References
AppendixA MATLABFunctions..
A.1RadarReturnGeneration..
A.2MonteCarloSimulations
A.3NeymanPearsonDetection.
A.4CellAveragingCFAR
A.5GreatestOfCellAveragingCFAR..
A.6SmallestOfCellAveragingCFAR
A.7VariabilityIndexCFAR
A.8OrderedStatisticsCFAR...
A.9OrderedStatisticsGreatestOfCFAR..
A.10SwitchingCFAR.
A.11SwitchingVariabilityIndexCFAR.
AppendixB MATLABScripts..
B.1ProbabilityofFalseAlarminHomogeneousEnvironment
B.2ProbabilityofFalseAlarminClutterWallEnvironment.
B.3ProbabilityofDetectioninHomogeneous/MultipleTargetEnvironment.
B.4ProbabilityofDetectioninClutterWallEnvironment..

86
89
90
90
92
93
94
97
100
103
107
110
113
116
120
120
125
129
134

viii

6
8
44
86
LISTOFTABLES
Table2.1SwerlingTargets.
Table2.2ClutterTypes
Table4.1VICFARDecisionLogic
Table7.1CFARComparison

ix

3
5
7
11
11
12
13
14
16
17
18
19
20
21
22
23
24
25
25
26
28
LISTOFFIGURES
Figure2.1.RadarBlockDiagram...
Figure2.2.DopplerProcessing
Figure2.3.ScatteringforDifferentSwerlingTargets..
Figure2.4.DiodeConductanceCharacteristic..
Figure2.5.RadarReturnStatisticsBeforeandAfterSquareLawDetector
Figure2.6.HomogeneousEnvironment
Figure2.7.MultipleTargets.
Figure2.8.ClutterEdge
Figure2.9.ExponentialDistributionandThresholding..
Figure2.10.CFARWindow.
Figure2.11.TheThreshold...
Figure2.12.ATypicalProbabilityofDetectionCurveillustratingCFARLoss..
Figure2.13.MonteCarlowithExponentialDistribution..
Figure2.14.MonteCarloWeightFunctionforExponentialDistribution..
Figure3.1.CellAveragingCFARBlockDiagram...
Figure3.2.CACFARThresholdinHomogeneousEnvironment
Figure3.3.CACFARTheoreticalv.ExperimentalPFA.
Figure3.4.CACFARHomogeneousProbabilityofDetection.
Figure3.5.CACFARHomogeneousCFARloss..
Figure3.6.CACFARThresholdwith1MaskingTarget..
Figure3.7.CACFARProbabilityofDetectionwith1to3maskingtargets..
x
28
29
30
31
32
33
34
34
35
35
36
37
38
39
39
40
40
41
42
45
46
47
Figure3.8.CACFARCFARLosswith1to3maskingtargets.
Figure3.9.CACFARThresholdinClutterWallTransition
Figure3.10.CACFARClutterWallProbabilityofFalseAlarm..
Figure3.11.CACFARClutterWallProbabilityofDetection
Figure3.12.SOCACFARBlockDiagram.
Figure3.13.SOCACFARExperimentalv.TheoreticalPFA
Figure3.14.SOCACFARHomogeneousP
D
....
Figure3.15.SOCACFARHomogeneousCFARLoss..
Figure3.16.SOCACFAR1MaskingTargetProbabilityofDetection
Figure3.17.SOCACFAR1MaskingTargetCFARLoss.
Figure3.18.SOCACFARClutterWallProbabilityofFalseAlarm
Figure3.19.GOCACFARBlockDiagram
Figure3.20.GOCACFARHomogeneousProbabilityofFalseAlarm
Figure3.21.GOCACFARHomogeneousProbabilityofDetection.
Figure3.22.GOCACFARHomogeneousCFARLoss..
Figure3.23.GOCACFARProbabilityofDetectionwith1MaskingTarget
Figure3.24.GOCACFARCFARLosswith1MaskingTarget
Figure3.35.GOCACFARClutterWallP
FA
....
Figure4.1.VICFARBlockDiagram
Figure4.2.VICFARCaseI
Figure4.3.VICFARCaseII
Figure4.4.VICFARCaseIII.
xi
Figure4.5.VICFARCaseIV.
Figure4.6.VICFARCaseV..
Figure4.7.VICFARThresholdinHomogeneousEnvironment.
Figure4.8.VICFARTheoreticalv.ExperimentalHomogeneousP
FA

Figure4.9.VICFARProbabilityofDetectionCurve.
Figure4.10.VICFARCFARLossinHomogeneousEnvironment..
Figure4.11.VICFARThreshold1MaskingTarget.
Figure4.12.VICFARProbabilityofDetectionwith1MaskingTarget.
Figure4.13.VICFARP
D
CurvewithvaryingNumbersofMaskingTarget.
Figure4.14.VICFARCFARLossCurvewithvaryingNumbersofMaskingTarget
Figure4.15.ThreeTargets..
Figure4.16.VICFARProbabilityofDetectionwithThreeMaskingTargets
Figure4.17.VICFARThresholdinClutterWallTransition
Figure4.18.VICFARClutterWallProbabilityofFalseAlarm....
Figure4.19.VICFARClutterWallProbabilityofDetection....
Figure5.1.OSCFARBlockDiagram..
Figure5.2.OSCFARHomogeneousP
FA
....
Figure5.3.OSCFARThresholdinHomogeneousEnvironment..
Figure5.4.OSCFARHomogeneousProbabilityofDetection
Figure5.5.OSCFARHomogeneousCFARLoss
Figure5.6.OSCFARResistancetoMultipleTargets..
Figure5.7.OSCFARThresholdwith1MaskingTarget..
48
49
50
51
52
52
53
54
55
55
56
57
58
59
60
61
63
64
65
65
66
67
xii
68
69
69
70
71
72
73
74
75
76
77
78
79
79
80
81
82
82
83
84
85
88
Figure5.8.OSCFARProbabilityofDetectionwith1MaskingTarget..
Figure5.9.OSCFARCFARLosswith1MaskingTarget.
Figure5.10.OSCFARProbabilityofDetectionwith3MaskingTarget.
Figure5.11.OSCFARCFARLosswith3MaskingTarget
Figure5.12.OSCFARinClutterWallThreshold..
Figure5.13.OSCFARClutterWallProbabilityofFalseAlarm
Figure5.14.OSCFARClutterWallProbabilityofDetection..
Figure6.1.OSGOCFARBlockDiagram..
Figure6.2.OSGOCFARThresholdinHomogeneousEnvironment
Figure6.3.OSGOCFARHomogeneousP
FA
.
Figure6.4.OSGOCFARHomogeneousP
D
...
Figure6.5.OSGOCFARHomogeneousCFARLoss.
Figure6.6.OSGOCFARResistancetoMultipleTargets
Figure6.7.OSGOCFARThresholdwith1MaskingTarget
Figure6.8.OSGOCFARPDwith1MaskingTarget
Figure6.9.OSGOCFARCFARlosswith1MaskingTarget
Figure6.10.OSGOCFARPDwith3MaskingTarget
Figure6.11.OSGOCFARCFARlosswith3MaskingTarget
Figure6.12.OSGOCFARThresholdinClutterWallTransition.
Figure6.13.OSGOCFARClutterWallP
FA
.
Figure6.16.OSGOCFARClutterWallP
D
..
Figure7.1CFARObstacleCourse...
xiii
CHAPTER1
Introduction
1.1Background
Radarreturnisoftenamixofnoise;clutter;and,ifpresent,targets.Akeycom
ponentinRADARprocessingisthesettingofdetectionthresholds.Thesethresholds
differentiatebetweentargetsofinterestandunwantedradarreturns.Asoperatingen
vironmentsandconditionschange,theamountandnatureofnoiseandclutteralso
change.Foraccurateandreliabledetection,thethresholdmustselfadjustdynamically
andintelligently.
CFAR,constantfalsealarmrate,representsakeytechniqueinadaptivelyset
tingtargetdetectionthreshold[1].Employingamovingwindow,acrossrangebinsof
data,CFARalgorithmslookatneighborhoodsofpowerreturnsintheestimateofthe
noiseorcluttermean.Byscalingtheestimatedmeanwithaprecalculatedmultiplier,
thethresholdissetastolimitfalsealarmstoadesiredrate.
CFARalgorithmsareassessedfortheirabilitiestomaintaindesiredprobabilities
ofdetections(P
D
)andtheirprobabilitiesoffalsealarm(P
FA
).Theprobabilityofdetec
tiondescribesthechancesofsuccessfullydeclaringatarget,whenatargetisactually
present.Theprobabilityoffalsealarmdescribestheoddsofincorrectlydeclaringatar
get,whenthesignalis,inactuality,noiseorclutter.
DevelopedCFARalgorithmsmustbeabletooperateinavarietyofcanonical
environments:homogeneous,multipletargets,andclutterwall.Inthehomogeneous
environment,asingletargetexistsinaseaofclutterornoiseofuniformnoise.Inthe
1
multipletargetexists,severaltargetsexistincloseproximitytooneanother.Inthe
clutterwallenvironment,noiseand/orclutterpowerexperiencessudden,discontinu
ousincreasesordecreases.

1.2Objective
ThegoalofthisstudyistoinvestigateandassessthevarietyofexistingCFAR
algorithmsandjudgingtheirperformanceinhomogeneous,multipletarget,andclut
terwallenvironments.Towardsthis,theOrderedStatisticsGreatestOfCFAR(OSGO
CFAR),VariabilityIndexCFAR(VICFAR),andSwitchingCFAR(SCFAR)arestudied.
WhileCellAveragingCFAR(CACFAR)andOrderedStatisticsCFAR(OSCFAR)arealso
lookedat,theyareusedprimarilyasbasisofcomparisonsforthealgorithmsofinter
est.WeendwithdevelopmentofourownCFARtechnique,SwitchingVariabilityIndex
CFAR(SVICFAR)thatrepresentsahybridapproachbetweenVICFARandSCFAR.

1.3InvestigationTool
RadarsignalsandCFARalgorithmsareassessedthroughMonteCarlo,numeri
calexperiments.MATLABwaschosenastheinvestigationtool(Version7.10.0,
R2010a).
2
CHAPTER2
Background
2.1Introduction
SincetheirdevelopmentduringWorldWarII,radarhadgrowntooccupycriti
calcivilianandmilitaryroles.Anintroductoryunderstandingofradarprocessingand
signalsisnecessarybeforegettingintotheanalysisandassessmentofCFARalgo
rithms.

2.2TheRadarSystem
OriginallyacronymicasRADARforRAdioDetectionAndRanging,common
usagehadestablishedthewordinitsownright,asradarafreestandingnoun.The
originalword,though,helpsremindofthetechnologysdualpurpose:Todetecttar
getsofinterestsandtoascertaintheirdistance.
Figure2.1.RadarBlockDiagram.
3
4
Figure2.1showsabasicblockdiagramofaRADARsystem.Theparticularsys
temismonostaticwhereasingleantennaismultiplexedforbothtransmissionand
reception[2].
Thewaveformgeneratorformsatimingpulsetotriggerthetransmittertosend
anelectromagneticpulseatadesignedfrequency.Asthispulseissentit,itwillen
counterdifferentobjectsatvaryingdistances,andtheseobjectswillscatterbacksome
ofthesepulsesbacktotheantenna.
Thetimingandfrequencyofthereturnpulsecorrespondstotherelatives
speedsanddistanceofthereflectedtarget.Thesubsequentprocessingblocksthe
A/Dconverter,thepulsecompression,andtheDopplerprocessorallhelpsextractthe
relevantinformation.
Pulserepetitioninterval(PRI)referstotheperiodoftimebeforethesuccessive
radarpulses.Pulserepetitionfrequency(PRF)issimplytheinverseofthePRI.During
theperiodbetweensuccessivepulses,duringagivenpulserepetitioninterval,thera
darsystemwaitsforbackechoedpulses.Detectedechoesaredetected,binnedand
stored.
Theamountoftimeasentpulseisreflectedbacktotheradarantennaisdi
rectlyproportionaltothedistanceofthereflector:

0
0
2
: range (distance)
c : speed of light
: time
c t
R
R
t
=
2.3DopplerProcessing
Withdopplerprocessing,aradarsystemcannotonlydetecttargetrangeand
location,butalsotheradialvelocity,therangerate.
Asingletargetmaybelookedatseveraltimesoverseveralpulseintervals.The
changeinpoweroveragivenrangebin,ordistance,acrossmanypulseintervalsmay
giveasenseofthedopplershift,andhence,thespeedofthetarget(Figure2.2).
WhendiscreteFouriertransform(DFT),throughfastfouriertransform(FFT),is
performedoneachrangesampleoveritsmanyrangeintervals,thepulseintervalsare
convertedtodopplerintervals(alsocalleddopplerbins).
Figure2.2.DopplerProcessing.
5
2.4RadarSignals
Radarsignalsareoftencomposedofunwantednoise,undesiredclutterreturns,
andatargetofinterest.Overashortperiodoftime,eachsignalelementspossessesits
ownstochasticdistributionwithagivenpower.Statisticalcharacteristicsofthesignals
changeastheypassthroughasquarelawdetector.

2.4.1Target
Thepowerofaradarreturndependsonthedistanceandtheeffectiveradar
crosssection(RCS)ofthetarget.Overdistancer,thepowerofthesignaldiminishesby
afactorr
4
.Manyfactorsoftheradar,thetarget,andtheoperatingenvironmentcome
togethertodeterminethetargetsRCS:theilluminationangle,thefrequency,thepo
larizationofthetransmittedwave,targetmotion,vibration,andkinematicsofthera
daritself.RatherthanhopelesslydescribingatargetsRCSdeterministically,theyre
characterizingstochastically.
BuildinguponMarcumspioneeringstudies,PeterSwerlingdevelopedfourca
nonicalstochasticmodels:SwerlingI,II,III,andIV.WiththeseSwerlingmodels,there
Table2.1.SwerlingTargets
Model Distribution Notes
SwerlingI Rayleigh Scantoscan Characterizeswelltargetslike
planes,withmanyindependent
reflectors
SwerlingII PulsetoPulse
SwerlingIII ChiSquared
(Fourdegrees
offreedom)
Scantoscan
SwerlingIV PulsetoPulse
SwerlingV Nonfluctuating AlsocalledSwerling0or
MarcumsModel
Characterizeswelltargetslike
frigates,withonestrongreflector
andmanysmaller,weakerinde
pendentreflectors
( )
1
av
x
av
p x e
o
o

=
( )
2
2
4
av
x
av
x
p x e
o
o

=
6
turnpowerofatargetwillfluctuaterandomlyincreaseanddecreasewithachar
acteristicprobabilitydensityfunction(PDF)witheitherquicklyorslowly(Table2.1).
TheSwerlingIandIImodelsbothcharacterizedwithaRayleighdistribution
andassumedtobecomposedofmanyindependentsmallreflectors;andwithnone
dominating,theyeachreturnradarsignalsofaboutthesamepower.SwerlingImodels
fluctuateslowlyfromscantoscan(Figure2.3a).Eachpulsereturnishighlycorre
lated.SwerlingIImodels,meanwhile,fluctuatequicklyvaryingfrompulsetopulse.It
isclaimedthatobserveddataonairborneaircrafttargetsagreewithSwerlingModelsI
andII.
SwerlingIIIandIVmodelsaredescribedbytheChisquareddistributionwith
fourdegreesoffreedom.Theyareconceptualizedasmanyindependentreflectorsof
roughlyequalamplitudewithonedominatingreflector(Figure2.3b).TheSwerlingIII
modelvariesslowlyfromscantoscanwhiletheSwerlingIVmodelfluctuates
(a)
(b)
Figure2.3.ScatteringforDifferentSwerlingTargets.TheSwerlingmodelsassumeseachtar
getcomposedofalargenumberofindependentscatters.

(a) SwerlingI/II.ForSwerlingtargetsIandII,noneoftheindependentscatteringelementsdominates:
theirreflectedpowersiscomparabletooneanother.
(b) SwerlingIII/IV.ForSwerlingtargetsIIIandIV,thereisasingledominantnonfluctuatingscatter
togetherwithothersmallerscatters.
:Manyscatterelements;eachof
approximatelyequalamplitudes.
:Onescatteringelementproducing
anamplitudemuchlargerthanother
elements.
7
quicklyfrompulsetopulse.TheSwerlingIII/IVmodelissaidtowellcharacterizea
frigateorcorvettewithonelargetargetbutwithcomplexsuperstructures.

2.4.2Clutter
Clutterisunwantedradarreturns.Theymaybeaechoesfromtheenviron
mentasfromground,mountain,seaorobjectsofnoimportanceasaflockof
geese.Designationofclutterchangeswiththeaimsanddesignsoftheradarsystem.A
dopplerweathersystem,forinstance,mayregardradarreturnsfromastormcloud
withprimeimportancewhilethesamecloudmayonlybeinterferencetoacivilianair
trafficcontrolradar.Thestochasticcharacteristicofcluttervarieswiththeoperating
parametersoftheradaraswellasthenatureofthecluttersource(Table2.2).
Olderradarsystemshadlongerpulserepetitionintervalsandlargerrangebins.
ItwasobservedthatgroundclutterwaswellcharacterizedwithaGaussiandistribu
tion.However,astechnologyimproved,andshorterpulserepetitionintervalsgave
greaterrangeresolution,largespikesinamplitudewereobservedinradardata.The
Table2.2.ClutterTypes
Model Application Equation
Gaussian Clouds
WeibullClutter LandClutter
Kdistribution SeaClutter
( )
( )
( )
1
1
4
2
v
v
v
h
p x x K hx
v
+

=
I
( )
1
exp
c c
c x x
p x
b b b


| | | |
=

| |
\ . \ .


( )
2
2
2
1
exp
2
2
x
p x
u
o
to

| |
=

|
\ .


8
Gaussiandistributionnolongerfitted.
Studiesduringthelate70sandearly80sfoundthatgroundclutterweremore
accuratelycharacterizedwithaWeibulldistribution.UnliketheGaussiandistribution,
theWeibullischaracterizedbytwovariables:ashapingcoefficientandameancoeffi
cient.
Incontrastwithgroundclutter,seaclutterishighlycorrelated.Thetwo
parameterkdistributionwellcharacterizesthis.

2.4.3Noise
Gaussianwhitenoiseresultsfromrandomthermalmotioninelectronicsys
tems.Unliketargetandclutterreturns,noiseisalwayspresent.Asimpliedbyits
name,GaussiannoiseischaracterizedbythebellshapedGaussiandistribution.

2.4.4SquareLawDetector
Thestochasticcharacteristicofreceivedradarsignalsmaychangeatthediode
detector.Thediodeconductancecharacteristicisshownfigure2.4.Dependingonthe
strengthofthereceivedsignal,thedetectormayeitheroperateintheconductance
squareorinthelinearregion.Eachoffersitsadvantages.Marcumshowedthatifthe
signalislow,lyingbelowtheconductanceknee,thesquarelawdetectorgavethebest
results.Lineardetectors,meanwhile,offersthegreatestdynamicrangeandisbestfor
highsignals.Mathematically,inanalysis,thesquarelawdetectoroffersadditionalad
vantages.
9
BothRayleighandGaussianPDFs,passingthroughthesquarelawdetector,
becomeexponentialdistributions(Figure2.5).Giventherelativesimplicityofintegra
tionoftheexponentialfunction,thisfactcomesinhandyinanalyticaltreatmentsof
targetdetectionandfalsealarmrates.
10
(a)
(b)
Figure2.5.RadarReturnStatisticsBeforeandAfterSquareLawDetector.Thesquarelaw
detectorchangesstochasticPDFofthesignal..

(a) GaussianDistribution.ForSwerlingtargetsIandII,noneoftheindependentscatteringelements
dominates:theirreflectedpowersiscomparabletooneanother.
(b) ExponentialDistribution.ForSwerlingtargetsIIIandIV,thereisasingledominantnonfluctuating
scattertogetherwithothersmallerscatters.
0 1 2 3 4 5 6 7 8
0
5
10
15
20
25
30
v
i


Square Law
Linear Law
Figure2.4.DiodeConductanceCharacteristic.Radardetectioncan
eitheroccurinthelinearorthesquareregionofthediode.
11
0 10 20 30 40 50 60 70 80 90 100
0
5
10
15
20
25
30
35
40
45
50
Range Gates
M
a
g
n
i
t
u
d
e


Target 1
Clutter
0 10 20 30 40 50 60 70 80 90 100
0
10
20
30
40
50
60
70
80
90
100
Range Gates
M
a
g
n
i
t
u
d
e
2.5RadarSignalEnvironment
AnumberofdifferentsimplifiedRADARenvironmentshavebeenusedtoassess
andjudgetheefficacyandapplicabilityofthevariousCFARalgorithm.Althoughno
onemodelcapturesthefullcomplexityandnuanceofactualoperatingconditions,they
eachtestimportantqualitiesoftheCFARalgorithm:Thehomogeneousenvironment,
themultipletargetenvironment,andtheclutteredgeenvironment.

2.5.1Homogeneous
Thehomogeneousenvironmentisthemoststraightforward:Itassumesasin
gletargetagainstanindependentandidenticallydistributed(iid)noiseorclutter
(Figure2.6).
Ahomogeneousenvironmentmayarisewhen,forinstance,theradarantenna
makesnodetection,andnoiseofauniformpowerdominatestherangebins;orwhen
(a) (b)
Figure2.6.HomogeneousEnvironment
(a)Thereisjustonetargetofpower25dBatrangegate37.Thenoisepowerisuniformat5dB.
(b)MATLABsimulationofhomogeneousenvironment.
12
0 10 20 30 40 50 60 70 80 90 100
0
5
10
15
20
25
30
35
40
45
50
Range Gates
M
a
g
n
i
t
u
d
e


Target 1
Target 2
Clutter
(a) (b)
0 10 20 30 40 50 60 70 80 90 100
0
10
20
30
40
50
60
70
80
90
100
Range Gates
M
a
g
n
i
t
u
d
e
theclutterreturnoveragreatstretchofdistanceisofaconstantenvironment(say,a
forest,mountain,orocean).
ThehomogeneousmodelassessestheabilityofvariousCFARalgorithmsasthe
simplesttestforproperlyassessingitsabilitytoestimatethenoise/cluttermeaninset
tingthethresholdofdetection.

2.5.2MultipleTargets
Targetsofinterest,however,dontalwaysexistinisolationalongtherange
gatesofagivendopplerbin.Bychanceordesign,targetsmaybewithincloseproximity
ofoneanother(Figure2.6).
SomeCFARalgorithmssufferseriousperformativedeclineinmultipletarget
cases.Whenthetargetsarewithinhalfawindowlengthofoneanother,theirhigh
powers,improperlyelevatestheestimatedmeanofthebackgroundnoise/clutter.
Figure2.7.MultipleTargets.
(a)Atrangegates37and42,therearetargetsofpower25dB.
(b)MATLABsimulationofmultipletargetswithexponentialdistribution.
13
0 10 20 30 40 50 60 70 80 90 100
0
5
10
15
20
25
30
35
40
45
50
Range Gates
M
a
g
n
i
t
u
d
e


Clutter
0 10 20 30 40 50 60 70 80 90 100
0
10
20
30
40
50
60
70
80
90
100
Range Gates
M
a
g
n
i
t
u
d
e
(a) (b)
Whentheresultingthresholdsareset,theyarehigherthantheyleadtobe,andresult
inlossesinprobabilityofdetection(P
D
).

2.5.3ClutterWall
Inadditiontoonetargetassumption,theiidassumptionofthebackground
noise/cluttermayalsobeviolated.Radarenvironmentsoftenundergoabruptchanges
inpowersuchastransitioningfromclearlandtoaforest,orfromcloudstotheclear
sky.ThesesuddenjumpsinmeanpowermaythrowofftheCFARalgorithm,andintol
erablyincreasetheprobabilityoffalsealarmfollowingtheupwardclutterwalltransi
tionordecreasetheprobabilityofdetectionrightbeforetheclutterwall(Figure2.8).
Figure2.8.ClutterEdge.
(a)Atrangegate41,thereisasuddenjumpinclutterpower;from5dBto10dB.
(b)MATLABsimulationofaclutteredgewithexponentialdistribution.
14
2.6AboutCFAR
ThegoalofCFARconstantfalsealarmratealgorithmsistosetthresholds
highenoughtolimitfalsealarmstoatolerablerate,butlowenoughtoallowtarget
detection.Inthepast,thisdifferentiationbetweentargetandbackgroundnoiseand
clutterweredonebyhumanradaroperatorsuponaradardisplayscreen.However,
withtheadventofcomputertechnology,detectionthresholdingwasabletobeauto
mated,andthusbypassingmuchofthecost,inefficiencies,andlimitationsofahuman
operator.

2.6.1ProbabilityofFalseAlarm
Theprobabilityoffalsealarm,P
FA
,isthechancethatspikesinnoiseorclutteris
mistakenbytheCFARalgorithmasatarget.Asnoiseandclutterdistributionsarecon
tinuous,extendingfromamplitudesveryclosetozerotoamplitudesextendinginfi
nitelyoutwards.Nomatterhowhighthresholdsareset,therewillalwaysbeafinite
chanceofrandomnoiseorclutterexceedingthatthreshold.Soratherthaneliminating
falsealarmsalltogether(thiswouldbeimpossible),thegoalofCFARalgorithmsisto
reliablyestimatethemeannoise,andscalingtheestimatedmeanbyamultiplierto
obtainthethresholdsethighenoughtolimitfalsealarmratetoatolerablysmallrate.
Inmanyoperatingenvironments,theshapeofthenoise/clutterisknowna
prior.Fromofflinecomputationorfromtheexperienceoftheengineering,theprob
abilitydensityfunction(PDF)ofthenoisecanbeknownaheadoftime.Forinstance,
landclutterisoftencharacterizedbytheWeibulldistributionandCloudsbytheGaus
15
siandistribution.
Knowingthedistribution,then,ameasurementofthemeanmaybeproperly
scaledwithathresholdmultiplierforathresholdthatyieldsthedesiredprobabilityof
falsealarm(Figure2.9)
Sothequestionbecomes:Howtoestimatethemeannoiseorclutteroversev
eralrangebins?Theanswer:TheCFARwindow

x
Threshold Multiplier
Threshold
Noise Mean
(a)
(b)
Threshold Mean
Figure2.9.ExponentialDistributionandThresholding.
(a)ExponentialPDF.
(b)Togetthethreshold,themeanisscaledbyathresholdmultiplier.
NoisePower
P
r
o
b
a
b
i
l
i
t
y

D
i
s
t
r
i
b
u
t
i
o
n

Probabilityof
FalseAlarm
16
2.6.2TheCFARWindow
Toestimatethemeannoise/clutterpresentinaspecificrangebin,otherlocal
binsareused.Towardsthisend,mostCFARalgorithmsutilizesamovingwindow.
ThereareseveralcomponentstotheCFARwindow(Figure2.10).
Thecellundertest(CUT)alsocalledthetestcellistherangebinwithwhich
themeannoise/clutterisestimatedandwithwhichthethresholdisset.
Toestimatethemean,referencescellscellslocaltotheCUTareused.Dif
ferentCFARalgorithmsutilizedifferentmathematicalassessmentsanddifferentdeci
sionslogicaltowardsthisend.CellaveragingCFAR,forinstance,takesthemeanofthe
referencecellswhileOrderedStatisticsCFARordersthereferencecellsfromsmallest
tolargesttotakethek
th
largestasrepresentativeoftheaveragenoise.
Guardcellsareoptionalandmaybevariableinlength.Atarget,ifpresentin
theCUT,maystraddleconsecutive;andthiswouldleadtoinaccurateestimatesofthe
noise.Guardcellsthen,wouldguaranteethen,guardagainstthis.Typically,oneguard
cellisusedtoeithersideoftheCUT.

Leading Window Lagging Window
Cell Under Test
Guard Cells
Figure2.10.CFARWindow
17
2.6.3ProbabilityofDetection
TheCFARreferencewindowisusedtosetthethreshold(Figure2.11).The
thresholdhelpsdifferentiatebetweentargetanoise.Ifthesignalpower,foragiven
rangecell,liesunderneaththethreshold,atargetisdeemedabsent.Ifthesamesignal
powerexceedstheheightofthethreshold,thenatargetisdeclaredpresent.
SincetargetpowersaretypicallystochasticwithaSwerlingI/IIorSwerlign
III/IVdistributiontheprobabilityofdetectionisalsostochastic.Aroundamean
value,thereceivedtargetpowerwouldfluctuatetolargerthanthemeanorsmaller
thanthemeanaccordingtoitscharacteristicPDF.Sometimes,itwouldflucturateas
lowastomissthemean.Soregardlesstohowwellthethresholdissetforagiven
probabilityoffalsealarm,therewillalwaysbethechanceofmissingatarget,ifitspre
sent.Theprobabilityofdetectionhelpscharacterizetheoddsofdetectionovermany
trialrunsorovermanylooks.
0 10 20 30 40 50 60 70 80 90 100
0
5
10
15
20
25
30
Range Gates
M
a
g
n
i
t
u
d
e

(
d
B
)


Threshold
Recieved Waveform
0 10 20 30 40 50 60 70 80 90 100
0
5
10
15
20
25
30
Range Gates
M
a
g
n
i
t
u
d
e

(
d
B
)


Threshold
Recieved Waveform
MissedDetection
Detection!
(a) (b)
Figure2.11.TheThreshold.
(a)Misseddetection.Thetargetpowerfallsunderneaththethreshold.
(b)Successfuldetection.Targetpowergreaterthanthreshold.
18
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Signal to Noise Ratio (dB)
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n
Probability of Detection - Homogeneous Environment


Neyman-Pearson
CA-CFAR
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Signal to Noise Ratio (dB)
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n
Probability of Detection - Homogeneous Environment


CFARLoss
Figure2.12.ATypicalProbabilityofDetectionCurveillustratingCFARLoss
2.6.4CFARLoss
AlthoughtheP
D
isagoodmeasureofCFARperformance,itisrelativetooperat
ingconditionslikethesignaltonoiseratio(SNR).SoratherthanP
D
,CFARlossisthe
usualrulerusedtojudgeCFARperformance.
Figure12.12showsatypicalprobabilityofdetectioncurve.AstheSNRin
creases,theprobabilityofdetectionalsoincreases.TheNeymanPearsondetector
representsthetheoreticalbestdetectionifperfectknowledgeofthemeannoiseis
knownapriori.ItisagainsttheNeymanPearsondetectorthattheCFARlossiscalcu
lated.
CFARlossistheSNRdifference,foragivenP
D
betweentheNeymanPearson
detectorandtheCFARalgorithmininterest.Forinstance,inFigure12.12,foraprob
abilityofdetectionof0.4,theCFARlossiscloseto1dBofSNR.
19
2.7MonteCarloSimulations
Frequently,desiredprobabilityoffalsealarmsareverysmallontheorderof
10
5
or10
6
.Then,inMATLAB,duringaCFARnumericalexperiment,agreatnumberof
trialrunsontheorderof10
8
or10
9
arenecessarybeforeareliableexperimental
probabilityoffalsealarmcanbeascertained.ThisoftenintolerablyincreasesMATLAB
runtimeorcomputermemorydemands.MonteCarloImportanceSamplingrepre
sentsaclassofnumericaltechniquesusedtoreliablysimulateveryrareevents[3].
Ratherthanusingtheoriginaldistributiontosimulateevents,withMonteCarlo
ImportanceSampling,asimilarfunctionbutwithadifferentmeanisused,butwiththe
samethreshold(Figure2.13).Anysuccessfulhits,then,withthenewsimilarfunction,
ratherthanhavingaweightofone,isfractionallyweightwithaprederivedequation
(Figure2.14).
Th
( )
2 2
1
exp
x
f x
o o

=
`
)
( )
2 2
1
exp
m
m m
x
f x
o o

=
`
)
( )
6
10 10
FA
Th
Q f x dx P

= = =

Figure2.13.MonteCarlowithExponentialDistribution.
20
( )
( )
2
2 2 2
2
2
1 1
exp
: The weighing function for successful Monte Carlo "hits"
: Random varaible with uniform distribution
: Variance of the estimated exponential distribution
: V
m
m
m
w x x
w x
x
o
o o o
o
o


=
`
)
ariance of the Monte Carlo exponential distribution

Figure2.14.MonteCarloWeightFunctionforExponentialDistribution.
21
Chapter3
CellAveragingCFAR
CellAveragingCFAR(CACFAR)wasdevelopedearlyon,in1947,byHoward
Finn[1].OfalltheCFARalgorithms,CACFARworksbestinahomogeneousenviron
ment.Withincreasingwindowsize,theprobabilityofdetectionforCACFARap
proachesthatoftheoptimalNeymanPearsondetector.
However,whenthehomogeneousassumptionsareviolated,theperformance
ofCACFARrapidlydeteriorates[4].Asastartingpointinalgorithmicdevelopment
andasabasisofcomparison,thealgorithmisstudiedhere.

3.1Implementation
InCellAveragingCFAR,everyreferencecellisaddedtogetherandmultipliedto
thethresholdmultiplier(Figure3.1).ForGaussiannoiseandasquarelawdetector,the
Figure3.1.CellAveragingCFARBlockDiagram.



x
Threshold Multiplier
Threshold
1
1
N
FA
P o

=
22
thresholdmultiplierisgivenby:

Variableisthethresholdmultiplier,Nisthetotalnumberofreferencecells,andP
FA

isthedesiredprobabilityoffalsealarm.
Typically,P
FA
isdesignedtobeverylow,ontheorderof10
5
or10
6
.Therefer
encewindowlength,N,mustbeselectedbythedesignerasabalanceofperformance
inhomogeneousandheterogeneousenvironments.
AcellaveragingthresholdwithP
FA
=10
4
andN=32issimulatedforasingle
targetinahomogeneousenvironment(Figure3.2).AsingletargetSwerlingI/IItargetis
inrangebin37inhomogeneousnoise.SNRissetto15dB.Weseethatthethreshold,
1
1
N
FA
P o

=
0 10 20 30 40 50 60 70 80 90 100
0
5
10
15
20
Range Gates
M
a
g
n
i
t
u
d
e

(
d
B
)


CA-CFAR
Recieved Waveform
Figure3.2.CACFARThresholdinHomogeneousEnvironment.
23
acrossthenoiseonlyrangebin,makesgoodclearancefromthenoise.Thereisasuc
cessfuldetectionatthetarget.Toeithersidesofthetargetinrangebin37areelevated
thresholdplateautheseareartifactsfromtargetpresence.Thisisacharacteristicof
CACFAR.Althoughitposesnoproblemsinthesingletargethomogeneousenviron
mentcase,withmultipletargets,itnegativelyeffectsP
D
.

3.2HomogeneousEnvironment
3.2.1ProbabilityofFalseAlarm
TheprimaryfunctionofanyCFARistosetthethresholdtomaintainthedesired
probabilityoffalsealarm.Toconfirmtheworkabilityofthealgorithminahomogene
ousenvironment,weperformed10,000trialsforvariousdesignedP
FA
(Figure3.2).The
experimentalP
FA
closelymatchedtheexpectedtheoreticalresults.
2 4 6 8 10 12 14 16 18 20 22
10
-7
10
-6
10
-5
10
-4
10
-3
10
-2
10
-1
10
0
Threshold Multiplier
P
r
o
b
a
b
i
l
i
t
y

o
f

F
a
l
s
e

A
l
a
r
m


Theoretical P
FA
Experimental P
FA
Figure3.3.CACFARTheoreticalv.ExperimentalP
FA
.
24
3.2.2Detection
CellAveragingCFARsuccessfullysetsthresholdstokeeptodesiredfalsealarm
rates,butdoesthissamethresholdallowforgoodprobabilityofdetection?Wefirst
lookatCACFARinahomogeneousenvironmentwithasingletargetinabackground
ofnoiseorclutterwithuniformmean.Thethresholdwassetforasingletrialrunin
figure3.1.Infigure3.4,weseetheprobabilityofdetectionprofileoverarangeofSNR.
Forthisdataset,theCACFARwindowsizewassetto32,andamilliontrialperSNR
wasperformed.TheCACFARP
D
curvecloselymatchestothecontoursoftheNeyman
Pearsondetector.Infigure3.5,weseethattheCFARlossismuchlessthan1dB.

25
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Signal to Noise Ratio (dB)
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n


Neyman-Pearson
CA-CFAR
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Signal to Noise Ratio (dB)
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n


5 10 15 20
0
0.5
1
1.5
SNR (dB)
C
F
A
R

L
o
s
s

(
d
B
)


CA-CFAR
5 10 15 20
0
0.5
1
1.5
SNR (dB)
C
F
A
R

L
o
s
s

(
d
B
)


Figure3.4.CACFARHomogeneousProbabilityofDetection.
Figure3.5.CACFARHomogeneousCFARloss
26
0 10 20 30 40 50 60 70 80 90 100
0
5
10
15
20
25
Range Gates
M
a
g
n
i
t
u
d
e

(
d
B
)


CA-CFAR
Recieved Waveform
Figure3.6.CACFARThresholdwith1MaskingTarget
3.2.2MultipleTargets
TypicaltoCACFAR,asseeninfigure3.1,toeithersideofadetectedtargetsare
elevatedthresholdplateaus.Whenanothertargetfallswithinhalfawindowlengthof
it,eachtargetsprobabilityofdetectionsignificantlydecreases(Figure3.6).Thisphe
nomenaisreferredtoastargetmasking.
Detectionperformancediminishesdrasticallywithnumbersofinterferingtar
gets(Figure3.7).ForCACFARwithN=32,atSNR=20dB,theP
D
forasingletargetis0.9.
Withonemaskingtarget,theP
D
dropsto0.7,andwiththreemaskingtargetsP
D
sinks
to0.4.Themaskingeffectofmultipletargetsworsenswithincreasingsignaltonoise
ratio(Figure3.8).WhereastheCFARlossforoneinterferingtargetislessthan2dBat
27
5 10 15 20
0
5
10
15
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)

5 10 15 20
0
5
10
15
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)
homogeneous
one masking target
two masking targets
three masking targets
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n
Signal to Noise Ratio (dB)

0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n
Signal to Noise Ratio (dB)
Neyman Pearson
homogeneous
one masking target
two masking targets
three masking targets
Figure3.7.CACFARProbabilityofDetectionwith1to3maskingtargets
Figure3.8.CACFARCFARLosswith1to3maskingtargets
28
0 10 20 30 40 50 60 70 80 90 100
0
5
10
15
20
25
30
Range Gates
M
a
g
n
i
t
u
d
e

(
d
B
)


CA-CFAR
Recieved Waveform
Figure3.9.CACFARThresholdinClutterWallTransition.
SNR=10dB,atSNR=20dB,theCFARlossincreasesto6B.

3.4ClutterWall
Theclutterwallposestwodifferent,butcomplementarychallengesforCA
CFAR.Targetmaskingoccursatthebaseoftheclutteredge,andprobabilityoffalse
alarmratesincreasedrasticallyfollowingaclutterwalledge.

3.4.1ClutterWallFalseAlarm
Figure3.10summarizesthefalsealarmratesforvariousdistancesbeforeand
aftertheclutterwall.Thepinkdashlineat10
4
indicatesthedesignedfalsealarmrate.
29
0 5 10 15 20 25 30
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-2
10
-1
10
0
Number of Reference Cells in Clutter
P
r
o
b
a
b
i
l
i
t
y

o
f

F
a
l
s
e

A
l
a
r
m


CA-CFAR
Figure3.10.CACFARClutterWallProbabilityofFalseAlarm.
SimulatedforN=32,thebluelineat16demarcateswhenhalfthereferencecellsare
immersedinclutter.
P
FA
decreasesdrasticallyinthecellsbeforetheclutterwall.Havingafalsealarm
ratesmallerthanthedesignedrate,attheseregions,isntaconcern.Theproblemoc
cursfollowingtheclutterwall,atreferencecells16andoutwardsinFigure3.10.Atref
erencecell16,P
FA
reaches10
2
;afalsealarmratenearly100timesgreaterthanthe
desiredPFAat10
4
!ThisdegreeofdeviancefromdesiredP
FA
isusuallyintolerablefora
radarsystemsdesigns;andotherCFARtechniquesweredesigned,inpart,toremedy
thisdeficiency.
30
0 5 10 15 20 25 30
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Number of Reference Cells in Clutter
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n


CA-CFAR
N/2 cells in clutter
Figure3.11.CACFARClutterWallProbabilityofDetection
3.4.2ClutterWallDetection
Thedetectionatclutterwallsiscomplementarytoitsfalsealarmeffects.With
CACFAR,thereisagradualdecreaseofP
D
frombeforethewalltoafterit(Figure3.11).
Beforethewall,fromreferencecells1to16,thediminishmentinP
D
canbeattributed
toamaskingeffectbytheclutterregion.ThedecreaseinP
D
aftertheclutterwallcan
beaccountedbythecluttertonoiseratio(CNR)beingsmallerthantheSNR.

3.5Summary:CACFARAdvantagesandDisadvantages
AlthoughCACFARperformsverywellinhomogeneousenvironments,itsdetec
tionperformancessuffersdrasticallywithcloselyspacedmultipletargets.Attheclutter
wall,falsealarmprobabilitiesincreasebyasmuchasanorderof10
2
.Thisrendersthe
algorithmallbutuselessinclutterwallenvironments.
31
3.6AcombatforMultipleTargets:SmallestOfCellAveragingCFAR
SmallestOfCellAveraging(SOCA)CFARwasdevelopedtoremedyCell
AveragingCFARsdeficienciesinmultipletargetsituations.Ifasecondarytargetintol
erablyincreasestheaveragepoweroftheleadingorlaggingwindow,thenSOCFAR
simplytakesthesmallerofthetwo.[5].SOCACFARworksbyselectingthesmallerof
thesumoftheleadingandlaggingwindows(figure3.12).Thisprocedurerequiresa
thresholdmultiplierdifferentfromCACFAR:

Asthereisnoanalyticalsolutionfor
SO
,itistobesolvedanalyticallyfromtheabove
equation.
Inthehomogeneouscase,thealgorithmcansuccessfullyholdforthedesigned
probabilityoffalsealarm(Figure3.13).ItsProbabilityofDetectionandCFARlossis
onlyslightlyworsethanCACFAR(Figures3.14,3.15).Thedifferencecanbeaccounted


x
Threshold Multiplier
Threshold
Min
Figure3.12.SOCACFARBlockDiagram
1
/ 2
2
0
1 1
2 2
2
2 / 2 / 2
N
N k
SO SO
FA
k
N
k
P
N N
k
o o


=

| |
+
| | | |
|
= + +
`
| |
|
\ . \ .

\ .
)

32
0 5 10 15 20 25 30
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-2
10
-1
10
0
Threshold Multiplier
P
r
o
b
a
b
i
l
i
t
y

o
f

F
a
l
s
e

A
l
a
r
m
p
FA


Theoretical P
FA
Experimental P
FA
bySOCACFARusingonlyhalfitsreferencewindows(thesmalleroftheleadandlag)to
estimatethenoiseorcluttermean.
Inprobabilityofdetection,forthemultipletargetcase,SOCACFARout
performsCACFAR(Figure3.16).SOCACFARfollowstheshapeoftheNeymanPearson
detector.ImprovementoverCACFARbeginspastSNR=10dBforSOCACFAR.Inboth
PDandCFARloss,SOCACFARissimilartoOrderedStatisticsCFAR(OSCFAR)initsad
vantagesoverCACFAR(Figure3.17).
Figure3.13.SOCACFARExperimentalv.TheoreticalP
FA

33
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Signal to Noise Ratio (dB)
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n


Neyman-Pearson
CA-CFAR
OS-CFAR
SOCA-CFAR
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Signal to Noise Ratio (dB)
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n


5 10 15 20
0
0.5
1
1.5
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)


CA-CFAR
OS-CFAR
SOCA-CFAR
5 10 15 20
0
0.5
1
1.5
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)


Figure3.14.SOCACFARHomogeneousP
D
.
Figure3.15.SOCACFARHomogeneousCFARLoss
34
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Signal to Noise Ratio (dB)
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n

Neyman-Pearson
CA-CFAR
OS-CFAR
SOCA-CFAR
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Signal to Noise Ratio (dB)
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n

5 10 15 20
0
1
2
3
4
5
6
7
8
9
10
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)

CA-CFAR
OS-CFAR
SOCA-CFAR
5 10 15 20
0
1
2
3
4
5
6
7
8
9
10
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)

Figure3.16.SOCACFAR1MaskingTargetProbabilityofDetection
Figure3.17.SOCACFAR1MaskingTargetCFARLoss
35
WhereasSOCACFARshowedresistancetotargetmasking,itisespeciallyvul
nerabletotheclutterwallenvironment(Figure3.18).Neartheclutteredgetransition,
theprobabilityoffalsealarmiselevatedbyover10
3
timesoverthatofthedesign
point!Thisisover10timesworsethanCACFAR.
Inpractice,thisclutterwallweaknessofSOCACFARrendersitunpractical.
However,aswewillseeinthenextchapter,thephilosophyofSOCACFARmaybeuse
fulifutilizedinaenvironmentspecificfashion.
0 5 10 15 20 25 30
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-2
10
-1
10
0
Number of Reference Cells in Clutter
P
r
o
b
a
b
i
l
i
t
y

o
f

F
a
l
s
e

A
l
a
r
m


CA-CFAR
OS-CFAR
SOCA-CFAR
Figure3.18.SOCACFARClutterWallProbabilityofFalseAlarm
36
3.7ARemedyforClutterWalls:GreatestOfCellAveragingCFAR
GreatestOfCellAveraging(GOCA)CFARwasamethoddesignedtoavoidthe
elevatedfalsealarmproblemofclutterwalls[6].Thealgorithmworksbysumming
eachoftheleadingandlaggingwindowandtakingthelargerofthetwotobeused
withthethresholdmultiplier(Figure3.19).
Thethresholdmultipliercanbesolvedfromthisequation:

Sinceananalyticalequationdoesntexistfor
GO
,itmustbesolvednumerically.
Inahomogeneousenvironment,thethresholdmultiplierwasshowntobesuc
cessfullymaintainingthedesiredfalsealarmrate(Figure3.20).
TheprobabilityofdetectionprofileforGOCACFARinthehomogeneousenvi
ronmentcloselymatchesCACFAR(Figure3.21).ThesmalladditionalCFARlossof


x
Threshold Multiplier
Threshold
Max
Figure3.19.GOCACFARBlockDiagram
1
/ 2 / 2
2
0
1 1 1
1 2 2
2
2 / 2 2 / 2 / 2
N
N N k
GO GO GO
FA
k
N
k
P
N N N
k
o o o


=

| |
+
| | | | | |
|
= + + +
`
| | |
|
\ . \ . \ .

\ .
)

37
2 4 6 8 10 12 14 16 18 20
10
-7
10
-6
10
-5
10
-4
10
-3
10
-2
10
-1
10
0
Threshold Multiplier
P
r
o
b
a
b
i
l
i
t
y

o
f

F
a
l
s
e

A
l
a
r
m
FA


Theoretical P
FA
Experimental P
FA
Figure3.20.GOCACFARHomogeneousProbabilityofFalseAlarm
GOCACFARcanbeaccountedforbythefactthattheCFARonlyaveragesfromhalfthe
availablereferencewindows(theleadingorlagging)asopposedtoCACFARthat
makesuseofthefullsetofreferencewindows.
Inthemaskingtargetcase,GOCACFARperformsworsethanCACFAR(Figure
3.23).Thealgorithmsuffersasmuchasa2dBCFARlossoverCACFAR(Figure3.24).Ifa
maskingtargetexists,itwilleitherelevatetheaverageoftheleadingorlaggingwin
dow.SinceGOCACFARtakesthelargerofthetwowindows,itwillalwaystakethewin
dowartificiallyelevatedbythemaskingtarget.
ItisintheclutterwallenvironmentthatGOCACFARvastoutperformsthatof
CACFAR(Figure3.25).Attheclutterwall,GOCACFARonlysuffersarounda10fold
increaseinP
FA
whileCACFARsuffersa100foldincrease.OverCACFAR,thistranslates
38
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Signal to Noise Ratio (dB)
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n


Neyman-Pearson
CA-CFAR
OS-CFAR
GOCA-CFAR
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Signal to Noise Ratio (dB)
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n


5 10 15 20
0
0.5
1
1.5
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)
g


CA-CFAR
OS-CFAR
GOCA-CFAR
5 10 15 20
0
0.5
1
1.5
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)
g


Figure3.21GOCACFARHomogeneousProbabilityofDetection
Figure3.22GOCACFARHomogeneousCFARLoss
39
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Signal to Noise Ratio (dB)
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n

Neyman-Pearson
CA-CFAR
OS-CFAR
GOCA-CFAR
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Signal to Noise Ratio (dB)
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n

5 10 15 20
0
2
4
6
8
10
12
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)

CA-CFAR
OS-CFAR
GOCA-CFAR
5 10 15 20
0
2
4
6
8
10
12
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)

Figure3.23.GOCACFARProbabilityofDetectionwith1MaskingTarget
Figure3.24.GOCACFARCFARLosswith1MaskingTarget
40
0 5 10 15 20 25 30
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-2
10
-1
10
0
Number of Reference Cells in Clutter
P
r
o
b
a
b
i
l
i
t
y

o
f

F
a
l
s
e

A
l
a
r
m


CA-CFAR
OS-CFAR
GOCA-CFAR
Figure3.25.GOCACFARClutterWallP
FA

toroughlya10foldimprovementforGOCACFAR.
GOCACFARis,inmanyways,thecomplementtoSOCACFAR.WhereasSOCA
CFARimprovesoverCACFARinmultipletargetsbutsuffersinclutterwall,GOCACFAR
suffersinmultipletargetsbutimprovesinclutterwall.
41
Chapter4
VariabilityIndexCFAR
VariabilityIndexCFAR(VICFAR)dynamicallyswitchesbetweenCACFAR,SOCA
CFAR,andGOCACFARdependingonthemeanandthedistributionofcellsinthelead
ingandthelaggingwindows[7].Thisapproachcapturesparticularadvantagesofeach
ofthethreeCFARapproacheswhileavoidingtheirrespectiveweaknesses.

4.1Implementation
Foreachoftheleadingwindowandthelaggingwindow,themeanandthevari
abilityindexiscomputed.
Thevariabilityindex(VI)isasecondorderstatisticsthatiscloselyrelatedtoan
estimateoftheshapeparameter.Thegreaterthevariabilityindex,thegreaterthevari
abilityinrelativesmagnitudesofthereferencecells.When,forinstance,aleading
windowcontainsthehighpowersoftargets,thevariabilitywoulddifferentiallyweigh
Figure4.1.VICFARBlockDiagram


x
Threshold Multiplier
Threshold
()
2

Logic
()
2

42
thetargetpoweroverthatofthelowerpowersofthenoiseandmagnitude,resulting
inalargervariabilityindex.
Thevariabilityindexmaybecalculatedbythisequation:

Here,X
i
isthepowerofreferencecelli.ThesummationistakenoverallcellsXiofei
thertheleadingorthelaggingwindow.
OncetheVIiscomputed,thealgorithmthenmakesadeterminationofwhether
theleadingand/orthelaggingwindowsarevariable.Ifthevariabilityindexissmaller
thanvariabilityindexconstantK
VI
,thenthewindowisdeclarednotvariable.Ifthevari
abilityindexislargerthanK
VI
,thenthewindowisdeclaredvariable:

TheMeanRatio(MR)isameasureofhowdifferenttheleadingandlaggingwin
dowmeansare.Itiscomputedasaratioofthesummationsofthereferencecellsof
eachwindow:

IftheMRfallswithinboundsdefinedbythemeanratioconstant,K
MR
,thentheleading
andlaggingwindowmeansaredeclaredthesame:

i
i A A
B i
i B
X
X
MR
X X
e
e
= =

( )
2
1
2
1
n
i
i
n
i
i
X
VI n
X
=
=
=
| |
|
\ .

Not Variable
Variable
VI
VI
VI K
VI K
s
>
1
Same Mean
MR MR
K MR K

s s
43
LeadingWindow
Variable?
LaggingWindow
Variable?
Different
Mean?
VICFARAdaptive
Threshold
EquivalentCFAR
Method
No No No
N

AB
CACFAR
No No Yes
N
max(
A
,
B
) GOCACFAR
Yes No
N

B
CACFAR
No Yes
N

A
CACFAR
Yes Yes
N
min(
A
,
B
) SOCACFAR
Table4.1.VICFARDecisionLogic
Illustrative
Figure
Figure4.2
CaseI
Figure4.3
CaseII
Figure4.4
CaseIII
Figure4.5
CaseIV
Figure4.6
CaseV

Ifnot,thentheyaredeclaredasdifferentmeans:

Oncethevariabilityandmeandeterminationshadbeenmade,then,according
tothelogicofTable4.1,CFARisperformedwitheitherboththeleadingandlagging
windows,oneofthem,thesmallerofthetwo,orthelargerofthetwo.
Ifonlyahalfwindowischoseneitheronlytheleadingorlaggingwindow
thenthethresholdmultiplierbecomes

Ifbothleadingandlaggingwindowsarechosen,asincaseI,thenthethresholdmulti
plierbecomes:

AlittlemorecanbeexplainedofthedifferentcasesofTable.4.1
1
or Different Mean
MR MR
MR K MR K

s >
1
/ 2
/ 2
1
N
N FA
P o

=
1
1
N
N FA
P o

=
44
Figure4.2.VICFARCaseI
0 10 20 30 40 50 60 70 80 90 100
0
10
20
30
40
50
60
70
80
90
100
Range Gates
P
o
w
e
r

(
l
i
n
e
a
r
)


Target 1
Clutter
Cell Under Test
0 10 20 30 40 50 60 70 80 90 100
0
10
20
30
40
50
60
70
80
90
100
Range Gates
P
o
w
e
r

(
l
i
n
e
a
r
)


Signal
Cell Under Test

LaggingWindow:
NotVariable
MeansimilartoLagging
LeadingWindow:
NotVariable
MeansimilartoLeading
CFARtouse:
CellAveragingCFAR
withallreferencecells
Situation:
HomogeneousEnvironment
4.2VICFARDecisionLogic
CaseI:Samemeans,bothnonvaraible
Whenboththeleadingandlaggingwindowsarenonvaraible,theyarentlikely
tocontaintargets;andwhenbothwindowshavesimilarmeans,thenthereference
windowprobablydoesntstraddleaclutteredge.Thecellundertest,then,ismost
likelyinahomogeneousenvironment.VICFAR,thus,usesCACFAR.
ThethresholdissetbysummingallreferencecellsandusingtheCACFAR
thresholdmultiplierforlengthN:
1
1
N
N FA
P o

=
45
0 10 20 30 40 50 60 70 80 90 100
0
20
40
60
80
100
120
140
160
180
200
Range Gates
P
o
w
e
r

(
l
i
n
e
a
r
)


Signal
Cell Under Test
0 10 20 30 40 50 60 70 80 90 100
0
50
100
150
Range Gates
P
o
w
e
r

(
l
i
n
e
a
r
)


Target 1
Target 2
Target 3
Cell Under Test

LaggingWindow:
NotVariable
MeansimilartoLeading
LeadingWindow:
Variable
MeansimilartoLagging
CFARtouse:
CellAveragingCFAR
withleadingwindowonly
ExampleSituation:
Interferingtargetsintheleading
window.
CaseII:LeadingWindowVariable,LaggingWindownotVariable
Avariableleadingwindowisindicativeofhighspikesofpower,andwitharea
sonablesignaltonoiseratio,thesespikesaremostlikelytheresultoftargets.Theav
eragepower,then,oftheleadingwindowwouldntbeindicativeofthenoise/clutter
contained.Inthiscase,VICFARswitchestousingCACFARwiththelaggingwindow
alone.
Asthelaggingwindowisnonvaraible,itislikelytocontainnoise/clutteronly.To
setthethreshold,allcellsinthelaggingwindowissummedandmultipliedtothe
thresholdmultiplierforwindowlengthN/2:
Figure4.3.VICFARCaseII
1
/ 2
/ 2
1
N
N FA
P o

=
46
0 10 20 30 40 50 60 70 80 90 100
0
20
40
60
80
100
120
140
160
180
200
Range Gates
P
o
w
e
r

(
l
i
n
e
a
r
)


Signal
Cell Under Test
0 10 20 30 40 50 60 70 80 90 100
0
50
100
150
Range Gates
P
o
w
e
r

(
l
i
n
e
a
r
)


Target 1
Target 2
Target 3
Cell Under Test

LaggingWindow:
NotVariable
MeansimilartoLeading
LeadingWindow:
Variable
MeansimilartoLagging
CFARtouse:
CellAveragingCFAR
withlaggingwindowonly
ExampleSituation:
Interferingtargetsinthelagging
window.
CaseIII:LaggingWindowVariable,LeadingVariableNonvariable
ThisistheconversesituationofCaseII.Whenonlythelaggingwindowisvari
ableandnottheleading,thelaggingwindowislikelytocontaintargetsandtheleading
noise/clutteronly.
Inthiscase,thethresholdissetbysummingonlythereferencecellsofthe
leadingwindowandmultipliedtoaCACFARthresholdmultiplierforwindowlength
N/2:
Figure4.4.VICFARCaseIII
1
/ 2
/ 2
1
N
N FA
P o

=
47
0 10 20 30 40 50 60 70 80 90 100
0
20
40
60
80
100
120
140
160
180
200
Range Gates
P
o
w
e
r

(
l
i
n
e
a
r
)


Signal
Cell Under Test
0 10 20 30 40 50 60 70 80 90 100
0
50
100
150
Range Gates
P
o
w
e
r

(
l
i
n
e
a
r
)


Target 1
Target 2
Target 3
Cell Under Test

LaggingWindow:
Variable
MeansimilartoLeading
LeadingWindow:
Variable
MeansimilartoLagging
CFARtouse:
SmallestofCellAveraging
ExampleSituation:
Interferingtargetsinboth
leadingandlaggingwindow
CaseIV:BothWindowsVariable
Whenboththeleadingandlaggingwindowsarevariable,thenbothwindows
verylikelycontainstargets.Whicheverwindowusedislikelytoresultintargetmask
ing.VICFAR,then,seekstominimizethemaskingbytakingthesmallerofthesumsof
theleadingandthelaggingwindows.Thethresholdissetbymultiplyingthissmaller
sumtoaCACFARthresholdmultiplierforwindowlengthN/2:
Figure4.5.VICFARCaseIV
1
/ 2
/ 2
1
N
N FA
P o

=
48
0 10 20 30 40 50 60 70 80 90 100
0
50
100
150
200
250
Range Gates
P
o
w
e
r

(
l
i
n
e
a
r
)


Noise/Clutter
Cell Under test
0 10 20 30 40 50 60 70 80 90 100
0
10
20
30
40
50
60
70
80
Range Gates
P
o
w
e
r

(
l
i
n
e
a
r
)


Noise/Clutter
Cell Under test

LeadingWindow:
NotVariable
Meandifferentfromleading
LeadingWindow:
NotVariable
Meandifferentfromlagging
Use:
GreatestofCellAveraging
ExampleSituation:
Nearclutterwall.Canbeon
eitheredgeoftheclutteredge.
CaseV:NotVariablebutDifferentMean
Whenboththeleadingandlaggingvariablesarenonvariablebutdifferentin
mean,thenthecellundertestisverylikelynearaclutterwall.ThegoalforVICFAR,in
thiscase,istosetthethresholdbythehigheredgeoftheclutterwall.
Thethresholdissetbytakingthelargerofthesumsoftheleadingandlagging
windowandmultipliedtotheCACFARthresholdmultiplierforwindowlengthofN/2:
Figure4.6.VICFARCase
1
/ 2
/ 2
1
N
N FA
P o

=
49
4.3HomogeneousEnvironment
4.3.1ProbabilityofFalseAlarm
Inahomogeneousenvironment,VICFARlargelyrevertstoCACFARanduses
theCACFARthresholdmultiplier(Figure4.8).Inthethresholdplot,weseethatthe
thresholdofVICFARalmostentirelyoverlapswiththatofCACFAR.Thediscrepancy
nearandaroundthetargetwithCACFARdisplayingitsdistinctiveelevatedthreshold
plateausnearthetargetandVICFARwithnosuchdisplaycanbeaccountedforby
thedecisionlogicofVICFAR.TheCUTsN/2cellsinfrontofandN/2cellsbehindthe
targetwillinterpretthetargetasamaskingtarget,andswitchtousingonlythelagging
andtheleadingwindowsrespectivelyinthecomputationofCACFAR.
0 10 20 30 40 50 60 70 80 90 100
0
5
10
15
20
Range Gates
M
a
g
n
i
t
u
d
e

(
d
B
)


CA-CFAR
OS-CFAR
VI-CFAR
Recieved Waveform
Figure4.8.VICFARThresholdinHomogeneousEnvironment.
50
2 4 6 8 10 12 14 16 18 20 22
10
-7
10
-6
10
-5
10
-4
10
-3
10
-2
10
-1
Threshold Multiplier
P
r
o
b
a
b
i
l
i
t
y

o
f

F
a
l
s
e

A
l
a
r
m
FA


Theoretical P
FA
Experimental P
FA
Figure4.9.VICFARTheoreticalv.ExperimentalP
FA
inHomogeneousEnvironment
Notsurprisingly,inthehomogeneousenvironment,VICFARsuccessfullyholds
theprobabilityoffalsealarmlikeCACFAR(Figure4.9).

4.3.2ProbabilityofDetection
Acrossvarioussignaltonoiseratios,weseethatinthehomogeneousenviron
ment,CACFARconsistentlyslightlyoutperformsVICFAR(Figure4.10).Thisslightdis
crepancyistobeexpectedsince,duetotherandomdistributionofthenoise/clutter,
VICFARmayveryrarelymisinterpretthehomogeneousenvironmentasaTypeII,III,
IV,orVenvironment.Inthesecases,VICFARswitchestousingonlyitsleadingorlag
gingwindowsintheestimationofthenoise.
InCFARloss,thistranslatestoabouta0.25dBlossacrossallSNRs.
51
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Signal to Noise Ratio (dB)
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n

Neyman-Pearson
CA-CFAR
OS-CFAR
VI-CFAR
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Signal to Noise Ratio (dB)
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n

5 10 15 20
0
0.5
1
1.5
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)

CA-CFAR
OS-CFAR
VI-CFAR
5 10 15 20
0
0.5
1
1.5
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)

Figure4.9.VICFARProbabilityofDetectionCurve
Figure4.10.VICFARCFARLossinHomogeneousEnvironment
52
0 10 20 30 40 50 60 70 80 90 100
0
5
10
15
20
25
Range Gates
M
a
g
n
i
t
u
d
e

(
d
B
)


CA-CFAR
OS-CFAR
VI-CFAR
Recieved Waveform
Figure4.11.VICFARThreshold1MaskingTarget.
4.4MaskingTargets
Withthevariabilityindex,VICFARmayreliablypredictthepresenceofmasking
targetsintheleadingwindow,thelaggingwindow,orbothwindowsandappropriately
adjusttouseofthelaggingwindowortheleadingwindow.
TheVICFARthresholdwassimulatedforatwotargetenvironment(Figure
4.11).Itsuccessfullydetectsbothtargets.Inthegraph,OSCFARalsoallowedforde
tectionofbothtargets.CACFAR,incontrast,detectsonlythebin42target;settingthe
thresholdtoohighforthebin37target.
VICFARsresistancetotargetmaskingintwotargetenvironmentsisclearinits
probabilityofdetectioncurve(Figure4.12).Formostsignaltoratiovalues,theprob
abilityofdetectionforVICFARisonlyslightlylowerthanthatofOSCFAR.CACFAR,
53
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Signal to Noise Ratio (dB)
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n


Neyman-Pearson
CA-CFAR
OS-CFAR
VI-CFAR
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Signal to Noise Ratio (dB)
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n


Figure4.12.VICFARProbabilityofDetectionwith1MaskingTarget
meanwhile,showsitusuallossinprobabilityofdetectionwittargetmasking.
VICFARitself,however,beginstosuffermaskingeffectswhentherearemore
thanoneinterferingtarget(Figure4.13).WhereastheCFARlossofeitherhomogenous
andoneinterferingVICFARislessthan1dB,theCFARlossfortwoandthreeinterfer
ingtargetsincreasetoasmuchas10dB(Figure4.14).Howcanweaccountforsuchdis
parateresults?
WhentwomaskingtargetsarerandomlyplacedaroundaCUT,partofthetime,
therewillbeoneintheleadingwindowandoneinthelaggingwindow.Inthiscase,no
matterwhichwindowisselected,therewillbeamaskingeffectfortheCUT(Figure
4.15).Inthiscase,VICFARonlymollifiestheeffectbyswitchingtoSOCACFAR.
Ontheotherhand,whenbothinterferingtargetsaretogether,eitherinthe
54
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n
Signal to Noise Ratio (dB)


0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n
Signal to Noise Ratio (dB)
Neyman Pearson
homogeneous
one masking target
two masking targets
three masking targets
5 10 15 20
0
2
4
6
8
10
12
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)

5 10 15 20
0
2
4
6
8
10
12
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)
homogeneous
one masking target
two masking targets
three masking targets
Figure4.13.VICFARProbabilityofDetectionCurvewithvaryingNumbersofMaskingTarget
Figure4.14.VICFARCFARLossCurvewithvaryingNumbersofMaskingTarget
55
leadingorthelaggingwindow,VICFARcanentirelyavoidtheirmaskingeffectsbyse
lectingtheotherwindow.Thedifferencescanbeprofound.InFigure4.16,theprob
abilityofdetectioniscomputedfordifferentdistributionsoftwomaskingtargets.
56
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n
Signal to Noise Ratio (dB)


0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n
Signal to Noise Ratio (dB)
Neyman-Pearson
Mean P
D
Targets 1,3
Target 2
Figure4.16.VICFARProbabilityofDetectionwithThreeMaskingTargets
0 10 20 30 40 50 60 70 80 90 100
0
50
100
150
Range Gates
P
o
w
e
r

(
l
i
n
e
a
r
)
Target3:
WhentheCUTreacheshere,
VICFARtakesonlytheleadingwin
dowforCACFAR
Target1:
WhentheCUTreaches
here,VICFARtakes
onlythelagging
windowforCACFAR
Target2:
WhentheCUTreacheshere,
VICFARusesSOCACFAR.
Figure4.15.ThreeTargets
57
0 10 20 30 40 50 60 70 80 90 100
0
5
10
15
20
25
30
Range Gates
M
a
g
n
i
t
u
d
e

(
d
B
)


CA-CFAR
OS-CFAR
VI-CFAR
Recieved Waveform
Figure4.17.VICFARThresholdinClutterWallTransition.
4.5ClutterWall
4.5.1ProbabilityofFalseAlarm
WhenVICFARdetectsaclutterwallatypeVcaseitswitchestousingto
GOCACFAR.Thealgorithmusesthegreaterofthesumoftheleadingandlaggingwin
dowinitscellaveragingCFARcomputation.
Insettingthethresholdthiswaytherearetwoconsequences:Leadingintothe
clutterwall,theVICFARthresholdslopesupwardsearlierandmoresteeplythanCA
CFAR,andaftertheclutterwall,theVICFARhasalreadystoppedslopingandachieved
asufficientlyhighthreshold(Figure4.17).
Thiseffectstranslatestogoodmaintenanceoftheprobabilityoffalsealarm
(Figure4.18).WeseethatVICFARsufferslessthana10foldincreaseinP
FA
.from10
4
Greaterthreshold
clearanceforVICFAR
VICFARthresholdincreases
earlierandmoresteeply
thanCACFARorOSCFAR
58
0 5 10 15 20 25 30
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-2
10
-1
10
0
Number of Reference Cells in Clutter
P
r
o
b
a
b
i
l
i
t
y

o
f

F
a
l
s
e

A
l
a
r
m


CA-CFAR
OS-CFAR
VI-CFAR
Figure4.18.VICFARClutterWallProbabilityofFalseAlarm.
tolessthan10
3
.CellaveragingandOrderedStatisticsCFAR,incontrast,suffersa100
foldincreaseinP
FA
.

4.5.2ProbabilityofDetection
ThedrawbackofVICFARsclutterwallstrategyisagreaterdropprobabilityof
detectionthanCACFARorOSCFAR(Figure4.19).Weseethatforallcellsunderclut
ter,theprobabilityofdetectionforVICFARislessthanthatofCACFARandOSCFAR.
Thisisaresultoftwoseparateeffects:thresholdsettoohighbeforetheclutterwall,
andthresholdsetcorrectlyaftertheclutterwall.
DuetoVICFARsGOCACFARclutterwallstrategy,thethresholdsetbeforethe
clutterwallissetbythegreateroftheleadingandlaggingwindowsums.Thismeans
59
0 5 10 15 20 25 30
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Number of Reference Cells in Clutter
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n


CA-CFAR
OS-CFAR
VI-CFAR
N/2 cells in clutter
Figure4.19.VICFARClutterWallProbabilityofDetection.
thatthesetthresholdwillbebased,inpart,onthelargerpowersoftheclutterregion.
Thiselevatesthethresholdmuchhigherthanthelevelnecessarytomaintainthede
siredP
FA
of10
4
.
Aftertheclutterwall,whenmorethan16cellsareunderclutter,allthree
CFARsexperiencealowprobabilityofdetection.Thisistobeexpected.Inthesere
gionsoftheclutterwall,insteadofnoise,thetargetisinaclutterbackground.Since
thecluttertonoiseratio(CNR)ismuchsmallerthanthesignaltonoiseratio(SNR),the
probabilityofdetectionforanyCFARwouldbelower.
ThedetectionofCACFARandOSCFARishigherthanVICFARaftertheclutter
wallbecausetheirthresholdsweresettoolowsolowthatthePFAismuchgreater
thanthedesigned10
4
point.
60
( ) ( ) ( ) ( ) ( ) 1 2 3 k N
x x x x x s s s s s s
( )

OS k
T a x =
CHAPTER5
ORDEREDSTATISTICSCFAR
CellaveragingCFARwasthefirstoftheCFARmethods.Assuminghomogene
ousGaussianwhitenoise,throughaslidingwindow,CACFARestimatesthenoiselevel
ofthecellundertest,CUT,throughanarithmeticsumofNadjacentcells.Inheteroge
neousenvironments,however,CACFARperformancerapidlydegrades.
OrderedStatisticsCFAR,OSCFAR,hadbeendevelopedtocompensatefor
muchofCACFARspitfalls.Ratherthantakingthearithmeticmeanofadjacentcells,
OSCFARrankstheNadjacentcellsfromsmallesttolargestandmultipliesthek
th
larg
estcelltotheappropriatethresholdmultipliertosetthethresholdlevel.

5.1Implementation
Eachreferencecellissortedfromsmallesttobiggest:

Thek
th
largestcellismultipliedwiththecorrespondingthresholdmultipliertogetthe
desiredthreshold:

Thek
th
rankedcellcouldbethemedianrankedvalueoreventhelargestvalue.As
simulationswillshow,thelargerx
(k)
,thesmallertheCFARlossinhomogeneousenvi
ronmentbutthelesstheresistancetotargetmaskingandclutteredgetransition.
61

Sort
1
2
k
N
x
x
x
x









x
Threshold Multiplier
Threshold
Figure5.1.OSCFARBlockDiagram
( )
!
! !
N
N
k k N k
| |
=
|

\ .
( )
( ) ( )
/ 2
/ 2
!
! !
C
OS
FA
C
OS
N k
N
P
k N k M
o
o
+
| |
=
|
+
\ .
1
D OS
OS
o
o
;
=
+
ThroughasquarelawdetectorandinabackgroundwithGaussianWhiteNoise,
thethresholdmultiplier
OS
maybefoundfromthisequation:

Withthebinomialgivenby:

Here,Nisthetotalnumberofreferencecells;kistherankoftherepresentativecell
used,P
FA
isthedesiredprobabilityoffalsealarm,
OS
isthethresholdmultiplierand()
istheGammafunction.
Thetheoreticalprobabilityofdetectionisgivenby:

62
5.2Homogeneous
5.2.1ProbabilityofFalseAlarm
Usingawindowsizeof32andak
th
rankof22(kchosenfor0.7N),thresholds
multiplierswereusedtosetandsimulatedforprobabilityoffalsealarmsbetween10
1

and10
7
(Figure4.2).Theexperimentalprobabilityoffalsealarmconformedwiththeo
reticalexpectation(Figure5.2).

5.2.2Detection
Theorderedstatisticsthreshold,ingeneral,ishigherthanthecellaveraging
thresholdforthesamedesignedprobabilityoffalsealarm(Figure5.2).Thishigher
2 4 6 8 10 12 14 16 18 20 22
10
-7
10
-6
10
-5
10
-4
10
-3
10
-2
10
-1
Threshold Multiplier
P
r
o
b
a
b
i
l
i
t
y

o
f

F
a
l
s
e

A
l
a
r
m
FA


Theoretical P
FA
Experimental P
FA
Figure5.2.OSCFARHomogeneousP
FA
.
63
thresholdresultsfromslightlysmallerreliabilityofanorderedstatisticsestimationsas
versusameanestimationoftheaveragenoise(Figure5.3).Intheprobabilityofdetec
tioncurve,thistranslatestoaslightlysmallerP
D
(Figure5.4).
Amongstorderedstatisticscurvesofthesamewindowlength,IntheCFARloss
curve,thek
th
rankedcellchosenforthethresholdmultiplieralsoaffectsperformance.
Inahomogeneousenvironment,ingeneral,thehigherthek
th
valueused,theslightly
bettertheprobabilityofdetectionandthesmallertheCFARloss.
Intheprobabilityofdetectioncurve,forawindowsizeof32,k=0.9N(ork=29)
gavealowerCFARlossabouthalfadBlowerthanthatofk=0.5N(Figure5.5).There
sultsfor0.9Nwasalsoabout0.1dBbetterthanthatof0.7N.Allresults,however,had
atleasthalfadBofCFARlossasmuchasthecellaveragingCFARofthesamewindow
length.
0 10 20 30 40 50 60 70 80 90 100
0
5
10
15
20
Range Gates
M
a
g
n
i
t
u
d
e

(
d
B
)


CA-CFAR
OS-CFAR
Recieved Waveform
Figure5.3.OSCFARThresholdinHomogeneousEnvironment.
64
Figure5.4.OSCFARHomogeneousProbabilityofDetection
Figure5.5.OSCFARHomogeneousCFARLoss
5 10 15 20
0
0.5
1
1.5
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)

CA-CFAR
OS-CFAR k=0.5 N
OS-CFAR k=0.7 N
OS-CFAR k=0.9 N
5 10 15 20
0
0.5
1
1.5
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)

0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1


Neyman-Pearson
CA-CFAR
OS-CFAR k=0.5 N
OS-CFAR k=0.7 N
OS-CFAR k=0.9 N
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1


65

k
th
cell
Nk1buffercells
smallest largest
Nreferencecells
Figure5.6.OSCFARResistancetoMultipleTargets
5.3MultipleTargets
OrderedstatisticsCFARoffersnaturalresistancetotargetmasking.Withcell
averagingCFAR,anytargetwithinthereferencecellgetsaddedtobemultipliedwith
thethresholdmultiplier.Ifthesignaltonoiseratiois10dB,theestimatednoisemay
beasmuchas50%greater.
Withorderedstatistics,sinceonlytherankedk
th
valueisselected,interfering
targetsdon'tdirectlyaffectthethresholdmultiplier.Sincetargetpowersaretypically
muchgreaterthannoiseorclutterpower,whenranked,theyfindthemselvesbelow
thekvalue.Thecellslargerthanthek
th
cell,inthereferencethen,actasakindof
bufferagainsttargetmasking.Ifthenumberofbuffercellsexceedthenumberofinter
feringtargets,thenOSCFARcanescapedirectlyinfluenceofmaskingtargets.Also,
evenwhentherearelesstargetsthanbuffercells,thelesstargetstherearelessindi
rectinfluencethek
th
cellwillfeelfromthetarget.
Figure5.7showsanexampleofaOSCFARthresholdinthemultipletargetcase.
Asisevident,OSCFARdrawsathresholdlowenoughtodetectbothtargets.CACFAR,
66
0 10 20 30 40 50 60 70 80 90 100
0
5
10
15
20
25
Range Gates
M
a
g
n
i
t
u
d
e

(
d
B
)


CA-CFAR
OS-CFAR
Recieved Waveform
Figure5.7OSCFARThresholdwith1MaskingTarget.
ontheotherhand,missesdetectionofonetarget.
Withonemaskingtarget,theprobabilityofdetectioncurveofOSCFARfollows
thecontouroftheNeymanPearsondetector(Figure5.8).Thecellaveragingdetection
beginstosuffermajordetectiondegradationbeyondanSNRofabout10dB.Theselec
tionofdifferentkvalues,0.5N,0.7N,or0.9N(orkof16,22,and29respectivelyfora
windowsizeofN=32)ledtonomajordifferencesindetectionprobability.TheCFAR
lossesforeachkvalueselectionwerenomorethan0.5dBdifferentfromoneanother
(Figure5.9).
Incontrasttothehomogeneouscase,k=0.7Nproducedbetterdetectionand
CFARlossvaluesthank=0.9N.Thereason,mostlikelyisthatthebuffercellsallowedby
k=0.7Nweremoreadequatelyinsulatingthanthatofk=0.9N.
67
Figure5.8.OSCFARProbabilityofDetectionwith1MaskingTarget
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Probability of Detection
C
F
A
R

L
o
s
s

(
d
B
)


Neyman-Pearson
CA-CFAR
OS-CFAR k=0.5 N
OS-CFAR k=0.7 N
OS-CFAR k=0.9 N
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1


Figure5.9.OSCFARCFARLosswith1MaskingTarget
5 10 15 20
0
0.5
1
1.5
2
2.5
3
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)


CA-CFAR
OS-CFAR k=0.5 N
OS-CFAR k=0.7 N
OS-CFAR k=0.9 N
5 10 15 20
0
0.5
1
1.5
2
2.5
3
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)


68
Withthreemaskingtargets,theprobabilityofdetectionfork=0.9Nbecame
noticeablyworsethanthatofk=0.9Nwhilek=0.5Ncontinuedtogiveonlyavery
slightlylessdetectioncurvethank=0.9N(Figure5.10).InCFARloss,k=0.9Ngottoas
muchasnearly2dBworseforSNRof25dBthank=0.7N.TheCFARlossdifferencebe
tween0.7Nand0.5Nwasabout0.25dBthroughouttherangeofSNRssimulated.
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Probability of Detection
C
F
A
R

L
o
s
s

(
d
B
)


Neyman-Pearson
CA-CFAR
OS-CFAR k=0.5 N
OS-CFAR k=0.7 N
OS-CFAR k=0.9 N
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1


Figure5.10OSCFARProbabilityofDetectionwith3MaskingTarget
69
5 10 15 20
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)


CA-CFAR
OS-CFAR k=0.5 N
OS-CFAR k=0.7 N
OS-CFAR k=0.9 N
5 10 15 20
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)


Figure5.11.OSCFARCFARLosswith3MaskingTarget
70
0 10 20 30 40 50 60 70 80 90 100
0
5
10
15
20
25
30
Range Gates
M
a
g
n
i
t
u
d
e

(
d
B
)


CA-CFAR
OS-CFAR
Recieved Waveform
Figure5.12.OSCFARinClutterWallThreshold.
5.5ClutterWall
OrderedStatisticsCFARperformssimilarlytocellaveragingCFARattheclutter
wall.Bothalgorithmsonlygraduallyslopeupwardstheirthresholdsapproachingthe
clutterwall,andpasttheclutteredge,thethresholdsofbothalgorithmsgetaslowas
tofrequentlyallowfalsealarms(Figure5.12).
OSCFARalgorithmsselectedfordifferentrankedk
th
valuesperformdifferently
attheclutterwall.Ingeneral,thegreaterthek,thelesstheprobabilityoffalsealarm
willincreaseattheclutteredge.CellaveragingCFARforwindowlength32,attheclut
terwall,suffersroughlya100foldincreaseinfalsealarmrate:fromthedesigned10
4
tonearly10
2
(Figure5.13).OrderedStatisticsCFARfork=0.5*N(k=16)andk=0.7*N
71
Figure5.13.OSCFARClutterWallProbabilityofFalseAlarm
(k=22)actuallyperformworsethanCACFARsufferingafalsealarmratethatsnearly
athousandtimesmorethanwhatwasdesired!OSCFARfork=0.9*N,incontrast,im
proveduponCACFAR,withafalsealarmratethatsonlybetween10timesand100
timesthedesignedrateof10
4
.
Probabilityofdetectionperformanceattheclutterwallforthevariouskvalue
isreversedfromthatforprobabilityoffalsealarm.Thesmallerthekvalue,thelessthe
targetmaskingeffectbeforetheclutterwall.K=0.5Ngavebetterdetectionresultsthan
k=0.7N,andk=0.9N.
0 5 10 15 20 25 30
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-2
10
-1
10
0
Number of Reference Cells in Clutter
P
r
o
b
a
b
i
l
i
t
y

o
f

F
a
l
s
e

A
l
a
r
m


CA-CFAR
OS-CFAR k=0.5*N
OS-CFAR k=0.7*N
OS-CFAR k=0.9*N
72
Figure5.14.OSCFARClutterWallProbabilityofDetection

0 5 10 15 20 25 30
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Number of Reference Cells in Clutter
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n


CA-CFAR
OS-CFAR k=0.5*N
OS-CFAR k=0.7*N
OS-CFAR k=0.9*N
73
Chapter6
OrderedStatisticsGreatestOfCFAR
AlthoughOSCFARworkswellinavoidingthedrawbacksoftargetmasking,it
costsmorethanCACFARtoimplementanditsuffersmorefalsealarmsthanCACFAR
attheclutterwall.OrderedStatisticsGreatestOfCFAR(OSGOCFAR)representsanat
tempttokillbothproblemswithonestone.

6.1Implementation
OSGOCFARoperatessimilarlytoOSCFARinitssortingofreferencecells.The
difference,though,isthatinOSGOCFAR,theNreferencecellsoftheleadingwindow
andthelaggingwindowaresortedindependently,intotwoN/2sublists(Figure6.1).
Thek
th
largestcellsofthetwosublistsarecompared,andthelargerofthetwoare

Rank Order
x
Threshold Multiplier
Threshold
Rank Order
1
2
/ 2
k
N
y
y
y
y









1
2
/ 2
k
N
x
x
x
x









Max
Figure6.1.OSGOCFARBlockDiagram

( ) ( ) ( )
( )
2
2
2 2
2
0 0
1 1
2
2 2 2
1
2
N N
k k N k j i
OSGO
FA
j i
N N N
N j i k k
P k
N
N j i
i
k j i
o
o

= =
| | | | | |
I I +
| | |
=
| | |
I + +

\ . \ . \ .

usedwiththethresholdmultipliertosetthethreshold.
Thethresholdmultiplierisgivenbythisequation:

Asnoanalyticalexpressionforthresholdmultiplierexists,itmustbesolvednumeri
cally.
Figure6.2.OSGOCFARThresholdinHomogeneousEnvironment.
0 10 20 30 40 50 60 70 80 90 100
0
5
10
15
20
Range Gates
M
a
g
n
i
t
u
d
e

(
d
B
)


CA-CFAR
OS-CFAR
OSGO-CFAR
Recieved Waveform
6.2Homogeneous
Inthehomogeneousenvironment,OSGOCFARsetsitsthresholdverysimilarly
toOSCFAR.Neithermethodgivestheelevatedthresholdplateausaroundtargets.
75
0 5 10 15 20 25
10
-7
10
-6
10
-5
10
-4
10
-3
10
-2
10
-1
10
0
Threshold Multiplier
P
r
o
b
a
b
i
l
i
t
y

o
f

F
a
l
s
e

A
l
a
r
m
p
FA


Theoretical P
FA
Experimental P
FA
Figure6.3.OSGOCFARHomogeneousP
FA
.
6.2.1ProbabilityofFalseAlarm
ToverifythattheOSGOCFARworksinlimitingnoise/cluttertothedesired
probabilityoffalsealarm,thealgorithmwassimulatedtoanumberofdesiredPFA
from10
1
toabout10
7
.Themeasuredprobabilityoffalsealarmconformedwellwith
expectedresults.

6.2.2Detection
Inprobabilityofdetections,OSGOCFARperformscomparativelywithOSCFAR
(Figure6.4).LikeOSCFAR,OSGOCFARgivesaCFARlossgreaterthanthatofOSCFAR.
ForCFARalgorithmsofequalwindowlength,OSGOCFARalwaysgavehigherCFARloss
76
Figure6.4.OSGOCFARHomogeneousP
D

0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Probability of Detection
C
F
A
R

L
o
s
s

(
d
B
)


Neyman-Pearson
CA-CFAR
OS-CFAR k=0.7*N
OSGO-CFAR k=0.5*N/2
OSGO-CFAR k=0.7*N/2
OSGO-CFAR k=0.9*N/2
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1


thanOSCFAR.AlsolikeOSCFAR,thegreatertherankedk
th
valuetakenforthethresh
oldmultiplier,thelesstheCFARloss(Figure6.5).TheCFARlossforOSGOCFAR
k=0.7*N/2andk=0.9*N/2werewithin0.2dBoftheCFARlossfork=0.7*NofOSCFAR.
77
Figure6.5.OSGOCFARHomogeneousCFARLoss
5 10 15 20
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)


CA-CFAR
OS-CFAR k=0.7*N
OSGO-CFAR k=0.5*N/2
OSGO-CFAR k=0.7*N/2
OSGO-CFAR k=0.9*N/2
5 10 15 20
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)


78

k
th
cell
N/2k1buffercells
smallest largest
N/2referencecells
Figure6.6.OSGOCFARResistancetoMultipleTargets
6.3MultipleTargets
Usingorderedstatistics,OSGOCFAR,likeOSCFAR,offersstrongresistance
againsttargetmasking.However,duetothek
th
cellbeingtakenfromthelargerofthe
sortedleadingorlaggingwindow,theamountofmultipletargetresistanceisdimin
ished(Figure6.6).SinceOSGOCFARonlytakeskfromhalfafullwindow,thereisonly
0 10 20 30 40 50 60 70 80 90 100
0
5
10
15
20
25
Range Gates
M
a
g
n
i
t
u
d
e

(
d
B
)


CA-CFAR
OS-CFAR
OSGO-CFAR
Recieved Waveform
Figure6.7.OSGOCFARThresholdwith1MaskingTarget.
79
Figure6.8.OSGOCFARP
D
with1MaskingTarget
N/2k1buffercellsasopposedtoNk1forOSCFAR.
ThethresholdsetforOSGOCFARlooksabitlikethatofOSCFAR(Figure6.7).
LikeOSCFAR,OSGOCFARavoidsmuchofthemaskingproblemofCACFAR.
TheprobabilityofdetectionacrossSNR=2and24showslittledifferencebe
tweenOSCFARandthetestOSGOCFARalgorithms.IntermsofCFARloss,weseethat
theOSCFARandOSGOCFARalgorithms,inthesingleinterferingtargetenvironment,
performswithin0.5dBofoneanother.
Onethingtonote,though,isthatOSGOCFARfork=0.9*N/2beginstosuffer
greaterCFARlossthanOSGOCFARfork=0.7*N/2beyondanSNRofabout5dB.Itis
clearthatforawindowsizeof32,thenumberofbuffercellsofferedbyk=N/2*0.9only
offersenoughmaskingresistanceforoneinterferingtarget.
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Probability of Detection
C
F
A
R

L
o
s
s

(
d
B
)


Neyman-Pearson
CA-CFAR
OS-CFAR k=0.7*N
OSGO-CFAR k=0.5*N/2
OSGO-CFAR k=0.7*N/2
OSGO-CFAR k=0.9*N/2
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Probability of Detection
C
F
A
R

L
o
s
s

(
d
B
)


80
Figure6.9.OSGOCFARCFARlosswith1MaskingTarget
5 10 15 20
0
0.5
1
1.5
2
2.5
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)


CA-CFAR
OS-CFAR k=0.7*N
OSGO-CFAR k=0.5*N/2
OSGO-CFAR k=0.7*N/2
OSGO-CFAR k=0.9*N/2
5 10 15 20
0
0.5
1
1.5
2
2.5
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)


Atthreemaskingtargets,weseethattheprobabilityofdetectionforOSGO
CFARofk=0.9*N/2decreasesprecipitously(Figure6.10).Thoughslightlylowerthan
theOSCFARcurve,thedetectioncurveforbothOSGOk=0.7*N/2andk=0.5*N/2both
followedthecontouroftheNeymanPearsondetector.TheCFARlossforthesetwo
curveswereabout2dBabouthalfadBmorethanOSCFAR.(Figure6.11).
81
Figure6.10.OSGOCFARP
D
with3MaskingTarget
Figure6.11.OSGOCFARCFARlosswith3MaskingTarget
5 10 15 20
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)


CA-CFAR
OS-CFAR k=0.7*N
OSGO-CFAR k=0.5*N/2
OSGO-CFAR k=0.7*N/2
OSGO-CFAR k=0.9*N/2
5 10 15 20
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
C
F
A
R

L
o
s
s

(
d
B
)
SNR (dB)


0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Probability of Detection
C
F
A
R

L
o
s
s

(
d
B
)


Neyman-Pearson
CA-CFAR
OS-CFAR k=0.7*N
OSGO-CFAR k=0.5*N/2
OSGO-CFAR k=0.7*N/2
OSGO-CFAR k=0.9*N/2
0 5 10 15 20 25
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Probability of Detection
C
F
A
R

L
o
s
s

(
d
B
)


82
0 10 20 30 40 50 60 70 80 90 100
0
5
10
15
20
25
30
Range Gates
M
a
g
n
i
t
u
d
e

(
d
B
)


CA-CFAR
OS-CFAR
OSGO-CFAR
Recieved Waveform
Figure6.12.OSGOCFARThresholdinClutterWallTransition.
6.5ClutterWall
Inpreviouschapters,weveseenhowcellaveragingCFARandorderedstatistics
CFARbothsufferfromelevatedfalsealarmratesneartheclutterwall.TheirP
FA
be
comeelevatedbyasmuchas100timesthesetP
FA
.CanOSGOCFARdobetter?
Figure6.12showstheOSGOCFARthresholdataclutterwall.comparedtoCA
CFARandOSCFAR,OSGOCFARhasamuchbetterclearanceattheclutteredge.This
translatestosignificantimprovementsforkeepingdesiredfalsealarmrates(Figure
6.12).
TheprobabilityoffalsealarmweregeneratedoveramilliontrialsforOSGO
CFARofwindowlengthN=32andk
th
rankofN/2*0.5,N/2*0.7,andN/2*0.9.Atworst,
83
Figure6.12.OSGOCFARClutterWallP
FA

0 5 10 15 20 25 30
10
-8
10
-7
10
-6
10
-5
10
-4
10
-3
10
-2
10
-1
10
0
Number of Reference Cells in Clutter
P
r
o
b
a
b
i
l
i
t
y

o
f

F
a
l
s
e

A
l
a
r
m


CA-CFAR
OS-CFAR k=0.5*N
OS-CFAR k=0.7*N
OSGO-CFAR k=0.5*N/2
OSGO-CFAR k=0.7*N/2
OSGO-CFAR k=0.9*N/2
OSGOCFARonlysuffersatenfoldincreaseformthedesignedPFAof10
4
.Thisisaten
foldimproveovercellaveragingCFAR.Theseresultsarealsocomparabletothoseof
theclutterwallfalsealarmperformancesofVICFAR(chapter4).
TheclutterwallprobabilityofdetectionperformanceforOSGOCFARcanbe
foundinfigure6.13.
84
Figure6.13.OSGOCFARClutterWallP
D

0 5 10 15 20 25 30
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Number of Reference Cells in Clutter
P
r
o
b
a
b
i
l
i
t
y

o
f

D
e
t
e
c
t
i
o
n


CA-CFAR
OS-CFAR k=0.5*N
OS-CFAR k=0.7*N
OSGO-CFAR k=0.5*N/2
OSGO-CFAR k=0.7*N/2
OSGO-CFAR k=0.9*N/2
85
Chapter7
ConclusionsandFinalAssessment
Inthecourseofourresearch,wevestudiedanumberofCFARalgorithms
eachapproachingthesameproblemofnoise/cluttermeanestimationandthreshold
settingthroughdifferenttechniques.CellAveragingCFAR(CACFAR)thoughoptimalin
thehomogeneousenvironment,suffersmajorperformativedropoffintheheteroge
neousenvironments:withmultipletargetsandtheclutterwallenvironment.
AlthoughOrderedStatisticsCFAR(OSCFAR),SmallestOfCellAveragingCFAR
(SOCFAR),andGreatestOfCellAveragingCFAR(GOCACFAR)eachremedyoneofthe
twoheterogeneousconditions,theyfailtofullyremedytheother.
Twoalgorithms,OrderedStatisticsGreatestOfCFAR(OSGOCFAR)andVariabil
ityIndexCFAR(VICFAR),balanceperformanceineachenvironmenthomogeneous,
multipletargets,andclutterwalltobepracticallyfeasible.
Figure7.1illustratesapracticalCFARenvironment.Fromit,wecanseethat
onlyOSGOCFARandVICFARdetectthehomogeneoustarget,themultipletarget,and
maketheclutterwallwithoutafalsealarm.
86
87
88
5
0
1
0
0
1
5
0
2
0
0
2
5
0
3
0
0
0 5
1
0
1
5
2
0
2
5


C
e
l
l

A
v
e
r
a
g
i
n
g
O
r
d
e
r
e
d

S
t
a
t
i
s
t
i
c
s
V
a
r
a
b
i
l
i
t
y

I
n
d
e
x
O
r
d
e
r
e
d

S
t
a
t
i
s
t
i
c
s

G
r
e
a
t
e
s
t

O
f
F
i
g
u
r
e

7
.
1
.

C
F
A
R

O
b
s
t
a
c
l
e

C
o
u
r
s
e

REFERENCES

[1] Finn,H.M.,andJohnson,R.S.:Adaptivedetectionmodewiththresholdcontrolasa
functionofspatiallysampledclutterestimates,RCARev.,1968,vol.29,no.3,pp.
414464
[2] Richards,M.A.FundamentalsofRadarSignalProcessing.NewYork;McGrawHill.
2005
[3] Kang,K.E.RadarSystem:Analysis,Design,andSimulation.Chapter9:MonteCarlo
MethodandFunctionIntegration.Pages247260.ArtechHouse2008
[4] Gandhi,P.P.;Kassam,S.A.;,"AnalysisofCFARprocessorsinhomogeneousback
ground,"AerospaceandElectronicSystems,IEEETransactionson,vol.24,no.4,
pp.427445,Jul1988
[5] Trunk,G.V.;,"RangeResolutionofTargetsUsingAutomaticDetectors,"Aerospace
andElectronicSystems,IEEETransactionson,vol.AES14,no.5,pp.750755,Sept.
1978
[6] Hansen,V.G.;Sawyers,J.H.;,"DetectabilityLossDueto"GreatestOf"Selectionina
CellAveragingCFAR,"AerospaceandElectronicSystems,IEEETransactionson,
vol.AES16,no.1,pp.115118,Jan.1980
[7] Smith,M.E.;Varshney,P.K.;,"IntelligentCFARprocessorbasedondatavariability,"
AerospaceandElectronicSystems,IEEETransactionson,vol.36,no.3,pp.837847,
Jul2000
[8] Rohling,H.;,"RadarCFARThresholdinginClutterandMultipleTargetSituations,"
AerospaceandElectronicSystems,IEEETransactionson,vol.AES19,no.4,pp.608
621,July1983
[9] EliasFuste,A.R.;deMercado,M.G.G.;delosReyesDavo,E.;,"Analysisofsome
modifiedorderedstatisticCFAR:OSGOandOSSOCFAR,"AerospaceandElectronic
Systems,IEEETransactionson,vol.26,no.1,pp.197
[10]Cao,T.T.V.;,"Constantfalsealarmratealgorithmbasedontestcellinformation,"
Radar,Sonar&Navigation,IET,vol.2,no.3,pp.200213,June2008
89
AppendixA
MATLABFunctions
A.1RadarReturnGeneration
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 to
linear
pwrNoise=10.^(N/10); %Converinting noise power from dB to
linear

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 with
different noise power
iLead=1;

%This loop produces the voltage waveform for the gaussian white noise.
%Every range gate segment between iLead and iLag will have its own power of
%N(i)
for i=1:I
iLag=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
for i=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

90

%%GENERATING OVERALL SIGNAL
data=signal+noise; %Overall voltage waveform
P=abs(data).^2; %Power of the overall return
91
A.2MonteCarloSimulations
function [expPfa]= monteCarloFalseAlarm(T,noisePwr)
% This function performs a Monte Carlo Importance Sampling to determine
% experimental probabilities of false alarm
%
% INPUTS
% T - This is the threshold
%
% noisePwr - the noise power in linear scales
%
% OUTPUTS
% expPfa: The experimental probability of false alram
%
% ASSUMPTIONS
% Exponential distribution of noise/clutter
%
% AUTHORSHIP
% James Jen
% Cal Poly Pomona
%
% UPDATE HISTORY
% May 28th, 2011 - created
%

nCFAR=size(T,2);
nRangeGate=length(T); %The number of range gates
monteCarloPwr=noisePwr*20; %Monte Carlo mean 20 times greater

iCFARwin=1:nRangeGate;
iCFARwin=iCFARwin(T(:,1)~=0); %indicies for non-zero thresholds
nTrial=length(iCFARwin);

%Exponential distribution with the Monte carlo power
pwrMonteCarlo=exprnd(monteCarloPwr,nRangeGate,nCFAR);

%The Monte carlo weight
weight=monteCarloPwr/noisePwr*exp(-(1/noisePwr-1/monteCarloPwr)
*pwrMonteCarlo);

%with iCFAR win, we avoid the zero thresholsd at the ends of the range gate
weight=weight(iCFARwin,:);
T=T(iCFARwin,:);
pwrMonteCarlo=pwrMonteCarlo(iCFARwin,:);

%Logical indicies for when Monte Carlo power greater than threshold
iFalseAlarm=T<pwrMonteCarlo;

%When monte carlo weight greater, we use the corresponding weights to
%determine false alarm.
falseAlarm=zeros(size(weight));
falseAlarm(iFalseAlarm)=weight(iFalseAlarm);

%The overall probability of false alarm
expPfa=sum(falseAlarm)/nTrial;


92
function [Pd]=Pd_inf(Pfa,SNRdB)

SNR=10.^(SNRdB./10);
Pd=Pfa.^(1./(1+SNR));

A.3NeymanPearsonDetector
93
A.1CellAveragingCFAR
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 is
the
% threshold produced by the Cell-Averaging CFAR (CA-CFAR) method
from 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 leading
window
% and N/2 in the lagging window.
%
% nGuardCell- the number of guard cells to either side of the test
cell
%
% Signal - the power of the recieved waveform after having passed
through
% 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 where
a CFAR
% threshold is produced. When the first few and last few range bins
are
% used as test cells, they don't allow enough room for the entire
CFAR
% 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"
%
94
% 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 entire
range
%gate:
if min(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);

95
%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)=[];
96
function[T,iCFARwin]=GOCA_CFAR1(varargin)
% [T,iCFARwin]=GOCA_CFAR(Pfa,N,k,signal) produces a vector T, that is the
% threshold produced by the Greatest-Of Cell-Averaging CFAR (GOCA-CFAR)
% method from the vector, signal, that is a one-dimension of range power.
%
% INPUT:
% Pfa - the desired probability of False Alarm
%
% N - the total number of CFAR windows-- with N/2 in the leading window
% and N/2 in the lagging window.
%
% Signal - the power of the recieved waveform after having passed through
% 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 where a CFAR
% threshold is produced. When the first few and last few range bins are
% used as test cells, they don't allow enough room for the entire CFAR
% reference window. Subsequently, they are ignored and scipped.
%
% ASSUMPTION:
% signal noise/clutter, after passing through a square law detector, will
% have an exponential distribution
%
% SOURCE:
% Threshold Multiplier equation taken from Chapter 7 of M.A. Richard's
% "Fundamentals of Radar Signal Processing"
%
% AUTHORSHIP:
% James Jen
% Cal Poly Pomona
%
% UPDATE HISTORY:
% May 28th, 2011 - Code Comment
%

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

L=length(signal); %Total number of range bins


%There is no analytical function to directly calculate the
A.5GreatestOfCellAveragingCFAR
97
%thershold-multiplier, a. Instead, we will compute a look-up table and
%interpolate the value.
a_set=0.1:0.05:50;
P=zeros(length(a_set),1);

for i=1:length(a_set)
a=a_set(i);

sum_term=zeros(N/2,1);
for k=0:N/2-1
sum_term(k+1,1)=nchoosek(N/2-1+k,k)*(2+a/(N/2))^-k;
end

sum_term=sum(sum_term);
P(i,1)=2*((1+a/(N/2))^(-N/2)-(2+a/(N/2))^(-N/2)*sum_term);
end

%Threshold Multiplier:
a=interp1(P,a_set,Pfa);


%If range gate inputs is a vector, then perform CFAR along entire range
%gate:
if min(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
iLead=index(:,1:N/2);
iLag=index(:,N/2+2*nGuardCell+2:end);


%Lienar index for the CUT
i=N/2+nGuardCell+1;
iCUT=index(:,i);

%Performaing SO-CFAR
leadWin=signal(iLead);
sumLead=sum(leadWin,2);

lagWin=signal(iLag);
sumLag=sum(lagWin,2);

B=max(sumLead,sumLag)/(N/2);

%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 experimental
% trial with one test cell
else
%Rwo index cor the Reference Cells
98
leadWin=signal(:,1:N/2);
sumLead=sum(leadWin,2);

lagWin=signal(:,N/2+2*nGuardCell+2:end);
sumLag=sum(lagWin,2);

B=max(sumLead,sumLag)/(N/2);
%Calculating the threshold
T=a*B; %Multiplying, a, the threshold mult
end

%Range Cells where Thrsholds are set:
iCFARwin=1:L;
iCFARwin(T==0)=[];
99
function[T,iCFARwin]=SOCA_CFAR1(varargin)
% [T,iCFARwin]=SOCA_CFAR(Pfa,N,nGuardCell, signal) produces a vector T,
% that is the threshold produced by the Smalelst-Of Cell-Averaging CFAR
% (SOCA-CFAR) method from the vector, signal, that is a one-dimension of
% range power.
%
%
% [T,iCFARwin]=SOCA_CFAR(Pfa,N,signal) produces a vector T, that is the
% threshold produced by the Smallest-Of Cell-Averaging CFAR (SOCA-CFAR
% method from the vector, signal, that is a one-dimension of range power.
% nGuardCell defaults to one
%
% INPUT:
% Pfa - the desired probability of False Alarm
%
% N - the total number of CFAR windows-- with N/2 in the leading window
% and N/2 in the lagging window.
%
% nGuardCell- the number of guard cells to either side of the test cell
%
% Signal - the power of the recieved waveform after having passed through
% 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 where a CFAR
% threshold is produced. When the first few and last few range bins are
% used as test cells, they don't allow enough room for the entire CFAR
% reference window. Subsequently, they are ignored and scipped.
%
% ASSUMPTION:
% signal noise/clutter, after passing through a square law detector, will
% have an exponential distribution
%
% SOURCE:
% Threshold Multiplier equation taken from Chapter 7 of M.A. Richard'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};
A.6SmallestOfCellAveragingCFAR
100
nGuardCell=varargin{3};
signal=varargin{4};
otherwise
error('Unexpected Number of Inputs')
end

%Number of Range Gates
L=length(signal);


%Finding the threshold multiplier numerically
a_set=0.1:0.1:150;
P=zeros(length(a_set),1);

for i=1:length(a_set)
a=a_set(i);

sum_term=zeros(N/2,1);
for k=0:N/2-1
sum_term(k+1,1)=nchoosek(N/2-1+k,k)*(2+a/(N/2))^-k;
end

sum_term=sum(sum_term);

P(i,1)=2*(2+a/(N/2))^(-N/2)*sum_term;
end

a=interp1(P,a_set,Pfa);


%If range gate inputs is a vector, then perform CFAR along entire range
%gate:
if min(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
iLead=index(:,1:N/2);
iLag=index(:,N/2+2*nGuardCell+2:end);


%Lienar index for the CUT
i=N/2+nGuardCell+1;
iCUT=index(:,i);

%Performaing SO-CFAR
leadWin=signal(iLead);
sumLead=sum(leadWin,2);

lagWin=signal(iLag);
sumLag=sum(lagWin,2);

B=min(sumLead,sumLag)/(N/2);

%Outuptted thershold
101
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 experimental
% trial with one test cell
else
%Rwo index cor the Reference Cells
leadWin=signal(:,1:N/2);
sumLead=sum(leadWin,2);

lagWin=signal(:,N/2+2*nGuardCell+2:end);
sumLag=sum(lagWin,2);

B=min(sumLead,sumLag)/(N/2);
%Calculating the threshold
T=a*B; %Multiplying, a, the threshold mult
end

%Range Cells where Thrsholds are set:
iCFARwin=1:L;
iCFARwin(T==0)=[];
102
function[T,iCFARwin,selection,selectionName]=VI_CFAR1(varargin)
% [T,iCFARwin]=VI_CFAR(Pfa,N,signal,K_VI,K_MR) produces a vector T, that
% is the threshold produced by the Varaibility Index CFAR (CA-CFAR) method
% from the vector, signal, that is a one-dimension of range power.
%
% [T,iCFARwin]=VI_CFAR(Pfa,N,signal) defaults to pre-determiend K_VI and
% K_MR values
%
% INPUT:
% Pfa - the desired probability of False Alarm
%
% N - the total number of CFAR windows-- with N/2 in the leading window
% and N/2 in the lagging window.
%
% Signal - the power of the recieved waveform after having passed through
% a square law detector. It is upon this that the threshold is set.
%
% K_VI - Variability Index Constant
%
% K_MR - Mean Ratio Constant
%
% OUTPUT:
% T is the threshold set according to the functional inputs.
%
% iCFARwin are the indicies corresponding to the range gates where a CFAR
% threshold is produced. When the first few and last few range bins are
% used as test cells, they don't allow enough room for the entire CFAR
% reference window. Subsequently, they are ignored and scipped.
%
% ASSUMPTION:
% signal noise/clutter, after passing through a square law detector, will
% have an exponential distribution
%
% SOURCE:
% Based on "Intelligent CFAR Process Based on Data Variability" by M.E.
% Smith and P.K. Varshney published in IEEE Transactions on Aerospace and
% Electronic Systems Vol. 36 No. 30 July 2000
%
% AUTHORSHIP:
% James Jen
% Cal Poly Pomona
%
% Updated:
% May 23rd, 2011 - Fixed code mistakes
% May 28th, 2011 - Code Comment
% May 30th, 2011 - Vectorization, Speedup
%

switch nargin
%User may use pre-defined varaibilty index and mean ratio constants
case 3
Pfa=varargin{1}; %desired probability of false alarm
N=varargin{2}; %total number of reference windows
signal=varargin{3}; %vector of range bin to be thresholded
K_VI=4.76; %default variaiblity index constant
K_MR=1.806; %default mean ration constant
nGuardCell=1;
A.7VariabilityIndexCFAR
103

%User may use pre-defined varaibilty index and mean ratio constants
case 4
Pfa=varargin{1}; %desired probability of false alarm
N=varargin{2}; %total number of reference windows
nGuardCell=varargin{3};
signal=varargin{4}; %vector of range bin to be thresholded
K_VI=4.76; %default variaiblity index constant
K_MR=1.806; %default mean ration constant

%User may enter varaibility index and mean ratio constants
case 5
Pfa=varargin{1};
N=varargin{2};
signal=varargin{3};
K_VI=varargin{4}; %user-entered
K_MR=varargin{5}; %user-entered
nGuardCell=1;

case 6
Pfa=varargin{1};
N=varargin{2};
nGuardCell=varargin{3};
signal=varargin{4};
K_VI=varargin{5}; %user-entered
K_MR=varargin{6}; %user-entered
otherwise
error('Unexpected Number of Inputs');
end

%Number of Range Gates
L=length(signal);


%Finding the threshold multiplier numerically
a_N=(Pfa^(-1/N)-1); %Threshold multiplier
a_N2=(Pfa^(-1/(N/2))-1);

%If range gate inputs is a vector, then perform CFAR along entire range
%gate:
if min(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
iLead=index(:,1:N/2);
iLag=index(:,N/2+2*nGuardCell+2:end);

%Linear index for the CUT
i=N/2+nGuardCell+1;
iCUT=index(:,i);

%Summing and Squaring
leadWin=signal(iLead);
sumLead=sum(leadWin,2);
sumSquareLead=sum(leadWin.^2,2);

104
lagWin=signal(iLag);
sumLag=sum(lagWin,2);
sumSquareLag=sum(lagWin.^2,2);

%VARIABILITY INDEX
leadVI=N/2*sumSquareLead./(sumLead.^2);
lagVI=N/2*sumSquareLag./(sumLag.^2);
leadVariable=leadVI>K_VI;
lagVariable=lagVI>K_VI;

%MEAN RATIO
meanRatio=sumLead./sumLag;
diffMean=(K_MR^-1>meanRatio)|(meanRatio>K_MR);




oneVariable=xor(leadVariable,lagVariable);
bothVariable=leadVariable & lagVariable;
noneVariable=(~leadVariable) & (~lagVariable);

B=zeros(nCUT,1);

%LEAD WINDOW
iLead=oneVariable & lagVariable;
B(iLead)=sumLead(iLead)*a_N2;

%LAG WINDOW
iLag=oneVariable & leadVariable;
B(iLag)=sumLag(iLag)*a_N2;

%SO-CFAR
iSO=bothVariable;
B(iSO)=min(sumLead(iSO),sumLag(iSO))*a_N2;

%GO-CFAR
iGO=diffMean & noneVariable;
B(iGO)=max(sumLead(iGO),sumLag(iGO))*a_N2;

%CA-CFAR
iCA=~diffMean & noneVariable;
B(iCA)=(sumLead(iCA)+sumLag(iCA))*a_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)=B; %Multiplying threshold multiplier

%If range gate input is a matrix, then treat each row as one experimental
% trial with one test cell
else
nTrial=length(signal);

iLead=1:N/2;
iLag=N/2+2+2*nGuardCell:N+1+2*nGuardCell;

%Summing and Squaring
leadWin=signal(:,iLead);
sumLead=sum(leadWin,2);
sumSquareLead=sum(leadWin.^2,2);
105

lagWin=signal(:,iLag);
sumLag=sum(lagWin,2);
sumSquareLag=sum(lagWin.^2,2);

%VARIABILITY INDEX
leadVI=N/2*sumSquareLead./(sumLead.^2);
lagVI=N/2*sumSquareLag./(sumLag.^2);
leadVariable=leadVI>K_VI;
lagVariable=lagVI>K_VI;

%MEAN RATIO
meanRatio=sumLead./sumLag;
diffMean=(K_MR^-1>meanRatio)|(meanRatio>K_MR);

oneVariable=xor(leadVariable,lagVariable);
bothVariable=leadVariable & lagVariable;
noneVariable=(~leadVariable) & (~lagVariable);

T=zeros(nTrial,1);

%LEAD WINDOW
iLead=oneVariable & lagVariable;
T(iLead)=sumLead(iLead)*a_N2;

%LAG WINDOW
iLag=oneVariable & leadVariable;
T(iLag)=sumLag(iLag)*a_N2;

%SO-CFAR
iSO=bothVariable;
T(iSO)=min(sumLead(iSO),sumLag(iSO))*a_N2;

%GO-CFAR
iGO=diffMean & noneVariable;
T(iGO)=max(sumLead(iGO),sumLag(iGO))*a_N2;


%CA-CFAR
iCA=~diffMean & noneVariable;
T(iCA)=(sumLead(iCA)+sumLag(iCA))*a_N;
end


selectionName{1}='CA';
selectionName{2}='GO';
selectionName{3}='SO';
selectionName{4}='lead';
selectionName{5}='lag';

selection=zeros(L,1);
selection(iCA)=1;
selection(iGO)=2;
selection(iSO)=3;
selection(iLead)=4;
selection(iLag)=5;



%Range Cells where Thrsholds are set:
iCFARwin=1:L;
iCFARwin(T==0)=[];
106
function[T,iCFARwin]=OS_CFAR1(varargin)
% [T,iCFARwin]=OS_CFAR(Pfa,N,k,nGuardCell signal) produces a threshold T,
% from signal to limit to probability of false larm Pfa using Ordered
% Statistics CFAR (OS-CFAR). N is the number of reference cells in the
% CFAR window and k is the cell rank used to generate the threshold
% multiplier. nGuardCell is the number of guard cells to either side of
% CUT
%
%
% [T,iCFARwin]=OS_CFAR(Pfa,N,k,nGuardCell signal) produces a threshold T,
% from signal to limit to probability of false larm Pfa using Ordered
% Statistics CFAR (OS-CFAR). N is the number of reference cells in the
% CFAR window and k is the cell rank used to generate the threshold
% multiplier. nGuardCell, the number of guard cells to either side of CUT
% defaults to 1.
%
%
% INPUT:
% Pfa - the desired probability of False Alarm
%
% N - the total number of CFAR windows-- with N/2 in the leading window
% and N/2 in the lagging window.
%
% k - the index used in computation of the threshold multiplier used in
% computing the threshold, T.
%
% nGuardCell - the number of guard cells to either side of CUT
%
% Signal - the power of the recieved waveform after having passed through
% 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 where a CFAR
% threshold is produced. When the first few and last few range bins are
% used as test cells, they don't allow enough room for the entire CFAR
% reference window. Subsequently, they are ignored and scipped.
%
% ASSUMPTION:
% signal noise/clutter, after passing through a square law detector, will
% have an exponential distribution
%
% SOURCE:
% Threshold Multiplier equation taken from Chapter 7 of M.A. Richard's
% "Fundamentals of Radar Signal Processing"
%
% AUTHORSHIP:
% James Jen
% Cal Poly Pomona
%
% UPDATE HISTORY:
% May 28th, 2011 - Code Comment
%

switch nargin
%If "k" is omitted as an input, it defaults to round(0.7*N)
A.8OrderedStatisticsCFAR
107
case 4
Pfa=varargin{1};
N=varargin{2};
k=varargin{3};
signal=varargin{4};
nGuardCell=1;

%If "k" is entered as an input:
case 5
Pfa=varargin{1};
N=varargin{2};
k=varargin{3};
nGuardCell=varargin{4};
signal=varargin{5};
otherwise
error('Unexpected Number of Inputs');
end


nLead=N/2; %size of lead window
nLag=N/2; %size of lag window

%Number of Range Gates
L=length(signal);


%The proper threshold multiplier is determined numerically:
a_set=0.1:0.05:100;
P=zeros(length(a_set),1);

for i=1:length(a_set)
a=a_set(i);
P(i)=k*nchoosek(N,k)*gamma(a+N-k+1)*gamma(k)/gamma(a+N+1);
end
a=interp1(P,a_set,Pfa);

%If range gate inputs is a vector, then perform CFAR along entire range
%gate:
if min(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);

%sorting and taking the kth value
sortedPwrSignal=sort(signal(iRefWin),2);
B=sortedPwrSignal(:,k);

108
%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 experimental
% trial with one test cell
else
%Matrix 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)=[];

%sorting and taking the kth value
sortedPwrSignal=sort(signal(:,iRefCell),2);
B=sortedPwrSignal(:,k);
T=a*B; %Multiplying, a, the threshold mult
end

%Range Cells where Thrsholds are set:
iCFARwin=1:L;
iCFARwin(T==0)=[];


109
function[T,iCFARwin]=OSGO_CFAR1(varargin)
% [T,iCFARwin]=OSGO_CFAR(Pfa,N,k,signal) produces a vector T, that is the
% threshold produced by the Order Statistics Greatest-OF CFAR (OSGO-CFAR)
% method from the vector, signal, based on the k-th ranked index.
%
% [T,iCFARwin]=OSGO_CFAR(Pfa,N,k,signal) produces a vector T, that is the
% threshold produced by the Order Statistics Greatest-OF CFAR (OSGO-CFAR)
% method from the vector, signal. "k" is defaulted to round(0.6*N/2)
%
% INPUT:
% Pfa - the desired probability of False Alarm
%
% N - the total number of CFAR windows-- with N/2 in the leading window
% and N/2 in the lagging window.
%
% k - the index used in computation of the threshold multiplier used in
% computing the threshold, T.
%
% Signal - the power of the recieved waveform after having passed through
% 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 where a CFAR
% threshold is produced. When the first few and last few range bins are
% used as test cells, they don't allow enough room for the entire CFAR
% reference window. Subsequently, they are ignored and scipped.
%
% ASSUMPTION:
% signal noise/clutter, after passing through a square law detector, will
% have an exponential distribution
%
% SOURCE:
% Elias-Fuste, A.R.; de Mercado, M.G.G.; de los Reyes Davo, E.; ,
% "Analysis of some modified ordered statistic CFAR: OSGO and OSSO CFAR,"
% Aerospace and Electronic Systems, IEEE Transactions on , vol.26, no.1,
% pp.197-202, Jan 1990
%
% AUTHORSHIP:
% James Jen
% Cal Poly Pomona
%
% UPDATE HISTORY:
% May 28th, 2011 - Code Comment
% May 30th, 2011 - Vectorized

switch nargin
%If "k" is omitted as an input, it defaults to round(0.7*N)
case 4
Pfa=varargin{1};
N=varargin{2};
k=varargin{3};
signal=varargin{4};
nGuardCell=1;

%If "k" is entered as an input:
case 5
A.9GreatestOfOrderedStatisticsCFAR
110
Pfa=varargin{1};
N=varargin{2};
k=varargin{3};
nGuardCell=varargin{4};
signal=varargin{5};
otherwise
error('Unexpected Number of Inputs');
end


%Number of Range Gates
L=length(signal);


%Numerically determining the threshold multiplier, a:
a_set=1:0.05:100;
Pfa_set=ones(size(a_set));

i=(0:N/2-k)';
j=(0:N/2-k)';

I=i*ones(1,length(i));
J=ones(length(j),1)*j';

for ia=1:length(a_set)
a=a_set(ia);
A=2*k^2*nchoosek(N/2,k)^2;
B=factorial((N/2-k)*ones(length(j)))./factorial(J)./factorial(N/2-k-J);
C=factorial((N/2-k)*ones(length(j)))./factorial(I)./factorial(N/2-k-I);
D=(-1).^(N-2*k-J-I)./(N/2-I);
E=gamma(N-J-I).*gamma(a+1)./gamma(N-J-I+a+1);
Pfa_set(ia)=A*sum(sum(B.*C.*D.*E));
end
a=interp1(Pfa_set,a_set,Pfa);

%If range gate inputs is a vector, then perform CFAR along entire range
%gate:
if min(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)=[];
iLead=iRefWin(:,1:N/2);
iLag=iRefWin(:,N/2+1:N);

%Lienar index for the CUT
i=N/2+nGuardCell+1;
iCUT=index(:,i);

%sorting and taking the kth value


111
sortedLead=sort(signal(iLead),2);
sortedLag=sort(signal(iLag),2);
B=max(sortedLead(:,k),sortedLag(:,k));

%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 experimental
% trial with one test cell
else
%Matrix index for the Cell Under Test (CUT)
iCUT=N/2+nGuardCell+1;

%Rwo index cor the Reference Cells
iLead=1:N/2;
iLag=N/2+2*nGuardCell+2:N+1+2*nGuardCell;

sortedLead=sort(signal(:,iLead),2);
sortedLag=sort(signal(:,iLag),2);

B=max(sortedLead(:,k),sortedLag(:,k));
T=a*B; %Multiplying, a, the threshold mult
end

%Range Cells where Thrsholds are set:
iCFARwin=1:L;
iCFARwin(T==0)=[];


112
function[T,iCFARwin,A,B]=S_CFAR(varargin)
% [T,iCFARwin]=S_CFAR(Pfa,N,signal,N_T,a,B_CA,B_0,B_1) produces a vector
% T, that is the threshold produced by the Switching CFAR (S-CFAR) method
% from the vector, signal, that is a one-dimension of range power.
%
% [T,iCFARwin]=S_CFAR(Pfa,N,signal,N_T,a) defaults to CA-CFAR threshold
% multiplier for window size N for B_CA, B_0, and B_1
%
% [T,iCFARwin]=S_CFAR(Pfa,N,signal) defaults to CA-CFAR threshold
% multiplier for window size N for B_CA, B_0, and B_1; and to N_T of N/2
% and a=0.5
%
% INPUT:
% Pfa - the desired probability of False Alarm
%
% N - the total number of CFAR windows-- with N/2 in the leading window
% and N/2 in the lagging window.
%
% Signal - the power of the recieved waveform after having passed through
% a square law detector. It is upon this that the threshold is set.
%
% N_T - S0 Threshold. When the number of members of set S0 exceed N_T, the
% members of S0 are used in cell averaging.
%
% a - Test cell multiplier used in comparison and sorting between set S0
% and set S1
%
% B_CA - Threshold multiplier used when switched to Cell Averaging
%
% B_0 - Threshold multiplier used for set S0
%
% B_1 - Threshold multiplier used for set S1
%
% OUTPUT:
% T is the threshold set according to the functional inputs.
%
% iCFARwin are the indicies corresponding to the range gates where a CFAR
% threshold is produced. When the first few and last few range bins are
% used as test cells, they don't allow enough room for the entire CFAR
% reference window. Subsequently, they are ignored and scipped.
%
% ASSUMPTION:
% signal noise/clutter, after passing through a square law detector, will
% have an exponential distribution
%
% SOURCE:
% Cao, T.-T.V.; , "Constant false-alarm rate algorithm based on test cell
% information," Radar, Sonar & Navigation, IET , vol.2, no.3, pp.200-213,
% June 2008
%
% AUTHORSHIP:
% James Jen
% Cal Poly Pomona
%
% UPDATE HISTORY:
% May 28th, 2011 - Code Comment
%

A.10SwitchingCFAR
113
switch nargin
case 3
Pfa=varargin{1};
N=varargin{2};
signal=varargin{3};
N_T=N/2;
a=0.5;
aCA=N*(Pfa^(-1/N)-1);
a0=aCA;
a1=aCA;

case 5
Pfa=varargin{1};
N=varargin{2};
signal=varargin{3};
N_T=varargin{4};
a=varargin{5};
aCA=N*(Pfa^(-1/N)-1);
a0=aCA;
a1=aCA;

case 7
Pfa=varargin{1};
N=varargin{2};
signal=varargin{3};
N_T=varargin{4};
aCA=varargin{5};
a0=varargin{6};
a1=varargin{7};
aCA=a0;
otherwise
error('Unexpected Number of Inputs');
end


nGuardCell=1; %size of the guard cell

L=length(signal);

T=zeros(size(signal));

if min(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);
cCUT=signal(iCUT);

%Summing the content of each reference window
mRefWin=signal(iRefWin);
114
sumRefWin=sum(mRefWin,2)/N;

%Subset
iS0=a*repmat(cCUT,1,N)>mRefWin;
S0=zeros(nCUT,N);
S0(iS0)=mRefWin(iS0);
nS0=sum(iS0,2);
sumS0=sum(S0,2)./nS0;

cBigNT=nS0>=N_T;
cSmallNT=~cBigNT;

B=zeros(nCUT,1);
B(cSmallNT)=sumRefWin(cSmallNT);
B(cBigNT)=sumS0(cBigNT);

%Outuptted thershold
T=zeros(L,1); %For CUT too small or too big for complete
%reference window, we set T to zero

T(iCUT)=aCA*B; %Multiplying threshold multiplier

%If range gate input is a matrix, then treat each row as one experimental
% 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
mRefCell=signal(:,iRefCell);
sumRefCell=sum(signal(:,iRefCell),2)/N; %sum of each cell in refer-
ence win

nTrial=length(signal);
cCUT=signal(:,iCUT);
iS0=a*repmat(cCUT,1,N)>mRefCell;

S0=zeros(nTrial,N);
S0(iS0)=mRefCell(iS0);

nS0=sum(iS0,2);
sumS0=sum(S0,2)./nS0;


iBigNT=nS0>=N_T;
iSmallNT=~iBigNT;

B(iBigNT)=sumS0(iBigNT);
B(iSmallNT)=sumRefCell(iSmallNT);

T=aCA*B; %Multiplying, a, the threshold
mult
end

%Range Cells where Thrsholds are set:
iCFARwin=1:L;
iCFARwin(T==0)=[];
115
function[T,iCFARwin,selection,selectionName]=VI_CFAR1(varargin)
% [T,iCFARwin]=VI_CFAR(Pfa,N,signal,K_VI,K_MR) produces a vector T, that
% is the threshold produced by the Varaibility Index CFAR (CA-CFAR) method
% from the vector, signal, that is a one-dimension of range power.
%
% [T,iCFARwin]=VI_CFAR(Pfa,N,signal) defaults to pre-determiend K_VI and
% K_MR values
%
% INPUT:
% Pfa - the desired probability of False Alarm
%
% N - the total number of CFAR windows-- with N/2 in the leading window
% and N/2 in the lagging window.
%
% Signal - the power of the recieved waveform after having passed through
% a square law detector. It is upon this that the threshold is set.
%
% K_VI - Variability Index Constant
%
% K_MR - Mean Ratio Constant
%
% OUTPUT:
% T is the threshold set according to the functional inputs.
%
% iCFARwin are the indicies corresponding to the range gates where a CFAR
% threshold is produced. When the first few and last few range bins are
% used as test cells, they don't allow enough room for the entire CFAR
% reference window. Subsequently, they are ignored and scipped.
%
% ASSUMPTION:
% signal noise/clutter, after passing through a square law detector, will
% have an exponential distribution
%
% SOURCE:
% Based on "Intelligent CFAR Process Based on Data Variability" by M.E.
% Smith and P.K. Varshney published in IEEE Transactions on Aerospace and
% Electronic Systems Vol. 36 No. 30 July 2000
%
% AUTHORSHIP:
% James Jen
% Cal Poly Pomona
%
% Updated:
% May 23rd, 2011 - Fixed code mistakes
% May 28th, 2011 - Code Comment
% May 30th, 2011 - Vectorization, Speedup
%

switch nargin
%User may use pre-defined varaibilty index and mean ratio constants
case 3
Pfa=varargin{1}; %desired probability of false alarm
N=varargin{2}; %total number of reference windows
signal=varargin{3}; %vector of range bin to be thresholded
K_VI=4.76; %default variaiblity index constant
K_MR=1.806; %default mean ration constant
nGuardCell=1;
A.11SwitchingVariabilityIndexCFAR
116

%User may use pre-defined varaibilty index and mean ratio constants
case 4
Pfa=varargin{1}; %desired probability of false alarm
N=varargin{2}; %total number of reference windows
nGuardCell=varargin{3};
signal=varargin{4}; %vector of range bin to be thresholded
K_VI=4.76; %default variaiblity index constant
K_MR=1.806; %default mean ration constant

%User may enter varaibility index and mean ratio constants
case 5
Pfa=varargin{1};
N=varargin{2};
signal=varargin{3};
K_VI=varargin{4}; %user-entered
K_MR=varargin{5}; %user-entered
nGuardCell=1;

case 6
Pfa=varargin{1};
N=varargin{2};
nGuardCell=varargin{3};
signal=varargin{4};
K_VI=varargin{5}; %user-entered
K_MR=varargin{6}; %user-entered
otherwise
error('Unexpected Number of Inputs');
end

%Number of Range Gates
L=length(signal);


%Finding the threshold multiplier numerically
a_N=(Pfa^(-1/N)-1); %Threshold multiplier
a_N2=(Pfa^(-1/(N/2))-1);

%If range gate inputs is a vector, then perform CFAR along entire range
%gate:
if min(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
iLead=index(:,1:N/2);
iLag=index(:,N/2+2*nGuardCell+2:end);

%Linear index for the CUT
i=N/2+nGuardCell+1;
iCUT=index(:,i);

%Summing and Squaring
leadWin=signal(iLead);
sumLead=sum(leadWin,2);
sumSquareLead=sum(leadWin.^2,2);

117
lagWin=signal(iLag);
sumLag=sum(lagWin,2);
sumSquareLag=sum(lagWin.^2,2);

%VARIABILITY INDEX
leadVI=N/2*sumSquareLead./(sumLead.^2);
lagVI=N/2*sumSquareLag./(sumLag.^2);
leadVariable=leadVI>K_VI;
lagVariable=lagVI>K_VI;

%MEAN RATIO
meanRatio=sumLead./sumLag;
diffMean=(K_MR^-1>meanRatio)|(meanRatio>K_MR);




oneVariable=xor(leadVariable,lagVariable);
bothVariable=leadVariable & lagVariable;
noneVariable=(~leadVariable) & (~lagVariable);

B=zeros(nCUT,1);

%LEAD WINDOW
iLead=oneVariable & lagVariable;
B(iLead)=sumLead(iLead)*a_N2;

%LAG WINDOW
iLag=oneVariable & leadVariable;
B(iLag)=sumLag(iLag)*a_N2;

%SO-CFAR
iSO=bothVariable;
B(iSO)=min(sumLead(iSO),sumLag(iSO))*a_N2;

%GO-CFAR
iGO=diffMean & noneVariable;
B(iGO)=max(sumLead(iGO),sumLag(iGO))*a_N2;

%CA-CFAR
iCA=~diffMean & noneVariable;
B(iCA)=(sumLead(iCA)+sumLag(iCA))*a_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)=B; %Multiplying threshold multiplier

%If range gate input is a matrix, then treat each row as one experimental
% trial with one test cell
else
nTrial=length(signal);

iLead=1:N/2;
iLag=N/2+2+2*nGuardCell:N+1+2*nGuardCell;

%Summing and Squaring
leadWin=signal(:,iLead);
sumLead=sum(leadWin,2);
sumSquareLead=sum(leadWin.^2,2);
118

lagWin=signal(:,iLag);
sumLag=sum(lagWin,2);
sumSquareLag=sum(lagWin.^2,2);

%VARIABILITY INDEX
leadVI=N/2*sumSquareLead./(sumLead.^2);
lagVI=N/2*sumSquareLag./(sumLag.^2);
leadVariable=leadVI>K_VI;
lagVariable=lagVI>K_VI;

%MEAN RATIO
meanRatio=sumLead./sumLag;
diffMean=(K_MR^-1>meanRatio)|(meanRatio>K_MR);

oneVariable=xor(leadVariable,lagVariable);
bothVariable=leadVariable & lagVariable;
noneVariable=(~leadVariable) & (~lagVariable);

T=zeros(nTrial,1);

%LEAD WINDOW
iLead=oneVariable & lagVariable;
T(iLead)=sumLead(iLead)*a_N2;

%LAG WINDOW
iLag=oneVariable & leadVariable;
T(iLag)=sumLag(iLag)*a_N2;

%SO-CFAR
iSO=bothVariable;
T(iSO)=min(sumLead(iSO),sumLag(iSO))*a_N2;

%GO-CFAR
iGO=diffMean & noneVariable;
T(iGO)=max(sumLead(iGO),sumLag(iGO))*a_N2;


%CA-CFAR
iCA=~diffMean & noneVariable;
T(iCA)=(sumLead(iCA)+sumLag(iCA))*a_N;
end


selectionName{1}='CA';
selectionName{2}='GO';
selectionName{3}='SO';
selectionName{4}='lead';
selectionName{5}='lag';

selection=zeros(L,1);
selection(iCA)=1;
selection(iGO)=2;
selection(iSO)=3;
selection(iLead)=4;
selection(iLag)=5;



%Range Cells where Thrsholds are set:
iCFARwin=1:L;
iCFARwin(T==0)=[];
119
AppendixB
MATLABScripts
B.1ProbabilityofFalseAlarminHomogeneousEnvironment
%
% ===============================================
% Probability of False Alarm - Homogeneous
% ===============================================
%
% Computes the Probability of False Alarm for different CFAR
% algorithms in the homogeneous conditiosn with various "desired"
% Probability of false alrms
%
% ASSUMPTION
% Swerling I/II Target
% Exponential Noise/Clutter
%
% AUTHORSHIP
% James Jen
% Cal Poly Pomona
% Jimmy.Jen@Gmail.com
%
% %UPDATES
% May 28th, 2011 Created
% May 31st, 2011 Updated for faster CFAR functions
%



clear all
close all
clc


% ######################### %
% Simulation Parameters %
% ######################### %

%CFAR numbering
CA=1;
OS=2;
GOCA=3;
SOCA=4;
OSGO=5;
VI=6;
S=7;
SVI=8;

CFARselection=VI;

Pfa_set=10.^-(1:0.25:7); %Desired probability of false alarm
nPfa=length(Pfa_set);

nRangeGate=10^5; %Number of trials to run

N=32;
120
nGuardCell=1; %number of Guard Cells
noisePwr=1;

% ################### %
% CFAR Parameters %
% ################### %
%CFAR window size
k_OS=round(N*0.7); %OS-CFAR k-rank
k_OSGO=round(0.6*N/2); %k_OSGO k_rank





% ############################## %
% CFAR selection and setting %
% ############################## %


%Legend name
CFARtype{CA}='CA-CFAR';
CFARtype{OS}='OS-CFAR';
CFARtype{GOCA}='GOCA-CFAR';
CFARtype{SOCA}='SOCA-CFAR';
CFARtype{OSGO}='OSGO-CFAR';
CFARtype{S}='S-CFAR';
CFARtype{VI}='VI-CFAR';

%CFAR plot color


% #################################### %
% Theoretical Threshold Multiplier %
% #################################### %


pwrSignal=exprnd(noisePwr,nRangeGate,1);


a=zeros(size(Pfa_set));
switch CFARselection
case CA
clr =[0 0 0 ]/255; %black
a=N*(Pfa_set.^(-1/N)-1);
case OS
k=k_OS;
clr=[255 0 0 ]/255; %red
a_set=0.1:0.05:100;
P=zeros(length(a_set),1);

for i=1:length(a_set)
a=a_set(i);
P(i)=k*nchoosek(N,k)*gamma(a+N-k+1)*gamma(k)/gamma(a+N+1);
end

for i=1:length(Pfa_set)
Pfa=Pfa_set(i);
a(i)=interp1(P,a_set,Pfa);
end


121
case SOCA
clr=[0 153 204]/255; %light blue
a_set=0.1:0.1:150;
P=zeros(length(a_set),1);

for i=1:length(a_set)
a=a_set(i);

sum_term=zeros(N/2,1);
for k=0:N/2-1
sum_term(k+1,1)=nchoosek(N/2-1+k,k)*(2+a/(N/2))^-k;
end

sum_term=sum(sum_term);

P(i,1)=2*(2+a/(N/2))^(-N/2)*sum_term;
end

for i=1:length(Pfa_set)
Pfa=Pfa_set(i);
a(i)=interp1(P,a_set,Pfa);
end

case GOCA
k=k_OSGO
clr=[153 153 0 ]/255; %brown
a_set=0.1:0.05:50;
P=zeros(length(a_set),1);

for i=1:length(a_set)
a=a_set(i);

sum_term=zeros(N/2,1);
for k=0:N/2-1
sum_term(k+1,1)=nchoosek(N/2-1+k,k)*(2+a/(N/2))^-k;
end

sum_term=sum(sum_term);
P(i,1)=2*((1+a/(N/2))^(-N/2)-(2+a/(N/2))^(-N/2)*sum_term);
end

for i=1:length(Pfa_set)
Pfa=Pfa_set(i);
a(i)=interp1(P,a_set,Pfa);
end

case OSGO
clr=[0 204 51 ]/255; %orange
k=k_OSGO;
%Numerically determining the threshold multiplier, a:
a_set=1:0.05:100;
P=zeros(size(a_set));

i=(0:N/2-k)';
j=(0:N/2-k)';

I=i*ones(1,length(i));
J=ones(length(j),1)*j';

for ia=1:length(a_set)
a=a_set(ia);
122
A=2*k^2*nchoosek(N/2,k)^2;
B=factorial((N/2-k)*ones(length(j)))./factorial(J)./factorial
(N/2-k-J);
C=factorial((N/2-k)*ones(length(j)))./factorial(I)./factorial
(N/2-k-I);
D=(-1).^(N-2*k-J-I)./(N/2-I);
E=gamma(N-J-I).*gamma(a+1)./gamma(N-J-I+a+1);
P(ia)=A*sum(sum(B.*C.*D.*E));
end


for i=1:length(Pfa_set)
Pfa=Pfa_set(i);
a(i)=interp1(P,a_set,Pfa);
end

case VI
clr=[204 0 204]/255; %purple
a=N*(Pfa_set.^(-1/N)-1);
case S
clr=[255 153 0 ]/255; %green
case SVI
end %for CFARselection


% ##################### %
% CFAR Thresholding %
% ##################### %

threshold=zeros(nRangeGate,nPfa);
for i=1:nPfa
stopBar= progressbar(i/nPfa,0);
if(stopBar)
break;
end

Pfa=Pfa_set(i);

switch CFARselection
case CA
[threshold(:,i) iCFAR]=CA_CFAR1(Pfa,N,pwrSignal);
case SOCA
[threshold(:,i) iCFAR]=SOCA_CFAR1(Pfa,N,pwrSignal);
case GOCA
[threshold(:,i) iCFAR]=GOCA_CFAR1(Pfa,N,pwrSignal);
case OS
[threshold(:,i) iCFAR]=OS_CFAR1(Pfa,N,k,pwrSignal);
case OSGO
[threshold(:,i) iCFAR]=OSGO_CFAR1(Pfa,N,k_OSGO,pwrSignal);
case VI
[threshold(:,i) iCFAR]=VI_CFAR1(Pfa,N,pwrSignal);
case SVI
[threshold(:,i) iCFAR]=SVI_CFAR1(Pfa,N,pwrSignal);
case S
[threshold(:,i) iCFAR]=S_CFAR1(Pfa,N,pwrSignal);
end %switch CFARselection
end %for i=1:length(Pfa_set)
close

expPfa=monteCarloFalseAlarm(threshold(iCFAR,:),noisePwr);

123
% ############ %
% Plotting %
% ############ %

figure
semilogy(a,Pfa_set,'k-*','linewidth',2);
hold on
semilogy(a,expPfa,'color',clr,'linestyle','-','linewidth',2);
legend('Theoretical P_F_A','Experimental P_F_A','location','SouthWest')
title(['\fontsize{11}Theoretical v. Experimental P_F_A - \color{magenta}'
CFARtype{CFARselection}]);
xlabel('Threshold Multiplier');
ylabel('Probability of False Alarm')




124
%
% ===============================================
% Probability of False Alarm - Clutter Wall
% ===============================================
%
% Computes the Probability of False Alarm with varying clutter edge
% interference for various CFAR
%
% ASSUMPTION
% Swerling I/II Target
% Exponential Noise/Clutter
%
% AUTHORSHIP
% James Jen
% Cal Poly Pomona
% Jimmy.Jen@Gmail.com
%
% %UPDATES
% May 28th, 2011 Created
% May 31st, 2011 Updated for faster CFAR functions
%



clear all
close all
clc


% ######################### %
% Simulation Parameters %
% ######################### %

CNR_dB=10;
Pfa=10^-4; %Desired probability of false alarm
nTrial=1.5*10^6; %Number of trials to run

N=32;
nGuardCell=1; %number of Guard Cells




% ################### %
% CFAR Parameters %
% ################### %
%CFAR window size
k_OS=round(N*0.7); %OS-CFAR k-rank
k_OSGO=round(0.6*N/2); %k_OSGO k_rank




% ############################## %
% CFAR selection and setting %
% ############################## %

%CFAR numbering
B.2ProbabilityofFalseAlarminClutterWallEnvironment
125
CA=1;
OS=2;
GOCA=3;
SOCA=4;
OSGO=5;
VI=6;
S=7;
SVI=8;

%Total number of CFAR's
nCFAR=6;

%Legend name
CFARtype{CA}='CA-CFAR';
CFARtype{OS}='OS-CFAR';
CFARtype{GOCA}='GOCA-CFAR';
CFARtype{SOCA}='SOCA-CFAR';
CFARtype{OSGO}='OSGO-CFAR';
CFARtype{S}='S-CFAR';
CFARtype{VI}='VI-CFAR';

%CFAR plot color
clr=zeros(nCFAR,3);
clr(CA,:) =[0 0 0 ]/255; %black
clr(OS,:) =[255 0 0 ]/255; %red
clr(GOCA,:)=[153 153 0 ]/255; %brown
clr(SOCA,:)=[0 153 204]/255; %light blue
clr(OSGO,:)=[0 204 51 ]/255; %orange
clr(S,:) =[255 153 0 ]/255; %green
clr(VI,:) =[204 0 204]/255; %purple


% ############################### %
% CFAR Environment Generation %
% ############################### %

CNR=10^(CNR_dB/10);
noisePwr=1; %Noise Power
clutterPwr=noisePwr*CNR;

nWindow=N+2*nGuardCell+1;

pwrNoise=exprnd(noisePwr,nTrial,nWindow);
pwrClutter=exprnd(clutterPwr,nTrial,nWindow);

iCUT=N/2+nGuardCell+1;

iLead=1:N/2;
iTest=N/2+nGuardCell+1;
iLag=N/2+2*nGuardCell+2:nWindow;

iClutterWall=[0 iLead iTest iLag];
nClutterWall=length(iClutterWall);


% ############## %
% Simulation %
% ############## %

threshold=zeros(nTrial,nCFAR);
expPfa=zeros(nClutterWall,nCFAR);
126

for i=1:nClutterWall
clutterWall=iClutterWall(i);

stopBar= progressbar(i/nClutterWall,0);
if(stopBar)
break;
end

if clutterWall==0
pwrSignal=pwrNoise;
pwrCUT=noisePwr;
elseif clutterWall==nWindow
pwrSignal=pwrClutter;
pwrCUT=clutterPwr;
else
iClutter=1:clutterWall;
iNoise=clutterWall+1:nWindow;
pwrSignal(:,iNoise)=pwrNoise(:,iNoise);
pwrSignal(:,iClutter)=pwrClutter(:,iClutter);
if clutterWall>=iCUT
pwrCUT=clutterPwr;
else
pwrCUT=noisePwr;
end
end



threshold(:,CA)=CA_CFAR1(Pfa,N,pwrSignal);
threshold(:,OS)=OS_CFAR1(Pfa,N,k_OS,pwrSignal);
threshold(:,SOCA)=SOCA_CFAR1(Pfa,N,pwrSignal);
threshold(:,GOCA)=GOCA_CFAR1(Pfa,N,pwrSignal);
threshold(:,OSGO)=OSGO_CFAR1(Pfa,N,k_OSGO,pwrSignal);
threshold(:,VI)=VI_CFAR1(Pfa,N,pwrSignal);

expPfa(i,:)=monteCarloFalseAlarm(threshold,pwrCUT);
end
close %close progress bar

% ############ %
% Plotting %
% ############ %

cellLead=1:N/2+1;
iLead=0:N/2;

cellLag=N/2+2:N+2;
iLag=N/2:N;

xMin=0;
xMax=N;
yMin=10^-8;
yMax=10^-0;

%PROBABILITY OF DETECTION CURVE
for iCFAR=1:nCFAR
figure

if iCFAR==CA
semilogy(iLead,expPfa(cellLead,CA),'color',clr
127
(CA,:),'linewidth',1.5)
hold on
elseif iCFAR==OS
semilogy(iLead,expPfa(cellLead,CA),'color',clr
(CA,:),'linewidth',1.5,'linestyle','--')
hold on
semilogy(iLead,expPfa(cellLead,OS),'color',clr
(OS,:),'linewidth',1.5)
else
semilogy(iLead,expPfa(cellLead,CA),'color',clr
(CA,:),'linewidth',1.5,'linestyle','--');
hold on
semilogy(iLead,expPfa(cellLead,OS),'color',clr
(OS,:),'linewidth',1.5,'linestyle','--')
semilogy(iLead,expPfa(cellLead,iCFAR),'color',clr
(iCFAR,:),'linewidth',1.5)
end

%Line marking the designed Probability of False Alarm
line([xMin xMax], [Pfa
Pfa],'color','m','linestyle',':','linewidth',1.5);

%Line marking where the half-window point is
line([N/2 N/2], [yMin
yMax],'color','b','linestyle',':','linewidth',1.5);

if iCFAR==CA
legend([CFARtype([CA])],'location','SouthEast');
semilogy(iLag,expPfa(cellLag,CA),'color',clr(CA,:),'linewidth',1.5)
elseif iCFAR==OS
legend([CFARtype([CA OS])],'location','SouthEast');
semilogy(iLag,expPfa(cellLag,CA),'color',clr
(CA,:),'linewidth',1.5,'linestyle','--')
semilogy(iLag,expPfa(cellLag,OS),'color',clr(OS,:),'linewidth',1.5)
else
legend([CFARtype([CA OS iCFAR])],'location','SouthEast');
semilogy(iLag,expPfa(cellLag,CA),'color',clr
(CA,:),'linewidth',1.5,'linestyle','--');
semilogy(iLag,expPfa(cellLag,OS),'color',clr
(OS,:),'linewidth',1.5,'linestyle','--')
semilogy(iLag,expPfa(cellLag,iCFAR),'color',clr
(iCFAR,:),'linewidth',1.5)
end

ylabel('Probability of False Alarm');
xlabel('Number of Reference Cells in Clutter');

axis([xMin xMax yMin yMax]);
% grid on
% set(gca,'Xcolor',[0.5 0.5 0.5]);
% set(gca,'Ycolor',[0.5 0.5 0.5]);
% Caxes = copyobj(gca,gcf);
% set(Caxes, 'color', 'none', 'xcolor', 'k', 'xgrid', 'off',
'ycolor','k', 'ygrid','off');
end



128
%
% ============================================================
% Probability of Detection - Homogeneous/ Multiple Targets
% ============================================================
%
% This script plots the SNR v. Probabilty of Detection
% and SNR v. CFAR loss for various CFAR algorithms
%
% ASSUMPTION
% Swerling I/II Target
% Exponential Noise/Clutter
%
% AUTHORSHIP
% James Jen
% Cal Poly Pomona
%
% %UPDATES
% May 28th, 2011 Created
% May 31st, 2011 Updated for faster CFAR functions
%



clear all
close all
clc


% ######################### %
% Simulation Parameters %
% ######################### %

iMasking=[5]; %location of masking targets

Pfa=10^-4; %Desired probability of false alarm
nTrial=10^6; %Number of trials to run

SNRdB_set=2:2.5:26; %SNR's to be simulted and plotted


% ################### %
% CFAR Parameters %
% ################### %

N=32; %CFAR window size
k_OS=round(N*0.7); %OS-CFAR k-rank
k_OSGO=round(0.6*N/2); %k_OSGO k_rank
nGuardCell=1; %number of Guard Cells



% ############################## %
% CFAR selection and setting %
% ############################## %

%CFAR numbering
CA=1;
OS=2;
B.3ProbabilityofDetectioninHomogeneous/MultipleTargetEnvironment
129
GOCA=3;
SOCA=4;
OSGO=5;
VI=6;
S=7;
SVI=8;

%Total number of CFAR's
nCFAR=6;

%Legend name
CFARtype{CA}='CA-CFAR';
CFARtype{OS}='OS-CFAR';
CFARtype{GOCA}='GOCA-CFAR';
CFARtype{SOCA}='SOCA-CFAR';
CFARtype{OSGO}='OSGO-CFAR';
CFARtype{S}='S-CFAR';
CFARtype{VI}='VI-CFAR';

%CFAR plot color
clr=zeros(nCFAR,3);
clr(CA,:) =[0 0 0 ]/255; %black
clr(OS,:) =[255 0 0 ]/255; %red
clr(GOCA,:)=[153 153 0 ]/255; %brown
clr(SOCA,:)=[0 153 204]/255; %light blue
clr(OSGO,:)=[0 204 51 ]/255; %orange
clr(S,:) =[255 153 0 ]/255; %green
clr(VI,:) =[204 0 204]/255; %purple


% ############################### %
% CFAR Environment Generation %
% ############################### %

SNR_set=10.^(SNRdB_set/10);
nSNR=length(SNRdB_set);
noisePwr=1; %Noise Power

nWindow=N+2*nGuardCell+1;
iCUT=N/2+nGuardCell+1;


nMasking=length(iMasking);

iTarget=[iMasking iCUT];
nTarget=length(iTarget);

pwrSignal=exprnd(noisePwr,nTrial,nWindow);



% ############## %
% Simulation %
% ############## %

threshold=zeros(nTrial,nCFAR);

Pd=zeros(nSNR,nCFAR);
for iSNR=1:nSNR
SNR=SNR_set(iSNR);
targetPwr=noisePwr*SNR;
130
pwrSignal(:,iTarget)=exprnd(targetPwr+noisePwr,nTrial,nTarget);

stopBar= progressbar(iSNR/nSNR,0);
if(stopBar)
break;
end

threshold(:,CA)=CA_CFAR1(Pfa,N,pwrSignal);
threshold(:,OS)=OS_CFAR1(Pfa,N,k_OS,pwrSignal);
threshold(:,SOCA)=SOCA_CFAR1(Pfa,N,pwrSignal);
threshold(:,GOCA)=GOCA_CFAR1(Pfa,N,pwrSignal);
threshold(:,OSGO)=OSGO_CFAR1(Pfa,N,k_OSGO,pwrSignal);
threshold(:,VI)=VI_CFAR1(Pfa,N,pwrSignal);

nDetection=sum(repmat(pwrSignal(:,iCUT),1,nCFAR)>threshold);

Pd(iSNR,:)=nDetection/nTrial;
end
close %close progress bar

% ############ %
% Plotting %
% ############ %

SNRdB_set=SNRdB_set(:);

%PROBABILITY OF DETECTION CURVE
for iCFAR=1:nCFAR
figure
hold on

%Neyman-Pearson
plot(SNRdB_set,Pd_inf(Pfa,SNRdB_set),'k--');

if iCFAR==CA
plot(SNRdB_set,Pd(:,CA),'color',clr(CA,:),'linewidth',1.5)
legend(['Neyman-Pearson' CFARtype([CA])],'location','SouthEast');
elseif iCFAR==OS
plot(SNRdB_set,Pd(:,CA),'color',clr
(CA,:),'linewidth',1.5,'linestyle',':')
plot(SNRdB_set,Pd(:,OS),'color',clr(OS,:),'linewidth',1.5)
legend(['Neyman-Pearson' CFARtype([CA
OS])],'location','SouthEast');
else
plot(SNRdB_set,Pd(:,CA),'color',clr
(CA,:),'linewidth',1.5,'linestyle',':');
plot(SNRdB_set,Pd(:,OS),'color',clr
(OS,:),'linewidth',1.5,'linestyle',':')
plot(SNRdB_set,Pd(:,iCFAR),'color',clr(iCFAR,:),'linewidth',1.5)
legend(['Neyman-Pearson' CFARtype([CA OS
iCFAR])],'location','SouthEast');
end

ylabel('Probability of Detection');
xlabel('Signal to Noise Ratio (dB)');

%Simulation Title
if nMasking==0
title('\fontsize{11}Probability of Detection - \color{blue}
Homogeneous Environment');
else
131
title(['\fontsize{11}Probability of Detection - \color{blue}'
num2str(nMasking) ' Masking Target']);
end

grid on;
set(gca,'Xcolor',[0.5 0.5 0.5]);
set(gca,'Ycolor',[0.5 0.5 0.5]);
Caxes = copyobj(gca,gcf);
set(Caxes, 'color', 'none', 'xcolor', 'k', 'xgrid', 'off',
'ycolor','k', 'ygrid','off');
end

%CFAR LOSS CURVE

SNRdB_set=SNRdB_set(:);
CFARloss=zeros(nSNR,3);
for iCFAR=1:nCFAR
figure
hold on

if iCFAR==CA
iPd=Pd(:,CA);
SNRoptimal=OptSNR(iPd,Pfa);
CFARloss(:,CA)=SNRdB_set-SNRoptimal;
plot(SNRdB_set,CFARloss(:,CA),'color',clr(CA,:),'linewidth',1.5)

legend([CFARtype([CA])],'location','NorthWest');
elseif iCFAR==OS
iPd=Pd(:,CA);
SNRoptimal=OptSNR(iPd,Pfa);
CFARloss(:,CA)=SNRdB_set-SNRoptimal;
plot(SNRdB_set,CFARloss(:,CA),'color',clr
(CA,:),'linewidth',1.5,'linestyle','--')

iPd=Pd(:,OS);
SNRoptimal=OptSNR(iPd,Pfa);
CFARloss(:,OS)=SNRdB_set-SNRoptimal;
plot(SNRdB_set,CFARloss(:,OS),'color',clr(OS,:),'linewidth',1.5)

legend([CFARtype([CA OS])],'location','NorthWest');
else
iPd=Pd(:,CA);
SNRoptimal=OptSNR(iPd,Pfa);
CFARloss(:,CA)=SNRdB_set-SNRoptimal;
plot(SNRdB_set,CFARloss(:,CA),'color',clr
(CA,:),'linewidth',1.5,'linestyle','--')

iPd=Pd(:,OS);
SNRoptimal=OptSNR(iPd,Pfa);
CFARloss(:,OS)=SNRdB_set-SNRoptimal;
plot(SNRdB_set,CFARloss(:,OS),'color',clr
(OS,:),'linewidth',1.5,'linestyle','--')

iPd=Pd(:,iCFAR);
SNRoptimal=OptSNR(iPd,Pfa);
CFARloss(:,3)=SNRdB_set-SNRoptimal;
plot(SNRdB_set,CFARloss(:,3),'color',clr(iCFAR,:),'linewidth',1.5)
legend([CFARtype([CA OS iCFAR])],'location','NorthWest');
end


132

ylabel('CFAR Loss (dB)');
xlabel('SNR (dB)');
title('CFAR Loss');


xMin=min(SNRdB_set);
xMax=max(SNRdB_set);

yMin=0;
yMax=ceil(2*max(max(CFARloss)))/2;
axis([xMin xMax yMin yMax]);

if nMasking==0
title('\fontsize{11}CFAR Loss - \color{blue}Homogeneous Environ-
ment');
else
title(['\fontsize{11}CFAR Loss - \color{blue}' num2str(nMasking) '
Masking Target']);
end

grid on;
set(gca,'Xcolor',[0.5 0.5 0.5]);
set(gca,'Ycolor',[0.5 0.5 0.5]);
Caxes = copyobj(gca,gcf);
set(Caxes, 'color', 'none', 'xcolor', 'k', 'xgrid', 'off',
'ycolor','k', 'ygrid','off');
end


133
B.4ProbabilityofDetectioninClutterWallEnvironment
%
% ===============================================
% Probability of False Alarm - Clutter Wall
% ===============================================
%
% Computes the Probability of False Alarm with varying clutter edge
% interference for various CFAR
%
% ASSUMPTION
% Swerling I/II Target
% Exponential Noise/Clutter
%
% AUTHORSHIP
% James Jen
% Cal Poly Pomona
% Jimmy.Jen@Gmail.com
%
% %UPDATES
% May 28th, 2011 Created
% May 31st, 2011 Updated for faster CFAR functions
%



clear all
close all
clc


% ######################### %
% Simulation Parameters %
% ######################### %

CNR_dB=10;
SNR_dB=15;
Pfa=10^-4; %Desired probability of false alarm
nTrial=1.5*10^6; %Number of trials to run

N=32;
nGuardCell=1; %number of Guard Cells




% ################### %
% CFAR Parameters %
% ################### %
%CFAR window size
k_OS=round(N*0.7); %OS-CFAR k-rank
k_OSGO=round(0.6*N/2); %k_OSGO k_rank




% ############################## %
% CFAR selection and setting %
% ############################## %

134
%CFAR numbering
CA=1;
OS=2;
GOCA=3;
SOCA=4;
OSGO=5;
VI=6;
S=7;
SVI=8;

%Total number of CFAR's
nCFAR=6;

%Legend name
CFARtype{CA}='CA-CFAR';
CFARtype{OS}='OS-CFAR';
CFARtype{GOCA}='GOCA-CFAR';
CFARtype{SOCA}='SOCA-CFAR';
CFARtype{OSGO}='OSGO-CFAR';
CFARtype{S}='S-CFAR';
CFARtype{VI}='VI-CFAR';
CFARtype{nCFAR+1}='N/2 cells in clutter';

%CFAR plot color
clr=zeros(nCFAR,3);
clr(CA,:) =[0 0 0 ]/255; %black
clr(OS,:) =[255 0 0 ]/255; %red
clr(GOCA,:)=[153 153 0 ]/255; %brown
clr(SOCA,:)=[0 153 204]/255; %light blue
clr(OSGO,:)=[0 204 51 ]/255; %orange
clr(S,:) =[255 153 0 ]/255; %green
clr(VI,:) =[204 0 204]/255; %purple


% ############################### %
% CFAR Environment Generation %
% ############################### %
SNR=10^(SNR_dB/10);
CNR=10^(CNR_dB/10);
noisePwr=1; %Noise Power
clutterPwr=noisePwr*CNR;
targetPwr=noisePwr*SNR;
nWindow=N+2*nGuardCell+1;

pwrNoise=exprnd(noisePwr,nTrial,nWindow);
pwrClutter=exprnd(clutterPwr,nTrial,nWindow);

iCUT=N/2+nGuardCell+1;

iLead=1:N/2;
iTest=N/2+nGuardCell+1;
iLag=N/2+2*nGuardCell+2:nWindow;

iClutterWall=[0 iLead iTest iLag];
nClutterWall=length(iClutterWall);


% ############## %
% Simulation %
% ############## %

135
threshold=zeros(nTrial,nCFAR);
expPd=zeros(nClutterWall,nCFAR);

for i=1:nClutterWall
clutterWall=iClutterWall(i);

stopBar= progressbar(i/nClutterWall,0);
if(stopBar)
break;
end

if clutterWall==0
pwrSignal=pwrNoise;
pwrCUT=noisePwr;
elseif clutterWall==nWindow
pwrSignal=pwrClutter;
pwrCUT=clutterPwr;
else
iClutter=1:clutterWall;
iNoise=clutterWall+1:nWindow;
pwrSignal(:,iNoise)=pwrNoise(:,iNoise);
pwrSignal(:,iClutter)=pwrClutter(:,iClutter);
if clutterWall>=iCUT
pwrCUT=clutterPwr;
else
pwrCUT=noisePwr;
end
end



threshold(:,CA)=CA_CFAR1(Pfa,N,pwrSignal);
threshold(:,OS)=OS_CFAR1(Pfa,N,k_OS,pwrSignal);
threshold(:,SOCA)=SOCA_CFAR1(Pfa,N,pwrSignal);
threshold(:,GOCA)=GOCA_CFAR1(Pfa,N,pwrSignal);
threshold(:,OSGO)=OSGO_CFAR1(Pfa,N,k_OSGO,pwrSignal);
threshold(:,VI)=VI_CFAR1(Pfa,N,pwrSignal);

if i<=(nClutterWall/2)
pwrTarget=exprnd(noisePwr+targetPwr,nTrial,nCFAR);
else
pwrTarget=exprnd(clutterPwr+targetPwr,nTrial,nCFAR);
end

iDetection=pwrTarget>threshold;
nDetection=sum(iDetection,1);
expPd(i,:)=nDetection/nTrial;
end
close %close progress bar




% ############ %
% Plotting %
% ############ %

cellLead=1:N/2+1;
iLead=0:N/2;

cellLag=N/2+2:N+2;
136
iLag=N/2:N;

xMin=0;
xMax=N;
yMin=0;
yMax=1;

%PROBABILITY OF DETECTION CURVE
for iCFAR=1:nCFAR
figure

if iCFAR==CA
plot(iLead,expPd(cellLead,CA),'color',clr(CA,:),'linewidth',1.5)
hold on
elseif iCFAR==OS
plot(iLead,expPd(cellLead,CA),'color',clr
(CA,:),'linewidth',1.5,'linestyle','--')
hold on
plot(iLead,expPd(cellLead,OS),'color',clr(OS,:),'linewidth',1.5)
else
plot(iLead,expPd(cellLead,CA),'color',clr
(CA,:),'linewidth',1.5,'linestyle','--');
hold on
plot(iLead,expPd(cellLead,OS),'color',clr
(OS,:),'linewidth',1.5,'linestyle','--')
plot(iLead,expPd(cellLead,iCFAR),'color',clr
(iCFAR,:),'linewidth',1.5)
end

%Line marking where the half-window point is
line([N/2 N/2], [yMin
yMax],'color','m','linestyle',':','linewidth',1.5);

if iCFAR==CA
legend(CFARtype([CA end]),'location','NorthEast');
plot(iLag,expPd(cellLag,CA),'color',clr(CA,:),'linewidth',1.5)
elseif iCFAR==OS
legend([CFARtype([CA OS end])],'location','NorthEast');
plot(iLag,expPd(cellLag,CA),'color',clr
(CA,:),'linewidth',1.5,'linestyle','--')
plot(iLag,expPd(cellLag,OS),'color',clr(OS,:),'linewidth',1.5)
else
legend([CFARtype([CA OS iCFAR end])],'location','NorthEast');
plot(iLag,expPd(cellLag,CA),'color',clr
(CA,:),'linewidth',1.5,'linestyle','--');
plot(iLag,expPd(cellLag,OS),'color',clr
(OS,:),'linewidth',1.5,'linestyle','--')
plot(iLag,expPd(cellLag,iCFAR),'color',clr
(iCFAR,:),'linewidth',1.5)
end

ylabel('Probability of Detection');
xlabel('Number of Reference Cells in Clutter');

axis([xMin xMax yMin yMax]);
% grid on
% set(gca,'Xcolor',[0.5 0.5 0.5]);
% set(gca,'Ycolor',[0.5 0.5 0.5]);
% Caxes = copyobj(gca,gcf);
% set(Caxes, 'color', 'none', 'xcolor', 'k', 'xgrid', 'off',
'ycolor','k', 'ygrid','off');
end
137

Вам также может понравиться