diff options
Diffstat (limited to 'dpd/src/subsample_align.py')
-rwxr-xr-x | dpd/src/subsample_align.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/dpd/src/subsample_align.py b/dpd/src/subsample_align.py index d0f3dba..6d1cd2a 100755 --- a/dpd/src/subsample_align.py +++ b/dpd/src/subsample_align.py @@ -29,7 +29,7 @@ def gen_omega(length): return omega -def subsample_align(sig, ref_sig): +def subsample_align(sig, ref_sig, plot=False): """Do subsample alignment for sig relative to the reference signal ref_sig. The delay between the two must be less than sample @@ -68,13 +68,13 @@ def subsample_align(sig, ref_sig): if optim_result.success: best_tau = optim_result.x - if 1: + if plot: corr = np.vectorize(correlate_for_delay) ixs = np.linspace(-1, 1, 100) taus = corr(ixs) dt = datetime.datetime.now().isoformat() - tau_path = (logging_path + "/" + dt + "_tau.pdf") + tau_path = (logging_path + "/" + dt + "_tau.svg") plt.plot(ixs, taus) plt.title("Subsample correlation, minimum is best: {}".format(best_tau)) plt.savefig(tau_path) |