Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
antennaHF
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ftomi
antennaHF
Commits
c92ce86e
Commit
c92ce86e
authored
5 years ago
by
lmaresz
Browse files
Options
Downloads
Patches
Plain Diff
Modified Antenna, ray generation
parent
69f6081e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
RTX class/Antenna.m
+31
-15
31 additions, 15 deletions
RTX class/Antenna.m
RTX class/simclass_test.m
+10
-13
10 additions, 13 deletions
RTX class/simclass_test.m
with
41 additions
and
28 deletions
RTX class/Antenna.m
+
31
−
15
View file @
c92ce86e
classdef Antenna
properties
amplitude = ones(1, 1000);
phase = ones(1, 1000);
phase = zeros(1, 1000);
position Vect;
end
methods
function obj = Antenna(amplitude ,phase)
function obj = Antenna(position, amplitude ,phase)
obj.position = position;
if nargin > 1
obj.amplitude = amplitude;
obj.phase = phase;
end
end
function [rays, complex_amplitudes] = generate_rays(obj, phi)
rays(size(phi, 2)) = Ray;
for k = 1:size(phi, 2)
rays(k) = Ray(obj.position, [cos(phi(k)), sin(phi(k))]);
end
complex_amplitudes = obj.get_complex_amplitudes(phi);
end
function plot_characteristics(obj)
phi = linspace(0,2*pi,1000);
polarplot(phi, obj.amplitude, phi, obj.phase);
end
function complex_amplitude = get_ray_data(obj, phi)
function plot_antenna(obj)
plot(obj.position.x, obj.position.y, 'kO', 'MarkerSize', 10);
end
end
methods(Access = protected)
function complex_amplitudes = get_complex_amplitudes(obj, phi)
n = size(phi, 2);
rpower = zeros(1, n-1);
rphase = zeros(1, n-1);
...
...
@@ -25,8 +47,8 @@ classdef Antenna
dphi = 2 * pi / size(obj.amplitude, 2);
for j = 1:n-1
[
m
, start_index] = min(abs(data_phi - phi(j)));
[
m
, stop_index] = min(abs(data_phi - phi(j+1)));
[
~
, start_index] = min(abs(data_phi - phi(j)));
[
~
, stop_index] = min(abs(data_phi - phi(j+1)));
for k = start_index:stop_index
if j ~= 1
&&
k == start_index
continue;
...
...
@@ -35,13 +57,7 @@ classdef Antenna
end
rphase(j) = obj.phase(ceil((start_index + stop_index) / 2));
end
complex_amplitude = rpower.*exp(1i*rphase);
end
function plot(obj)
phi = linspace(0,2*pi,1000);
polarplot(phi, obj.amplitude, phi, obj.phase);
complex_amplitudes = rpower.*exp(1i*rphase);
end
end
end
This diff is collapsed.
Click to expand it.
RTX class/simclass_test.m
+
10
−
13
View file @
c92ce86e
...
...
@@ -3,24 +3,22 @@ reflectors(end+1) = PlaneReflector([2 0], 2);
reflectors
(
end
+
1
)
=
ParabolaReflector
([
0
0
],
4
,
3
);
reflectors
(
end
+
1
)
=
BalazsAperture
([
3
0
],
20
,
1000
);
start
=
Vect
(
1
,
0
);
n_ray
=
10000
;
phi_start
=
-
pi
;
%angle(1-1i);
phi_stop
=
pi
;
%angle(1+1i);
phi
=
linspace
(
phi_start
,
phi_stop
,
n_ray
);
rays
(
n_ray
)
=
Ray
;
for
k
=
1
:
size
(
phi
,
2
)
rays
(
k
)
=
Ray
(
start
,
[
cos
(
phi
(
k
)),
sin
(
phi
(
k
))]);
end
phi_start
=
-
pi
;
phi_stop
=
pi
;
n
=
1000
;
wavelength
=
3e8
/
1e9
;
antenna
=
Antenna
(
Vect
(
1
,
0
));
[
rays
,
complex_amplitudes
]
=
antenna
.
generate_rays
(
linspace
(
phi_start
,
phi_stop
,
n
));
figure
(
1
);
plot
(
0
,
0
);
hold
on
;
for
k
=
1
:
n_ray
for
k
=
1
:
size
(
rays
,
2
)
t
=
Trace
(
k
,
rays
(
k
),
0
,
wavelength
,
reflectors
,
5
);
t
.
plot_trace
();
%
t.plot_trace();
end
plot
(
start
.
x
,
start
.
y
,
'kO'
,
'MarkerSize'
,
10
);
antenna
.
plot_antenna
(
);
for
k
=
1
:
size
(
reflectors
,
2
)
reflectors
(
k
)
.
plot_self
;
end
...
...
@@ -37,4 +35,3 @@ plot(histogram);
%field = field/max(field);
%plot(20*log10(field));
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment