Skip to content
Snippets Groups Projects
Commit beb56ecc authored by frey.balazs96's avatar frey.balazs96 :eggplant:
Browse files

FarField számítás

parent c4e7485b
Branches
No related tags found
No related merge requests found
classdef FarField
properties
end
methods (Static)
function field = CalculateFarField(ntheta, nfi, apertureSize, wavelength, histogram)
field = zeros(1, ntheta);
theta = linspace(-pi/6, pi/6, ntheta);
fi = linspace(0, 2*pi, nfi);
nr = floor(length(histogram)/2);
r = linspace(0, apertureSize/2, nr);
for i = 1:ntheta
er = [cos(theta(i)) sin(theta(i)) 0];
for j = 1:nr
for k = 1:nfi
rv = [0 r(j)*sin(fi(k)) r(j)*cos(fi(k))];
area = (apertureSize/(2*nr)) * r(j)*2*pi/nfi;
field(i) = field(i) + histogram(2*nr-j+1)*exp(1i*2*pi*rv*er'/wavelength)*area;
end
end
end
end
end
end
...@@ -4,7 +4,7 @@ reflectors(end+1) = ParabolaReflector([0 0], 4, 3); ...@@ -4,7 +4,7 @@ reflectors(end+1) = ParabolaReflector([0 0], 4, 3);
reflectors(end+1) = BalazsAperture([3 0], 20, 1000); reflectors(end+1) = BalazsAperture([3 0], 20, 1000);
start = Vect(1, 0); start = Vect(1, 0);
n_ray = 100000; n_ray = 10000;
phi_start = -pi;%angle(1-1i); phi_start = -pi;%angle(1-1i);
phi_stop = pi;%angle(1+1i); phi_stop = pi;%angle(1+1i);
phi = linspace(phi_start, phi_stop, n_ray); phi = linspace(phi_start, phi_stop, n_ray);
...@@ -31,3 +31,10 @@ ylim([-4 4]); ...@@ -31,3 +31,10 @@ ylim([-4 4]);
histogram = reflectors(end).getCollisionHistogram(); histogram = reflectors(end).getCollisionHistogram();
figure(2); figure(2);
plot(histogram); plot(histogram);
%field = FarField.CalculateFarField(1000, 500, 20, 0.01, histogram);
%field = abs(field);
%field = field/max(field);
%plot(20*log10(field));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment