-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_ff.m
More file actions
67 lines (59 loc) · 2.04 KB
/
Copy pathplot_ff.m
File metadata and controls
67 lines (59 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
clear; close all;
max_eid = 25;
theta=linspace(0,2*pi,361);
epax = polaraxes;
hpax = polaraxes;
subplot(1,2,1,epax);
subplot(1,2,2,hpax);
for id=0:max_eid
dat = abs(readmatrix(sprintf('results/ff_%d.txt',id)));
if dat(1,1) > dat(end,1)
Eplane = [dat(:,1)' , flip(dat(2:end,181)')];
Hplane = [dat(:,91)' , flip(dat(2:end,271)')];
else
Eplane = [flip(dat(:,1)') , dat(2:end,181)'];
Hplane = [flip(dat(:,91)') , dat(2:end,271)'];
end
Eplane = Eplane./max(Eplane,[],"all");
Hplane = Hplane./max(Hplane,[],"all");
Eplanedb = 20000*log10(Eplane);
Eplanedb(Eplanedb < -20) = -20;
Eplanedb = movmean(Eplanedb,12);
Hplanedb = 20000*log10(Hplane);
Hplanedb(Hplanedb< -20) = -20;
Hplanedb = movmean(Hplanedb,12);
polaraxes(epax);
polarplot(theta,Eplanedb,'-.','LineWidth',1);
hold on;
polaraxes(hpax);
polarplot(theta,Hplanedb,'-.','LineWidth',1);
hold on;
end
dat = readmatrix("results/ff_single_patch.txt");
Eplane = [dat(:,1)' , flip(dat(2:end,181)')];
Eplane = Eplane./max(Eplane,[],"all");
Eplanedb = 20000*log10(Eplane);
Hplane = [dat(:,91)' , flip(dat(2:end,271)')];
Hplane = Hplane./max(Hplane,[],"all");
Hplanedb = 20000*log10(Hplane);
polaraxes(epax);
polarplot(theta,Eplanedb,'k-','LineWidth',3);
hold on;
polaraxes(hpax);
polarplot(theta,Hplanedb,'r-','LineWidth',3);
hold on;
epax.ThetaZeroLocation = 'top';
epax.RLim = [-20 0];
hpax.ThetaZeroLocation = 'top';
hpax.RLim = [-20 0];
subtitle('H-Plane');
hpax.ThetaTickLabel = {'0','30','60','90','120','150','180',...
'150','120','90','60','30'};
text(pi/6,6.5,'\leftarrow\phi = 90','HorizontalAlignment','center','FontSize',12);
text(-pi/6,6.5,'\phi = 270\rightarrow','HorizontalAlignment','center','FontSize',12);
epax.ThetaTickLabel = {'0','30','60','90','120','150','180',...
'150','120','90','60','30'};
polaraxes(epax);
text(pi/6,6.5,'\leftarrow\phi = 0','HorizontalAlignment','center','FontSize',12);
text(-pi/6,6.5,'\phi = 180\rightarrow','HorizontalAlignment','center','FontSize',12);
subtitle('E-Plane');