-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_results.py
352 lines (284 loc) · 20.9 KB
/
plot_results.py
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
import argparse
import numpy as np
import matplotlib.pyplot as plt
import os
plt.rcParams.update({
"text.usetex": True,
"font.family": "sans-serif",
"font.sans-serif": ["Helvetica"],
'font.size': 20})
from data_lib import params_circular, params_linear, params_real
def plot2pgf(temp, filename, folder='./'):
"""
:param temp: list of equally-long data
:param filename: filename without extension nor path
:param folder: folder where to save
"""
if not os.path.exists(folder):
os.makedirs(folder)
np.savetxt(os.path.join(folder, filename + '.txt'), np.asarray(temp).T, fmt="%f", encoding='ascii')
def main():
# Arguments parse
parser = argparse.ArgumentParser(description='Generate data for linear array setup')
parser.add_argument('--dataset_path', type=str, help="Base Data Directory", default='/nas/home/lcomanducci/soundfield_synthesis/dataset/test/')
parser.add_argument('--array_type', type=str, help="Array Configuration", default='circular')
parser.add_argument('--n_missing', type=int, help='number missing loudspeakers',
default=32)
args = parser.parse_args()
n_missing = args.n_missing
array_type = args.array_type
nmse = np.load(os.path.join(args.dataset_path, array_type+'_array', 'nmse_missing_'+str(n_missing)+'.npz'))
ssim = np.load(os.path.join(args.dataset_path, array_type+'_array', 'ssim_missing_'+str(n_missing)+'.npz'))
#nmse_pwd, nmse_pwd_cnn, nmse_pm = np.real(nmse['nmse_pwd']), np.real(nmse['nmse_pwd_cnn']), np.real(nmse['nmse_pwd_pm'])
#ssim_pwd, ssim_pwd_cnn, ssim_pm = np.real(ssim['ssim_pwd']), np.real(ssim['ssim_pwd_cnn']), np.real(ssim['ssim_pwd_pm'])
nmse_pwd, nmse_pm = np.real(nmse['nmse_pwd']), np.real(nmse['nmse_pwd_pm'])
ssim_pwd, ssim_pm = np.real(ssim['ssim_pwd']), np.real(ssim['ssim_pwd_pm'])
nmse_pwd_cnn_complex = np.real(nmse['nmse_pwd_cnn_complex'])
ssim_pwd_cnn_complex = np.real(ssim['ssim_pwd_cnn_complex'])
nmse_pwd_apwd, nmse_pwd_awfs, nmse_pwd_wfs = np.real(nmse['nmse_pwd_apwd']), np.real(nmse['nmse_awfs']), np.real(nmse['nmse_wfs'])
ssim_pwd_apwd, ssim_pwd_awfs, ssim_pwd_wfs = np.real(ssim['ssim_pwd_apwd']), np.real(ssim['ssim_awfs']), np.real(ssim['ssim_wfs'])
os.path.join(args.dataset_path, array_type, 'nmse_missing_'+str(n_missing)+'.npz')
pgf_dataset_path = os.path.join(args.dataset_path, array_type + '_array', 'pgfplot')
if args.array_type == 'linear':
# Let's store the data in arrays more suitable for saving them (and then re-using them in pgfplot)
f_axis_plot = np.round(params_linear.f_axis, 1)
nmse_pwd_freq_db = 10 * np.log10(np.mean(nmse_pwd, axis=0))
nmse_pm_freq_db = 10 * np.log10(np.mean(nmse_pm, axis=0))
nmse_pwd_cnn_complex_freq_db = 10*np.log10(np.mean(nmse_pwd_cnn_complex, axis=0))
nmse_pwd_awfs_freq_db = 10*np.log10(np.mean(nmse_pwd_awfs, axis=0))
nmse_pwd_wfs_freq_db = 10*np.log10(np.mean(nmse_pwd_wfs, axis=0))
nmse_pwd_apwd_freq_db = 10*np.log10(np.mean(nmse_pwd_apwd, axis=0))
ssim_pwd_freq = np.mean(ssim_pwd, axis=0)
ssim_pm_freq = np.mean(ssim_pm, axis=0)
ssim_pwd_cnn_complex_freq = np.mean(ssim_pwd_cnn_complex, axis=0)
ssim_pwd_awfs_freq = np.mean(ssim_pwd_awfs, axis=0)
ssim_pwd_wfs_freq = np.mean(ssim_pwd_wfs, axis=0)
ssim_pwd_apwd_freq = np.mean(ssim_pwd_apwd, axis=0)
plot2pgf([f_axis_plot, nmse_pwd_freq_db], 'nmse_pwd_freq_db_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, nmse_pm_freq_db], 'nmse_pm_freq_db_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, ssim_pwd_freq], 'ssim_pwd_freq_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, ssim_pm_freq], 'ssim_pm_freq_missing_'+str(n_missing), folder=pgf_dataset_path)
plt.figure(figsize=(20, 9))
plt.plot(f_axis_plot, nmse_pwd_freq_db, 'bs-')
plt.plot(f_axis_plot, nmse_pm_freq_db, 'k*-')
plt.plot(f_axis_plot, nmse_pwd_cnn_complex_freq_db, 'rd-')
plt.plot(f_axis_plot, nmse_pwd_awfs_freq_db, 'cd-')
plt.plot(f_axis_plot, nmse_pwd_wfs_freq_db, 'gs-')
plt.plot(f_axis_plot, nmse_pwd_apwd_freq_db, 'y*-')
plt.xlabel('$f [Hz]$', fontsize=35), plt.ylabel('$NRE [dB]$', fontsize=35)
plt.tick_params(axis='both', which='major', labelsize=30)
plt.legend(['$\mathrm{PWD}$', '$\mathrm{PM}$','$\mathrm{PWD_{CNN}}_complex$','$\mathrm{AWFS}$', '$\mathrm{WFS}$','$\mathrm{PWD}_apwd$'], prop={"size": 30})
plt.show()
plt.figure(figsize=(20, 9))
plt.plot(f_axis_plot, ssim_pwd_freq, 'bs-')
plt.plot(f_axis_plot, ssim_pm_freq, 'k*-')
plt.plot(f_axis_plot, ssim_pwd_cnn_complex_freq, 'rd-')
plt.plot(f_axis_plot, ssim_pwd_awfs_freq, 'cd-')
plt.plot(f_axis_plot, ssim_pwd_wfs_freq, 'gs-')
plt.plot(f_axis_plot, ssim_pwd_apwd_freq, 'y*-')
plt.xlabel('$f [Hz]$', fontsize=35), plt.ylabel('$SSIM$', fontsize=35)
plt.tick_params(axis='both', which='major', labelsize=30)
plt.legend(['$\mathrm{PWD}$', '$\mathrm{PWD_{CNN}}$', '$\mathrm{PM}$','$\mathrm{PWD_{CNN}}_complex$', '$\mathrm{AWFS}$', '$\mathrm{WFS}$','$\mathrm{PWD}_apwd$'], prop={"size": 30})
plt.show()
if args.array_type == 'circular':
# Let's store the data in arrays more suitable for saving them (and then re-using them in pgfplot)
f_axis_plot = np.round(params_circular.f_axis, 1)
nmse_pwd_freq_db = 10*np.log10(np.mean(np.reshape(nmse_pwd, (-1, params_circular.N_freqs)), axis=0))
nmse_pm_freq_db = 10*np.log10(np.mean(np.reshape(nmse_pm, (-1,params_circular.N_freqs)), axis=0))
nmse_pwd_cnn_complex_freq_db = 10*np.log10(np.mean(np.reshape(nmse_pwd_cnn_complex, (-1, params_circular.N_freqs)), axis=0))
nmse_pwd_awfs_freq_db = 10*np.log10(np.mean(np.reshape(nmse_pwd_awfs, (-1, params_circular.N_freqs)), axis=0))
nmse_pwd_wfs_freq_db = 10*np.log10(np.mean(np.reshape(nmse_pwd_wfs, (-1, params_circular.N_freqs)), axis=0))
nmse_pwd_apwd_freq_db = 10*np.log10(np.mean(np.reshape(nmse_pwd_apwd, (-1, params_circular.N_freqs)), axis=0))
ssim_pwd_freq = np.mean(np.reshape(ssim_pwd, (-1, params_circular.N_freqs)), axis=0)
ssim_pm_freq = np.mean(np.reshape(ssim_pm, (-1, params_circular.N_freqs)), axis=0)
ssim_pwd_cnn_complex_freq = np.mean(np.reshape(ssim_pwd_cnn_complex, (-1, params_circular.N_freqs)), axis=0)
ssim_pwd_awfs_freq = np.mean(np.reshape(ssim_pwd_awfs, (-1, params_circular.N_freqs)), axis=0)
ssim_pwd_wfs_freq = np.mean(np.reshape(ssim_pwd_wfs, (-1, params_circular.N_freqs)), axis=0)
ssim_pwd_apwd_freq = np.mean(np.reshape(ssim_pwd_apwd, (-1, params_circular.N_freqs)), axis=0)
"""
plot2pgf([f_axis_plot, nmse_pwd_freq_db], 'nmse_pwd_freq_db_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, nmse_pwd_cnn_freq_db], 'nmse_pwd_cnn_freq_db_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, nmse_pm_freq_db], 'nmse_pm_freq_db_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, nmse_pwd_cnn_complex_freq_db], 'nmse_pwd_cnn_complex_freq_db_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, nmse_pwd_awfs_freq_db], 'nmse_pwd_cnn_complex_freq_db_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, ssim_pwd_freq], 'ssim_pwd_freq_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, ssim_pwd_cnn_freq], 'ssim_pwd_cnn_freq_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, ssim_pm_freq], 'ssim_pm_freq_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, ssim_pwd_awfs_freq], 'ssim_pwd_awfs_freq_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, ssim_pwd_awfs_freq], 'ssim_pwd_awfs_freq_missing_'+str(n_missing), folder=pgf_dataset_path)
"""
plt.figure(figsize=(20, 9))
plt.plot(f_axis_plot, nmse_pwd_freq_db, 'bs-')
plt.plot(f_axis_plot, nmse_pwd_cnn_complex_freq_db, 'rd-')
plt.plot(f_axis_plot, nmse_pwd_awfs_freq_db, 'g*-')
plt.plot(f_axis_plot, nmse_pm_freq_db, 'c*-')
plt.plot(f_axis_plot, nmse_pwd_apwd_freq_db, 'k*-')
# plt.plot(f_axis_plot, nmse_pwd_wfs_freq_db, 'gs-')
plt.xlabel('$f [Hz]$', fontsize=35), plt.ylabel('$NMSE$', fontsize=35)
plt.tick_params(axis='both', which='major', labelsize=30)
plt.legend(['$\mathrm{PWD}$', '$\mathrm{PWD_{CNN}}_complex$', '$\mathrm{AWFS}$',
'$\mathrm{PM}$',
'$\mathrm{PWD}_apwd$'], prop={"size": 30})
plt.show()
plt.figure(figsize=(20, 9))
plt.plot(f_axis_plot, ssim_pwd_freq, 'bs-')
plt.plot(f_axis_plot, ssim_pm_freq, 'k*-')
plt.plot(f_axis_plot, ssim_pwd_cnn_complex_freq, 'rd-')
plt.plot(f_axis_plot, ssim_pwd_awfs_freq, 'cd-')
#plt.plot(f_axis_plot, ssim_pwd_wfs_freq, 'gs-')
plt.plot(f_axis_plot, ssim_pwd_apwd_freq, 'y*-')
plt.xlabel('$f [Hz]$', fontsize=35), plt.ylabel('$SSIM$', fontsize=35)
plt.tick_params(axis='both', which='major', labelsize=30)
plt.legend(['$\mathrm{PWD}$', '$\mathrm{PM}$','$\mathrm{PWD_{CNN}}_complex$', '$\mathrm{AWFS}$','$\mathrm{PWD}_apwd$'], prop={"size": 30})
#'$\mathrm{WFS}$
#,'$\mathrm{PWD}_apwd$'], prop={"size": 30})
plt.show()
# Plot w.r.t radius distance
n_f = 41
r_axis_plot = np.round(params_circular.radius_sources_test[:-1], 1)
f_axis_plot = np.round(params_circular.f_axis, 1)
nmse_pwd_radius_db = 10*np.log10(np.mean(nmse_pwd[:, :, n_f], axis=1))
nmse_pm_radius_db = 10*np.log10(np.mean(nmse_pm[:, :, n_f], axis=1))
ssim_pwd_radius = np.mean(ssim_pwd[:, :, n_f], axis=1)
ssim_pm_radius = np.mean(ssim_pm[:, :, n_f], axis=1)
nmse_pwd_cnn_complex_radius_db = 10*np.log10(np.mean(nmse_pwd_cnn_complex[:, :, n_f], axis=1))
ssim_pwd_cnn_complex_radius = np.mean(ssim_pwd_cnn_complex[:, :, n_f], axis=1)
nmse_pwd_awfs_radius_db = 10*np.log10(np.mean(nmse_pwd_awfs[:, :, n_f], axis=1))
ssim_pwd_awfs_radius = np.mean(ssim_pwd_awfs[:, :, n_f], axis=1)
"""
plot2pgf([r_axis_plot, nmse_pwd_radius_db], 'nmse_pwd_radius_db_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([r_axis_plot, nmse_pwd_cnn_radius_db], 'nmse_pwd_cnn_radius_db_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([r_axis_plot, nmse_pm_radius_db], 'nmse_pm_radius_db_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([r_axis_plot, ssim_pwd_radius], 'ssim_pwd_radius_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([r_axis_plot, ssim_pwd_cnn_radius], 'ssim_pwd_cnn_radius_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([r_axis_plot, ssim_pm_radius], 'ssim_pm_radius_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([r_axis_plot, ssim_pwd_cnn_complex_radius], 'ssim_pwd_cnn_complex_radius_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([r_axis_plot, nmse_pwd_cnn_complex_radius_db], 'nmse_pwd_cnn_rcomplex_adius_db_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([r_axis_plot, ssim_pwd_cnn_complex_radius], 'ssim_pwd_awfs_radius_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([r_axis_plot, nmse_pwd_cnn_complex_radius_db], 'nmse_pwd_awfs_radius_db_missing_'+str(n_missing), folder=pgf_dataset_path)
"""
plt.figure(figsize=(20, 9))
plt.plot(r_axis_plot, nmse_pwd_radius_db, 'bs-')
plt.plot(r_axis_plot, nmse_pm_radius_db, 'k*-')
plt.plot(r_axis_plot, nmse_pwd_cnn_complex_radius_db, 'gd-')
plt.plot(r_axis_plot, nmse_pwd_awfs_radius_db, 'm*-')
plt.xlabel('$r [m]$', fontsize=35), plt.ylabel('$NRE [dB]$', fontsize=35)
plt.tick_params(axis='both', which='major', labelsize=30)
plt.legend(['$\mathrm{PWD}$', '$\mathrm{PWD_{CNN}}$', '$\mathrm{PM}$','$\mathrm{PWD_{CNN}}_complex$','$\mathrm{PWD}_awfs$'], prop={"size": 30})
plt.show()
plt.figure(figsize=(20, 9))
plt.plot(r_axis_plot, ssim_pwd_radius, 'bs-')
plt.plot(r_axis_plot, ssim_pm_radius, 'k*-')
plt.plot(r_axis_plot, ssim_pwd_cnn_complex_radius, 'gd-')
plt.plot(r_axis_plot, ssim_pwd_awfs_radius, 'm*-')
plt.xlabel('$r [m]$', fontsize=35), plt.ylabel('$SSIM$', fontsize=35)
plt.tick_params(axis='both', which='major', labelsize=30)
plt.legend(['$\mathrm{PWD}$', '$\mathrm{PWD_{CNN}}$', '$\mathrm{PM}$', '$\mathrm{PWD_{CNN}}_complex$','$\mathrm{PWD}_awfs$'], prop={"size": 30})
plt.show()
print('done')
if args.array_type == 'real':
# Let's store the data in arrays more suitable for saving them (and then re-using them in pgfplot)
f_axis_plot = np.round(params_real.f_axis, 1)
nmse_pwd_freq_db = 10*np.log10(np.mean(np.reshape(nmse_pwd, (-1, params_circular.N_freqs)), axis=0))
nmse_pm_freq_db = 10*np.log10(np.mean(np.reshape(nmse_pm, (-1,params_circular.N_freqs)), axis=0))
nmse_pwd_cnn_complex_freq_db = 10*np.log10(np.mean(np.reshape(nmse_pwd_cnn_complex, (-1, params_circular.N_freqs)), axis=0))
nmse_pwd_awfs_freq_db = 10*np.log10(np.mean(np.reshape(nmse_pwd_awfs, (-1, params_circular.N_freqs)), axis=0))
nmse_pwd_wfs_freq_db = 10*np.log10(np.mean(np.reshape(nmse_pwd_wfs, (-1, params_circular.N_freqs)), axis=0))
nmse_pwd_apwd_freq_db = 10*np.log10(np.mean(np.reshape(nmse_pwd_apwd, (-1, params_circular.N_freqs)), axis=0))
ssim_pwd_freq = np.mean(np.reshape(ssim_pwd, (-1, params_circular.N_freqs)), axis=0)
ssim_pm_freq = np.mean(np.reshape(ssim_pm, (-1, params_circular.N_freqs)), axis=0)
ssim_pwd_cnn_complex_freq = np.mean(np.reshape(ssim_pwd_cnn_complex, (-1, params_circular.N_freqs)), axis=0)
ssim_pwd_awfs_freq = np.mean(np.reshape(ssim_pwd_awfs, (-1, params_circular.N_freqs)), axis=0)
ssim_pwd_wfs_freq = np.mean(np.reshape(ssim_pwd_wfs, (-1, params_circular.N_freqs)), axis=0)
ssim_pwd_apwd_freq = np.mean(np.reshape(ssim_pwd_apwd, (-1, params_circular.N_freqs)), axis=0)
"""
plot2pgf([f_axis_plot, nmse_pwd_freq_db], 'nmse_pwd_freq_db_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, nmse_pwd_cnn_freq_db], 'nmse_pwd_cnn_freq_db_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, nmse_pm_freq_db], 'nmse_pm_freq_db_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, nmse_pwd_cnn_complex_freq_db], 'nmse_pwd_cnn_complex_freq_db_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, nmse_pwd_awfs_freq_db], 'nmse_pwd_cnn_complex_freq_db_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, ssim_pwd_freq], 'ssim_pwd_freq_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, ssim_pwd_cnn_freq], 'ssim_pwd_cnn_freq_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, ssim_pm_freq], 'ssim_pm_freq_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, ssim_pwd_awfs_freq], 'ssim_pwd_awfs_freq_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([f_axis_plot, ssim_pwd_awfs_freq], 'ssim_pwd_awfs_freq_missing_'+str(n_missing), folder=pgf_dataset_path)
"""
plt.figure(figsize=(20, 9))
plt.plot(f_axis_plot[:-1], nmse_pwd_freq_db[:-1], 'bs-')
plt.plot(f_axis_plot[:-1], nmse_pwd_cnn_complex_freq_db[:-1], 'rd-')
plt.plot(f_axis_plot[:-1], nmse_pwd_awfs_freq_db[:-1], 'g*-')
plt.plot(f_axis_plot[:-1], nmse_pm_freq_db[:-1], 'c*-')
plt.plot(f_axis_plot[:-1], nmse_pwd_apwd_freq_db[:-1], 'k*-')
plt.xlabel('$f [Hz]$', fontsize=35), plt.ylabel('$NMSE$', fontsize=35)
plt.tick_params(axis='both', which='major', labelsize=30)
plt.legend(['$\mathrm{PWD}$', '$\mathrm{PWD_{CNN}}_complex$', '$\mathrm{AWFS}$',
'$\mathrm{PM}$',
'$\mathrm{PWD}_apwd$'], prop={"size": 30})
plt.show()
plt.figure(figsize=(20, 9))
plt.plot(f_axis_plot, nmse_pwd_freq_db, 'bs-')
plt.plot(f_axis_plot, nmse_pm_freq_db, 'k*-')
plt.plot(f_axis_plot, nmse_pwd_cnn_complex_freq_db, 'gd-')
plt.plot(f_axis_plot, nmse_pwd_awfs_freq_db, 'cd-')
plt.plot(f_axis_plot, nmse_pwd_wfs_freq_db, 'rs-')
plt.plot(f_axis_plot, nmse_pwd_apwd_freq_db, 'y*-')
plt.xlabel('$f [Hz]$', fontsize=35), plt.ylabel('$NRE [dB]$', fontsize=35)
plt.tick_params(axis='both', which='major', labelsize=30)
plt.legend(['$\mathrm{PWD}$', '$\mathrm{PM}$','$\mathrm{PWD_{CNN}}_complex$','$\mathrm{AWFS}$', '$\mathrm{WFS}$','$\mathrm{PWD}_apwd$'], prop={"size": 30})
plt.show()
plt.figure(figsize=(20, 9))
plt.plot(f_axis_plot, ssim_pwd_freq, 'bs-')
plt.plot(f_axis_plot, ssim_pm_freq, 'k*-')
plt.plot(f_axis_plot, ssim_pwd_cnn_complex_freq, 'gd-')
plt.plot(f_axis_plot, ssim_pwd_awfs_freq, 'm*-')
plt.plot(f_axis_plot, ssim_pwd_wfs_freq, 'm*-')
plt.plot(f_axis_plot, ssim_pwd_apwd_freq, 'm*-')
plt.xlabel('$f [Hz]$', fontsize=35), plt.ylabel('$SSIM$', fontsize=35)
plt.tick_params(axis='both', which='major', labelsize=30)
plt.legend(['$\mathrm{PWD}$', '$\mathrm{PM}$','$\mathrm{PWD_{CNN}}_complex$', '$\mathrm{AWFS}$', '$\mathrm{WFS}$','$\mathrm{PWD}_apwd$'], prop={"size": 30})
plt.show()
# Plot w.r.t radius distance
n_f = 41
r_axis_plot = np.round(params_circular.radius_sources_test[:-1], 1)
f_axis_plot = np.round(params_circular.f_axis, 1)
nmse_pwd_radius_db = 10*np.log10(np.mean(nmse_pwd[:, :, n_f], axis=1))
nmse_pm_radius_db = 10*np.log10(np.mean(nmse_pm[:, :, n_f], axis=1))
ssim_pwd_radius = np.mean(ssim_pwd[:, :, n_f], axis=1)
ssim_pm_radius = np.mean(ssim_pm[:, :, n_f], axis=1)
nmse_pwd_cnn_complex_radius_db = 10*np.log10(np.mean(nmse_pwd_cnn_complex[:, :, n_f], axis=1))
ssim_pwd_cnn_complex_radius = np.mean(ssim_pwd_cnn_complex[:, :, n_f], axis=1)
nmse_pwd_awfs_radius_db = 10*np.log10(np.mean(nmse_pwd_awfs[:, :, n_f], axis=1))
ssim_pwd_awfs_radius = np.mean(ssim_pwd_awfs[:, :, n_f], axis=1)
"""
plot2pgf([r_axis_plot, nmse_pwd_radius_db], 'nmse_pwd_radius_db_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([r_axis_plot, nmse_pwd_cnn_radius_db], 'nmse_pwd_cnn_radius_db_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([r_axis_plot, nmse_pm_radius_db], 'nmse_pm_radius_db_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([r_axis_plot, ssim_pwd_radius], 'ssim_pwd_radius_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([r_axis_plot, ssim_pwd_cnn_radius], 'ssim_pwd_cnn_radius_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([r_axis_plot, ssim_pm_radius], 'ssim_pm_radius_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([r_axis_plot, ssim_pwd_cnn_complex_radius], 'ssim_pwd_cnn_complex_radius_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([r_axis_plot, nmse_pwd_cnn_complex_radius_db], 'nmse_pwd_cnn_rcomplex_adius_db_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([r_axis_plot, ssim_pwd_cnn_complex_radius], 'ssim_pwd_awfs_radius_missing_'+str(n_missing), folder=pgf_dataset_path)
plot2pgf([r_axis_plot, nmse_pwd_cnn_complex_radius_db], 'nmse_pwd_awfs_radius_db_missing_'+str(n_missing), folder=pgf_dataset_path)
"""
plt.figure(figsize=(20, 9))
plt.plot(r_axis_plot, nmse_pwd_radius_db, 'bs-')
plt.plot(r_axis_plot, nmse_pm_radius_db, 'k*-')
plt.plot(r_axis_plot, nmse_pwd_cnn_complex_radius_db, 'gd-')
plt.plot(r_axis_plot, nmse_pwd_awfs_radius_db, 'm*-')
plt.xlabel('$r [m]$', fontsize=35), plt.ylabel('$NRE [dB]$', fontsize=35)
plt.tick_params(axis='both', which='major', labelsize=30)
plt.legend(['$\mathrm{PWD}$', '$\mathrm{PWD_{CNN}}$', '$\mathrm{PM}$','$\mathrm{PWD_{CNN}}_complex$','$\mathrm{PWD}_awfs$'], prop={"size": 30})
plt.show()
plt.figure(figsize=(20, 9))
plt.plot(r_axis_plot, ssim_pwd_radius, 'bs-')
plt.plot(r_axis_plot, ssim_pm_radius, 'k*-')
plt.plot(r_axis_plot, ssim_pwd_cnn_complex_radius, 'gd-')
plt.plot(r_axis_plot, ssim_pwd_awfs_radius, 'm*-')
plt.xlabel('$r [m]$', fontsize=35), plt.ylabel('$SSIM$', fontsize=35)
plt.tick_params(axis='both', which='major', labelsize=30)
plt.legend(['$\mathrm{PWD}$', '$\mathrm{PWD_{CNN}}$', '$\mathrm{PM}$', '$\mathrm{PWD_{CNN}}_complex$','$\mathrm{PWD}_awfs$'], prop={"size": 30})
plt.show()
print('done')
if __name__ == '__main__':
main()