-
Notifications
You must be signed in to change notification settings - Fork 0
/
plots2.m
executable file
·70 lines (55 loc) · 1.78 KB
/
plots2.m
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
68
69
70
clear
close all
clc
noise_levs = 0:2:20;
source_radius = 0:0.5:8;
iterations = 100;
Q = 80;
sen_pos_rad = zeros(Q,2);
for i=1:Q
sen_pos_rad(i,:) = [8 i*360/Q];
end
Y = linspace(0, 0.15, 200);
P = linspace(0, 2*pi, 180);
[P_grid,Y_grid] = meshgrid(P,Y);
[A,B] = pol2cart(P_grid,Y_grid);
for radi=1:length(source_radius)
fig = figure;
% sgtitle("radius: "+source_radius(radi));
disp("radius: "+source_radius(radi));
for n=1:length(noise_levs)
[x_loc,y_loc] = pol2cart(pi,source_radius(radi)*0.15/8);
subplot(3,4,n);
scatter(x_loc,y_loc,200,'X','r');
ylabel('y-position [m]');
xlabel('x-position [m]');
title("snr: "+noise_levs(n)+"db");
axis([-0.15 0.15 -0.15 0.15]);
hold on;
grid on;
for i=1:Q
[x,y] = pol2cart(sen_pos_rad(i,2)*pi/180,sen_pos_rad(i,1)*0.15/8);
scatter(x,y,50,'o','b');
hold on
end
for iter=1:iterations
x = load("accVnoiseVradius/MV_iter"+iter+"_rad"+source_radius(radi)+"u_snr"+noise_levs(n)+"db.mat",'C');
C = x.C;
[xmax,ymax] = find(abs(C) == max(max(abs(C))));
xmax = xmax(1);
ymax = ymax(1);
% figure(6);
% mesh(A,B,abs(C));
% ylabel('x-position [m]');
% xlabel('y-position [m]');
% zlabel('Z');
scatter(A(xmax,ymax),B(xmax,ymax),10,'*','k');
hold on;
end
% break;
end
savefig(fig,char("accVnoiseVradius/plots/peaks_"+source_radius(radi)+"u.fig"));
saveas(fig,char("accVnoiseVradius/plots/peaks_"+source_radius(radi)+"u.jpeg"));
close all;
% break;
end