Initial Commit.
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
function [esti_ang_deg, P_CBF] = df_cbf(snapshot, test_ang_elev_deg, test_ang_azi_deg, lambda_c, array_struct, Ntarget)
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%
|
||||
% Conventioanl Beamforming algorithm for df
|
||||
% Start : 23.08.25
|
||||
% End : 23.08.25
|
||||
% developed by Kwanggoo Yeo
|
||||
%
|
||||
% Description
|
||||
% - Input
|
||||
% - 1) snapshot [matrix], [-] : raw data(snapshot) for df
|
||||
% - 2) test_ang_elev_deg [vector], [deg] : elevation angle grid for beamforming
|
||||
% - 3) test_ang_azi_deg [vector], [deg] : Azimuth angle grid for beamforming
|
||||
% - 4) lambda_c [scalar], [m] : wavelength of center frequency
|
||||
% - 4) array_struct [struct], [-] : Structure containing virtual array information
|
||||
% - 5) Ntarget [scalar], [-] : The number of targets in snapshot
|
||||
%
|
||||
% - Output
|
||||
% - 1) esti_ang_deg [matrix], [deg] : The estimated angles by CBF
|
||||
% - 2) P_CBF [matrix], [linear] : power spectrum of CBF
|
||||
%
|
||||
% History
|
||||
% (23.08.25) Completed
|
||||
%
|
||||
% Referece
|
||||
% -
|
||||
%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
% Spectrum
|
||||
P_CBF = zeros(length(test_ang_elev_deg), length(test_ang_azi_deg));
|
||||
for ang_elev_idx = 1 : length(test_ang_elev_deg)
|
||||
for ang_azi_idx = 1 : length(test_ang_azi_deg)
|
||||
sv = exp(-1i * 2 * pi / lambda_c * ( array_struct.azi_eff_ch_loc.' * array_struct.lambda_c * cosd(test_ang_elev_deg(ang_elev_idx)) * sind(test_ang_azi_deg(ang_azi_idx)) + array_struct.elev_eff_ch_loc.' * array_struct.lambda_c * sind(test_ang_elev_deg(ang_elev_idx))));
|
||||
P_CBF(ang_elev_idx, ang_azi_idx) = abs((sum(sv'*snapshot))).^2;
|
||||
end
|
||||
end
|
||||
|
||||
if size(P_CBF, 1) == 1
|
||||
[pks, pks_ang, ~, ~] = findpeaks(pow2db(abs(P_CBF)), test_ang_azi_deg);
|
||||
[~, order] = sort(pks, 'descend');
|
||||
if isempty(pks)
|
||||
esti_ang_deg = nan;
|
||||
else
|
||||
esti_ang_deg = pks_ang(order(1:Ntarget));
|
||||
end
|
||||
elseif size(P_CBF, 2) == 1
|
||||
[pks, pks_ang, ~, ~] = findpeaks(pow2db(abs(P_CBF)), test_ang_elev_deg);
|
||||
[~, order] = sort(pks, 'descend');
|
||||
if isempty(pks)
|
||||
esti_ang_deg = nan;
|
||||
else
|
||||
esti_ang_deg = pks_ang(order(1:Ntarget));
|
||||
end
|
||||
else
|
||||
[pks, locs_x, locs_y] = peaks2(pow2db(abs(P_CBF)));
|
||||
[~, order] = sort(pks, 'descend');
|
||||
if isempty(pks)
|
||||
esti_ang_deg = nan;
|
||||
else
|
||||
esti_ang_deg = [test_ang_elev_deg(locs_x(order(1:Ntarget))).' test_ang_azi_deg(locs_y(order(1:Ntarget))).'];
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user