Detector Performance Analysis Using ROC Curves
Detector Performance Analysis Using ROC Curves
DetectorPerformanceAnalysisUsingROCCurves
Thisexampleshowshowyoucanassesstheperformanceofbothcoherent
andnoncoherentsystemsusingreceiveroperatingcharacteristic(ROC) OpenScript
curves.Itassumesthedetectoroperatesinanadditivecomplexwhite
Gaussiannoiseenvironment.
ROCcurvesareoftenusedtoassesstheperformanceofaradarorsonardetector.ROCcurvesareplotsofthe
probabilityofdetection(Pd)vs.theprobabilityoffalsealarm(Pfa)foragivensignaltonoiseratio(SNR).
Introduction
Theprobabilityofdetection(Pd)istheprobabilityofsayingthat"1"istruegiventhatevent"1"occurred.Theprobabilityof
falsealarm(Pfa)istheprobabilityofsayingthat"1"istruegiventhatthe"0"eventoccurred.Inapplicationssuchas
sonarandradar,the"1"eventindicatesthatatargetispresent,andthe"0"eventindicatesthatatargetisnotpresent.
Adetector'sperformanceismeasuredbyitsabilitytoachieveacertainprobabilityofdetectionandprobabilityoffalse
alarmforagivenSNR.Examiningadetector'sROCcurvesprovidesinsightintoitsperformance.Wecanusetherocsnr
functiontocalculateandplotROCcurves.
SinglePulseDetection
GivenanSNRvalue,youcancalculatethePdandPfavaluesthatalinearorsquarelawdetectorcanachieveusinga
singlepulse.AssumingwehaveanSNRvalueof8dBandourrequirementsdictateaPfavalueofatmost1%,what
valueofPdcanthedetectorachieve?WecanusetherocsnrfunctiontocalculatethePdandPfavaluesandthen
determinewhatvalueofPdcorrespondstoPfa=0.01.Notethatbydefaulttherocsnrfunctionassumescoherent
detection.
[Pd,Pfa]=rocsnr(8);
idx=find(Pfa==0.01);%findindexforPfa=0.01
UsingtheindexdeterminedabovewecanfindthePdvaluethatcorrespondstoPfa=0.01.
Pd(idx)
ans=
0.8899
OnefeatureoftherocsnrfunctionisthatyoucanspecifyavectorofSNRvaluesandrocsnrcalculatestheROCcurvefor
eachoftheseSNRvalues.InsteadofindividuallycalculatingPdandPfavaluesforagivenSNR,wecanviewtheresults
inaplotofROCcurves.TherocsnrfunctionplotstheROCcurvesbydefaultifnooutputargumentsarespecified.Calling
therocsnrfunctionwithaninputvectoroffourSNRvaluesandnooutputargumentsproducesaplotoftheROCcurves.
SNRvals=[2489.4];
rocsnr(SNRvals);
https://www.mathworks.com/help/phased/examples/detectorperformanceanalysisusingroccurves.html 1/7
2/19/2017 DetectorPerformanceAnalysisUsingROCCurvesMATLAB&SimulinkExample
Intheplotwecanselectthedatacursorbuttoninthetoolbar(orintheToolsmenu)andthenselecttheSNR=8dBcurve
atthepointwherePd=0.9toverifythatPfaisapproximately0.01.
MultiplePulseDetection
Onewaytoimproveadetector'sperformanceistoaverageoverseveralpulses.Thisisparticularlyusefulincaseswhere
thesignalofinterestisknownandoccursinadditivecomplexwhitenoise.Althoughthisstillappliestobothlinearand
squarelawdetectors,theresultforsquarelawdetectorscouldbeoffbyabout0.2dB.Let'scontinueourexampleby
assuminganSNRof8dBandaveragingovertwopulses.
rocsnr(8,'NumPulses',2);
https://www.mathworks.com/help/phased/examples/detectorperformanceanalysisusingroccurves.html 2/7
2/19/2017 DetectorPerformanceAnalysisUsingROCCurvesMATLAB&SimulinkExample
Byinspectingtheplotwecanseethataveragingovertwopulsesresultedinahigherprobabilityofdetectionforagiven
falsealarmrate.WithanSNRof8dBandaveragingovertwopulses,youcanconstraintheprobabilityoffalsealarmto
beatmost0.0001andachieveaprobabilityofdetectionof0.9.Recallthatforasinglepulse,wehadtoallowthe
probabilityoffalsealarmtobeasmuchas1%toachievethesameprobabilityofdetection.
NoncoherentDetector
Tothispoint,wehaveassumedweweredealingwithaknownsignalincomplexwhiteGaussiannoise.Therocsnr
functionbydefaultassumesacoherentdetector.Toanalyzetheperformanceofadetectorforthecasewherethesignal
isknownexceptforthephase,youcanspecifyanoncoherentdetector.UsingthesameSNRvaluesasbefore,let's
analyzetheperformanceofanoncoherentdetector.
rocsnr(SNRvals,'SignalType','NonfluctuatingNoncoherent');
https://www.mathworks.com/help/phased/examples/detectorperformanceanalysisusingroccurves.html 3/7
2/19/2017 DetectorPerformanceAnalysisUsingROCCurvesMATLAB&SimulinkExample
FocusontheROCcurvecorrespondingtoanSNRof8dB.Byinspectingthegraphwiththedatacursor,youcanseethat
toachieveaprobabilityofdetectionof0.9,youmusttolerateafalsealarmprobabilityofupto0.05.Withoutusingphase
information,weneedahigherSNRtoachievethesamePdforagivenPfa.Fornoncoherentlineardetectors,wecanuse
Albersheim'sequationtodeterminewhatvalueofSNRwillachieveourdesiredPdandPfa.
SNR_valdB=albersheim(0.9,.01)%Pd=0.9andPfa=0.01
SNR_valdB=
9.5027
PlottingtheROCcurvefortheSNRvalueapproximatedbyAlbersheim'sequation,wecanseethatthedetectorwill
achievePd=0.9andPfa=0.01.NotethattheAlbersheim'stechniqueappliesonlytononcoherentdetectors.
rocsnr(SNR_valdB,'SignalType','NonfluctuatingNoncoherent');
https://www.mathworks.com/help/phased/examples/detectorperformanceanalysisusingroccurves.html 4/7
2/19/2017 DetectorPerformanceAnalysisUsingROCCurvesMATLAB&SimulinkExample
DetectionofFluctuatingTargets
Allthediscussionsaboveassumethatthetargetisnonfluctuating,whichmeansthatthetarget'sstatistical
characteristicsdonotchangeovertime.However,inrealscenarios,targetscanaccelerateanddecelerateaswellasroll
andpitch.Thesefactorscausethetarget'sradarcrosssection(RCS)tovaryovertime.Asetofstatisticalmodelscalled
SwerlingmodelsareoftenusedtodescribetherandomvariationintargetRCS.
TherearefourSwerlingmodels,namelySwerling14.ThenonfluctuatingtargetisoftentermedeitherSwerling0or
Swerling5.EachSwerlingmodeldescribeshowatarget'sRCSvariesovertimeandtheprobabilitydistributionofthe
variation.
BecausethetargetRCSisvarying,theROCcurvesforfluctuatingtargetsarenotthesameasthenonfluctuatingones.In
addition,becauseSwerlingtargetsaddrandomphaseintothereceivedsignal,itishardertouseacoherentdetectorfora
Swerlingtarget.Therefore,noncoherentdetectiontechniquesareoftenusedforSwerlingtargets.
LetusnowcomparetheROCcurvesforanonfluctuatingtargetandaSwerling1target.Inparticular,wewanttoexplore
whattheSNRrequirementsareforbothsituationsifwewanttoachievethesamePdandPfa.Forsuchacomparison,it
isofteneasytoplottheROCcurveasPdagainstSNRwithvaryingPfa.WecanusetherocpfafunctiontoplotROC
curveinthisform.
Letusassumethatwearedoingnoncoherentdetectionwith10integratedpulses,withthedesiredPfabeingatmost1e8.
WefirstplottheROCcurveforanonfluctuatingtarget.
rocpfa(1e8,'NumPulses',10,'SignalType','NonfluctuatingNoncoherent')
https://www.mathworks.com/help/phased/examples/detectorperformanceanalysisusingroccurves.html 5/7
2/19/2017 DetectorPerformanceAnalysisUsingROCCurvesMATLAB&SimulinkExample
WethenplottheROCcurveforaSwerling1targetforcomparison.
rocpfa(1e8,'NumPulses',10,'SignalType','Swerling1')
Fromthefigures,wecanseethatforaPdof0.9,werequireanSNRofabout6dBifthetargetisnonfluctuating.
However,ifthetargetisaSwerlingcase1model,therequiredSNRjumpstomorethan14dB,an8dBdifference.This
willgreatlyimpactthedesignofthesystem.
https://www.mathworks.com/help/phased/examples/detectorperformanceanalysisusingroccurves.html 6/7
2/19/2017 DetectorPerformanceAnalysisUsingROCCurvesMATLAB&SimulinkExample
Asinthecaseofnonfluctuatingtargets,wehaveapproximationequationstohelpdeterminetherequiredSNRwithout
havingtoplotallthecurves.TheequationusedforfluctuatingtargetsisShnidman'sequation.Forthescenarioweusedto
plottheROCcurves,theSNRrequirementscanbederivedusingtheshnidmanfunction.
snr_sw1_db=shnidman(0.9,1e8,10,1)%Pd=0.9,Pfa=1e8,10pulses,
%Swerlingcase1
snr_sw1_db=
14.7131
ThecalculatedSNRrequirementmatchesthevaluederivedfromthecurve.
Summary
ROCcurvesareusefulforanalyzingdetectorperformance,bothforcoherentandnoncoherentsystems.Weusedthe
rocsnrfunctiontoanalyzetheeffectivenessofalineardetectorforvariousSNRvalues.Wealsoreviewedthe
improvementindetectorperformanceachievedbyaveragingmultiplesamples.Lastlyweshowedhowwecanusethe
rocsnrandrocpfafunctionstoanalyzedetectorperformancewhenusinganoncoherentdetectorforbothnonfluctuating
andfluctuatingtargets.
https://www.mathworks.com/help/phased/examples/detectorperformanceanalysisusingroccurves.html 7/7