2D CFAR on Radar data

9 次查看(过去 30 天)
Praanesh Sambath
Praanesh Sambath 2022-8-24
回答: Naren 2023-10-25
I am trying to perform 2D CFAR on a radar daa cube (4D) which is structured as 512*256*3*4 corresponding to No.Samples * No.Chiprs * No.Tx * No.Rx. The computatuinal time to determine the CUTidx takes a lot of time and so does the CFAR. I am running this real time so the code reaches to 2D CFAR it hangs and doesnt work further. Can someone please let me know if I have done any mistake in implimenting the 2D CFAR. The data file is 11MB hence could not attach it. This is the code I am using.
detector = phased.CFARDetector2D('TrainingBandSize',[16,8], ...
'ThresholdFactor','Auto','GuardBandSize',[7,7], ...
'ProbabilityFalseAlarm',5e-4,'Method','OS','Rank',...
floor(length('TrainingBandSize')*3/4),...
'OutputFormat','CUT result');
Ngc = detector.GuardBandSize(2);
Ngr = detector.GuardBandSize(1);
Ntc = detector.TrainingBandSize(2);
Ntr = detector.TrainingBandSize(1);
cutidx = [];
colstart = Ntc + Ngc + 1;
colend = size(v_vect,2) - ( Ntc + Ngc);
rowstart = Ntr + Ngr + 1;
rowend = size(r_vect,2) - ( Ntr + Ngr);
r_tot=size(r_vect,2)-rowend;
c_tot=size(v_vect,2)-colend;
cut_r=rowend-rowstart+1;
cut_c=colend-colstart+1;
for m = colstart:colend % code hangs here
for n = rowstart:rowend
cutidx = [cutidx,[n;m]];
end
end
[dets] = detector(real_rng_vel_fft(:,:,1,1),cutidx); % initially performing only on 1Tx and 1Rx

回答(1 个)

Naren
Naren 2023-10-25
Hello Praanesh,
I understand that you are attempting to perform 2D CFAR on a radar data cube. However, the computational time required to determine the CUTidx is quite long, and in real-time, the code hangs and fails to run.
I have identified some areas in your code where improvements can be made to enchance its efficiency and potentially resolve the issues.
It appears that you have an issue in your CFAR detector setup, particularly with the 'Rank' parameter. The correction is as follows:
'Rank', floor (Ntc * Ntr * 3/4)
Please ensure that you're using the actual values of `Ntc` and `Ntr` in this calculation, rather than the string length 'TrainingBandSize'.
Additionally, your `cutidx` calculation logic seems sound. However, it may be more efficient to preallocate the array for performance and clarity.
Regards,
Naren

类别

Help CenterFile Exchange 中查找有关 Environment and Clutter 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by