Skip to content
Snippets Groups Projects
Commit 447fe793 authored by lmaresz's avatar lmaresz
Browse files

BeamWidth

parent a9cf7250
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,7 @@ classdef FarField < handle
c1 = (obj.aperture.size/(2*nr))*2*pi/obj.nFi;
c2 = 1i*2*pi/obj.wavelength;
for i = 1:nTheta
if getappdata(progressBar2,'canceling')
break;
......@@ -48,6 +49,10 @@ classdef FarField < handle
end
end
end
R = 2*obj.aperture.size^2/obj.wavelength;
field = field * (exp(-1i*2*pi*R/obj.wavelength)/obj.wavelength/R);
obj.field = field;
delete(progressBar2)
end
......@@ -58,11 +63,22 @@ classdef FarField < handle
end
figure;
y = abs(obj.field);
y = y/max(y);
%y = y/max(y);
plot(obj.theta*180/pi, 20*log10(y));
title("Távoltér");
xlabel("\Theta [°]");
ylabel("S [dB]");
end
function beamWidth = getBeamWidth(obj)
if isempty(obj.field)
obj.calculate();
end
normField = abs(obj.field)/max(abs(obj.field));
maxIndex = find(normField == 1, 1);
localMins = islocalmin(normField);
localMinIndexes = find(localMins == 1);
beamWidth = (min(abs(localMinIndexes - maxIndex))+1)*(obj.theta(2)-obj.theta(1))*2
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment