-
Notifications
You must be signed in to change notification settings - Fork 9
/
intermediate_check.m
107 lines (91 loc) · 2.96 KB
/
intermediate_check.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
%% Script for debugging CLEAN
close;
dynamic_range = 12; % dB
xmin = -.25; xmax = .25;
ymin = -.25; ymax = .25;
xmin = -1.5; xmax = 1.5;
ymin = -2; ymax = .5;
Pimp = P;
Pimp(real(Pimp)<0) = 0;
SPLint = 20*log10(sqrt(real(reshape(Pimp, N_X, N_Y).'))/2e-5);
maxval = ceil(max(real(SPLint(:))));
minval = maxval - dynamic_range;
figure('pos', [400 400 1500 500]);
subplot(1,3,1);SPLint(SPLint < minval - .5) = 0;
imagesc(X, Y, SPLint, [minval-.5 round(maxval)]);
title([num2str(norm(P)) ', ' num2str(norm(D))]);
set(0,'defaulttextinterpreter','latex');
hXLabel = xlabel('$x$ [m]');
hYLabel = ylabel('$y$ [m]');
set([hXLabel, hYLabel], ...
'FontName', 'AvantGarde', 'FontSize', 14);
set(gca, ...
'YDir','normal', ...
'XTick', linspace(xmin, xmax, 5), ...
'YTick', linspace(ymin, ymax, 5), ...
'XColor' , [.3 .3 .3], ...
'YColor' , [.3 .3 .3], ...
'Fontsize' , 16, ...
'FontName' , 'Helvetica' );
set(gca,'xgrid', 'on', 'ygrid', 'on', 'gridlinestyle', ':', 'xcolor', 'k', 'ycolor', 'k');
axis equal; axis([xmin xmax ymin ymax]);
cb = colorbar;
jetmod = jet;
jetmod(1,:) = 1;
colormap(jetmod);
cb.Limits = [minval maxval];
% Pomp = sum(conj(h).*(Cource*h), 1);
Pomp = sum(h.*(Cource*conj(h)), 1);
% Pomp(real(Pomp)<0) = 0;
SPLrem = 20*log10(sqrt(real(reshape(Pomp, N_X, N_Y).'))/2e-5);
maxval = ceil(max(real(SPLrem(:))));
minval = maxval - dynamic_range;
subplot(1,3,2);SPLrem(SPLrem < minval - .5) = 0;
imagesc(X, Y, SPLrem, [minval-.5 round(maxval)]);
title(num2str(norm(Q)));
set(0,'defaulttextinterpreter','latex');
hXLabel = xlabel('$x$ [m]');
hYLabel = ylabel('$y$ [m]');
set([hXLabel, hYLabel], ...
'FontName', 'AvantGarde', 'FontSize', 14);
set(gca, ...
'YDir','normal', ...
'XTick', linspace(xmin, xmax, 5), ...
'YTick', linspace(ymin, ymax, 5), ...
'XColor' , [.3 .3 .3], ...
'YColor' , [.3 .3 .3], ...
'Fontsize' , 16, ...
'FontName' , 'Helvetica' );
set(gca,'xgrid', 'on', 'ygrid', 'on', 'gridlinestyle', ':', 'xcolor', 'k', 'ycolor', 'k');
axis equal; axis([xmin xmax ymin ymax]);
cb = colorbar;
jetmod = jet;
jetmod(1,:) = 1;
colormap(jetmod);
cb.Limits = [minval maxval];
SPLflint = 20*log10(sqrt(real(reshape(Q, N_X, N_Y).'))/2e-5);
maxval = ceil(max(real(SPLflint(:))));
minval = maxval - dynamic_range;
subplot(1,3,3);SPLflint(SPLflint < minval - .5) = 0;
imagesc(X, Y, SPLflint, [minval-.5 round(maxval)]);
title(num2str(norm(Q)));
set(0,'defaulttextinterpreter','latex');
hXLabel = xlabel('$x$ [m]');
hYLabel = ylabel('$y$ [m]');
set([hXLabel, hYLabel], ...
'FontName', 'AvantGarde', 'FontSize', 14);
set(gca, ...
'YDir','normal', ...
'XTick', linspace(xmin, xmax, 5), ...
'YTick', linspace(ymin, ymax, 5), ...
'XColor' , [.3 .3 .3], ...
'YColor' , [.3 .3 .3], ...
'Fontsize' , 16, ...
'FontName' , 'Helvetica' );
set(gca,'xgrid', 'on', 'ygrid', 'on', 'gridlinestyle', ':', 'xcolor', 'k', 'ycolor', 'k');
axis equal; axis([xmin xmax ymin ymax]);
cb = colorbar;
jetmod = jet;
jetmod(1,:) = 1;
colormap(jetmod);
cb.Limits = [minval maxval];