How to use CFAR algorithm in my case

8 次查看(过去 30 天)
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 个评论
Alaa Eddin Ziadah
Alaa Eddin Ziadah 2020-12-15
编辑:Alaa Eddin Ziadah 2020-12-15
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

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Spectral Measurements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by