From 63ec147d75ebfd9bde8fe90e1d226b7d3510294f Mon Sep 17 00:00:00 2001 From: Moritz Wettermann Date: Wed, 8 Feb 2023 11:29:46 +0100 Subject: [PATCH] [otbn/tvla] add more information to the tvla plot Signed-off-by: Moritz Wettermann --- cw/tvla.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cw/tvla.py b/cw/tvla.py index 7e8a778e..eabc6576 100755 --- a/cw/tvla.py +++ b/cw/tvla.py @@ -876,12 +876,16 @@ def run_tvla(ctx: typer.Context): else: # c = np.ones(num_samples) + xaxs = range(sample_start, sample_start + num_samples) fig, axs = plt.subplots(3, sharex=True) - axs[0].plot(single_trace, "k") + axs[0].set_title( + "TVLA of " + cfg["project_file"] + '\n' + "No. of traces: " + str(num_traces)) + axs[0].plot(xaxs, single_trace, "k") + axs[0].set_ylabel("trace") for i_order in range(num_orders): - axs[1 + i_order].plot(ttest_trace[i_order, 0, 0], "k") - axs[1 + i_order].plot(c * threshold, "r") - axs[1 + i_order].plot(-threshold * c, "r") + axs[1 + i_order].plot(xaxs, ttest_trace[i_order, 0, 0], "k") + axs[1 + i_order].plot(xaxs, c * threshold, "r") + axs[1 + i_order].plot(xaxs, -threshold * c, "r") axs[1 + i_order].set_ylabel('t-test ' + str(i_order + 1)) plt.xlabel("time [samples]") plt.savefig('tmp/figures/' + cfg["mode"] + '_fixed_vs_random.png')