How to use CFAR algorithm in my case
7 views (last 30 days)
Show older comments
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
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
Answers (0)
See Also
Categories
Find more on Detection in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!