Skip to content
Snippets Groups Projects
Commit 514ca92c authored by ftomi's avatar ftomi
Browse files

plot fixes

parent 239f618b
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,10 @@ classdef BalazsAperture < Aperture ...@@ -29,7 +29,10 @@ classdef BalazsAperture < Aperture
histogram = obj.getCollisionHistogram(); histogram = obj.getCollisionHistogram();
figure; figure;
x = linspace(-obj.size/2, obj.size/2, length(histogram)); x = linspace(-obj.size/2, obj.size/2, length(histogram));
subplot(2,1,1);
plot(x, abs(histogram)); plot(x, abs(histogram));
subplot(2,1,2);
plot(x, angle(histogram));
title("Apertúrán áthaladó sugarak eloszlása"); title("Apertúrán áthaladó sugarak eloszlása");
xlabel("Pozíció"); xlabel("Pozíció");
ylabel("Sugarak száma"); ylabel("Sugarak száma");
......
...@@ -84,11 +84,12 @@ classdef FarField < handle ...@@ -84,11 +84,12 @@ classdef FarField < handle
end end
figure; figure;
y = abs(obj.field); y = abs(obj.field);
%y = y/max(y); y = y/max(y);
plot(obj.theta*180/pi, 20*log10(y)); plot(obj.theta*180/pi, 20*log10(y));
title("Távoltér"); title("Távoltér");
xlabel("\Theta [°]"); xlabel("\Theta [°]");
ylabel("S [dB]"); ylabel("S [dB]");
ylim([-40 0]);
end end
function beamWidth = getBeamWidth(obj) function beamWidth = getBeamWidth(obj)
......
...@@ -18,7 +18,7 @@ classdef SegmentedAperture < Aperture ...@@ -18,7 +18,7 @@ classdef SegmentedAperture < Aperture
if length(trace.rays) == length(obj.prevTrace.rays) if length(trace.rays) == length(obj.prevTrace.rays)
segmentSize = abs(obj.prevCol.pos.y - col.pos.y); segmentSize = abs(obj.prevCol.pos.y - col.pos.y);
obj.segments.add(Segment(obj.prevCol.pos.y, col.pos.y, ... obj.segments.add(Segment(obj.prevCol.pos.y, col.pos.y, ...
trace.complexAmplitude/segmentSize * exp(1i*mod(trace.length, trace.wavelength)))); trace.complexAmplitude/segmentSize * exp(1i*2*pi*mod(trace.length, trace.wavelength)/trace.wavelength)));
end end
end end
obj.prevTrace = trace; obj.prevTrace = trace;
...@@ -37,9 +37,16 @@ classdef SegmentedAperture < Aperture ...@@ -37,9 +37,16 @@ classdef SegmentedAperture < Aperture
[histogram,x1, x2] = obj.getCollisionHistogram(); [histogram,x1, x2] = obj.getCollisionHistogram();
plot(0, 0); plot(0, 0);
hold on; hold on;
for k = 1:length(histogram) % for k = 1:length(histogram)
plot([x1(k) x2(k)], [abs(histogram(k)), abs(histogram(k))],'b'); % plot([x1(k) x2(k)], [abs(histogram(k)), abs(histogram(k))],'b');
end % end
x = [x1; x2];
h = [histogram; histogram];
subplot(2,1,1);
plot(x(:), abs(h(:)));
subplot(2,1,2);
plot(x(:), angle(h(:)));
%plot(x(:), h(:), 'b');
hold off; hold off;
end end
end end
......
%clear clear
%close all close all
reflectors = [PlaneReflector([2 0], 2), ParabolaReflector([0 0], 4, 3)]; reflectors = [PlaneReflector([2 0], 2), ParabolaReflector([0 0], 4, 3)];
%reflectors = [PlaneReflector([-1 1], 0)]; %reflectors = [PlaneReflector([-1 1], 0)];
aperture = BalazsAperture([3 0], 20, 400); aperture = BalazsAperture([3 0], 20, 1000);
aperture2 = SegmentedAperture([3 0], 20); aperture2 = SegmentedAperture([3 0], 20);
antenna = Antenna(Vect(1,0), [ones(1,125), zeros(1,750), ones(1,125)], zeros(1,1000)); antenna = Antenna(Vect(1,0), [ones(1,1250), zeros(1,7500), ones(1,1250)], zeros(1,10000));
%antenna = Antenna(Vect(1,0)); % antenna = Antenna(Vect(1,0), ones(1,10000), zeros(1,10000));
wavelength = 3e8/1e9; wavelength = 3e8/1e9;
nRay = 10000; nRay = 10000;
nRay2 = 1000; nRay2 = 2000;
rtx = RTX(reflectors, aperture, antenna, wavelength, nRay); rtx = RTX(reflectors, aperture, antenna, wavelength, nRay);
rtx.trace(); rtx.trace();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment