diff --git a/fourier/04_signal_to_noise.py b/fourier/04_signal_to_noise.py index 72f6083..1d4273e 100755 --- a/fourier/04_signal_to_noise.py +++ b/fourier/04_signal_to_noise.py @@ -216,7 +216,7 @@ if __name__ == "__main__": # plot the snrs 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_ylabel("SNR") @@ -233,5 +233,24 @@ if __name__ == "__main__": 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_all_figs_to_path_or_show(args.fname, default_basename=__file__, default_extensions=default_extensions)