mirror of
https://gitlab.science.ru.nl/mthesis-edeboone/m-thesis-introduction.git
synced 2024-12-22 03:23:34 +01:00
SNR figure showing dependence on T also
This commit is contained in:
parent
68f029f1f7
commit
3e8f3f713b
1 changed files with 20 additions and 1 deletions
|
@ -216,7 +216,7 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
# plot the snrs
|
# plot the snrs
|
||||||
fig, axs2 = plt.subplots()
|
fig, axs2 = plt.subplots()
|
||||||
fig.basefname="signal_to_noise"
|
fig.basefname="signal_to_noise_vs_N"
|
||||||
axs2.set_xlabel("$N = T*f_s$")
|
axs2.set_xlabel("$N = T*f_s$")
|
||||||
axs2.set_ylabel("SNR")
|
axs2.set_ylabel("SNR")
|
||||||
|
|
||||||
|
@ -233,5 +233,24 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
axs2.legend()
|
axs2.legend()
|
||||||
|
|
||||||
|
# plot snrs vs T
|
||||||
|
fig, axs3 = plt.subplots()
|
||||||
|
fig.basefname="signal_to_noise_vs_T"
|
||||||
|
axs3.set_xlabel("time [us]")
|
||||||
|
axs3.set_ylabel("SNR")
|
||||||
|
|
||||||
|
for i, (f_sample, f_sine, t_lengths) in enumerate(fs_iter):
|
||||||
|
# plot the means
|
||||||
|
l = axs3.plot(t_lengths, np.mean(my_snrs[i], axis=-1), marker='o', ls='none', label='f:{}MHz, fs:{}MHz'.format(f_sine, f_sample), markeredgecolor='black', markeredgewidth=1)
|
||||||
|
|
||||||
|
color = l[0].get_color()
|
||||||
|
|
||||||
|
for k, t_length in enumerate(t_lengths):
|
||||||
|
t_length = np.repeat(t_length , my_snrs.shape[-1])
|
||||||
|
axs3.plot(t_length, my_snrs[i,k], ls='none', color=color, marker='o', alpha=max(0.01, 1/my_snrs.shape[-1]))
|
||||||
|
|
||||||
|
|
||||||
|
axs3.legend()
|
||||||
|
|
||||||
### Save or show figures
|
### Save or show figures
|
||||||
save_all_figs_to_path_or_show(args.fname, default_basename=__file__, default_extensions=default_extensions)
|
save_all_figs_to_path_or_show(args.fname, default_basename=__file__, default_extensions=default_extensions)
|
||||||
|
|
Loading…
Reference in a new issue