MATLAB Answers

How to use CFAR algorithm in my case

18 views (last 30 days)
Chen yuru
Chen yuru on 14 Nov 2019
Edited: Chen yuru on 14 Nov 2019
Hello,
I have a spectrum in test.mat. (as shown in Figure, size is 1024 x 32)
I would like to do CFAR to detect tearget.
I reference Constant False Alarm Rate (CFAR) Detection in matlab code.(link as shown in below)
But it doesn't work.
----------------------
It appears error:
Error using step
Expected Row 2 of Idx to be an array with all of the values <= 32.
Error in sigdatatypes.validateIndex (line 36)
validateattributes(x,type,varargin{2},funcname,varname);
Error in phased.CFARDetector2D/stepImpl (line 320)
sigdatatypes.validateIndex(Idx(2,:),'step','Row 2 of Idx',...
---------------------
Could you please tell me how to revised the code.
Thanks!
load test.mat
cfar2D = phased.CFARDetector2D('GuardBandSize',2,'TrainingBandSize',5,...
'ProbabilityFalseAlarm',1e-5);
dopGrid = 1:1024;
rngGrid = 1:32;
[~,rangeIndx] = min(abs(rngGrid'-[1 32]));
[~,dopplerIndx] = min(abs(dopGrid'-[1 1024]));
[columnInds,rowInds] = meshgrid(dopplerIndx(1):dopplerIndx(2),...
rangeIndx(1):rangeIndx(2));
CUTIdx = [rowInds(:) columnInds(:)]';
detections = cfar2D(test,CUTIdx);
helperDetectionsMap(test,rngGrid,dopGrid,rangeIndx,dopplerIndx,detections)

  0 Comments

Sign in to comment.

Answers (0)

Sign in to answer this question.