How to use CFAR algorithm in my case

9 views (last 30 days)
Chen yuru
Chen yuru on 14 Nov 2019
Edited: Alaa Eddin Ziadah on 15 Dec 2020
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)
  1 Comment
Alaa Eddin Ziadah
Alaa Eddin Ziadah on 15 Dec 2020
Edited: Alaa Eddin Ziadah on 15 Dec 2020
Hello Chen,
I have now the same task with CFAR to detect tearget in thermal images, but i have also the same error in matlab.
Can you kindly tell me, if you could have to solve this Problem .
Thank you.
Best wishes

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!