From cd0c9e2dc667dbb5d9192b9f1eab153e621e2dad Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Thu, 24 Dec 2015 10:54:22 +0100 Subject: [PATCH] Add tools to plot the symbol distances This helps comparing the effect of different parameters values. --- plot/symbols_distances.gnuplot | 93 ++++++++++++++++++++++++++++++++++ plot/symbols_distances_codex.log | 5 ++ plot/symbols_distances_defaults.log | 5 ++ plot/symbols_distances_optimistic.log | 6 +++ plot/symbols_distances_savemysugar.log | 5 ++ 5 files changed, 114 insertions(+) create mode 100755 plot/symbols_distances.gnuplot create mode 100644 plot/symbols_distances_codex.log create mode 100644 plot/symbols_distances_defaults.log create mode 100644 plot/symbols_distances_optimistic.log create mode 100644 plot/symbols_distances_savemysugar.log diff --git a/plot/symbols_distances.gnuplot b/plot/symbols_distances.gnuplot new file mode 100755 index 0000000..07fb77e --- /dev/null +++ b/plot/symbols_distances.gnuplot @@ -0,0 +1,93 @@ +#!/usr/bin/gnuplot -persist +# +# +# G N U P L O T +# Version 5.0 patchlevel 1 last modified 2015-06-07 +# +# Copyright (C) 1986-1993, 1998, 2004, 2007-2015 +# Thomas Williams, Colin Kelley and many others +# +# gnuplot home: http://www.gnuplot.info +# faq, bugs, etc: type "help FAQ" +# immediate help: type "help" (plot window: hit 'h') + +set border 1 +set nogrid +set key autotitles nobox reverse Left enhanced vert left at graph 0, screen 0.98 + +set noytics +unset colorbox + +set xtics 5 out nomirror rotate by -45 + +set yrange[0:0.7] +set size ratio 0.3 + + +set style arrow 1 heads fill size screen .02,15 lc 'gray' +set style arrow 2 nohead lc 'gray' + +_w = 1280 +_h = (_w * 0.39) * 2 + +# a helper function +max(a, b) = (a > b) ? a : b + +symbols_distances_data = 'symbols_distances_defaults.log' + +# Some other example +#symbols_distances_data = 'symbols_distances_optimistic.log' +#symbols_distances_data = 'symbols_distances_codex.log' +#symbols_distances_data = 'symbols_distances_savemysugar.log' + +set terminal unknown + +plot symbols_distances_data using 7:9 +call_setup_time_min = GPVAL_DATA_X_MAX +call_setup_time_max = GPVAL_DATA_Y_MAX + +plot symbols_distances_data using 0:20 +num_symbols = GPVAL_DATA_X_MAX + 1 +dot_distance_min = GPVAL_DATA_Y_MIN +EOM_distance_min = GPVAL_DATA_Y_MAX + +plot symbols_distances_data using 0:16 +symbol_distance_min = GPVAL_DATA_X_MIN +inter_call_distance = GPVAL_DATA_Y_MIN + +symbol_distance = 2 * (call_setup_time_max - call_setup_time_min) +call_position = dot_distance_min - inter_call_distance + +max_x = EOM_distance_min + symbol_distance + +get_val(val) = val eq "inf" ? max_x : val +call_time(sym_dist) = abs(call_setup_time_max - first_call_time) + sym_dist + abs(second_call_time - call_setup_time_min) +symbol_bar_height(val) = (num_symbols - $0) / (2 * num_symbols) + +set xrange [0:max_x + 3] +set yrange[0:0.6] + +set terminal qt 0 enhanced font "Georgia,14" size _w,_h +#set terminal pngcairo notransparent nocrop truecolor rounded enhanced font "Georgia,14" fontscale 1.0 size _w,_h +#set output 'pulse_distance_modulation.png' + +set multiplot layout 2, 1 title "Relative symbol distances (receiver)" font "Georgia,14" + +first_call_time = call_setup_time_max +second_call_time = call_setup_time_min + +set title "Minimum call distance" +plot \ + symbols_distances_data using (0):(0):(call_position):(call_position + call_time($16)):(0):(symbol_bar_height($0)):0 with boxxy \ + fs solid noborder lc palette notitle, \ + symbols_distances_data using ($20):(0.53):(get_val(strcol(22)) - $20):(0) with vectors arrowstyle 1 title 'receiver symbol interval', \ + symbols_distances_data using ($20):(0):(0):(0.55) with vectors arrowstyle 2 notitle, \ + symbols_distances_data using ($20 + symbol_distance / 2):(0.55):(strcol(11)) with labels font "Courier,12" notitle, \ + +first_call_time = call_setup_time_min +second_call_time = call_setup_time_max + +set title "Maximum call distance" +replot + +unset multiplot diff --git a/plot/symbols_distances_codex.log b/plot/symbols_distances_codex.log new file mode 100644 index 0000000..8521205 --- /dev/null +++ b/plot/symbols_distances_codex.log @@ -0,0 +1,5 @@ +1450908992.519691 DEBUG:__init__ call setup time between 7.00 and 9.00 --------- dot transmit time: 9.00 + 5.20 receive time: between 12.20 and 16.20 +1450908992.519986 DEBUG:__init__ call setup time between 7.00 and 9.00 -------- dash transmit time: 9.00 + 9.20 receive time: between 16.20 and 20.20 +1450908992.520123 DEBUG:__init__ call setup time between 7.00 and 9.00 - signalspace transmit time: 9.00 + 13.20 receive time: between 20.20 and 24.20 +1450908992.520246 DEBUG:__init__ call setup time between 7.00 and 9.00 --- wordspace transmit time: 9.00 + 17.20 receive time: between 24.20 and 28.20 +1450908992.520367 DEBUG:__init__ call setup time between 7.00 and 9.00 --------- EOM transmit time: 9.00 + 21.20 receive time: between 28.20 and inf diff --git a/plot/symbols_distances_defaults.log b/plot/symbols_distances_defaults.log new file mode 100644 index 0000000..bc28a2b --- /dev/null +++ b/plot/symbols_distances_defaults.log @@ -0,0 +1,5 @@ +1450801238.674896 DEBUG:__init__ call setup time between 7.00 and 15.00 --------- dot transmit time: 15.00 + 5.20 receive time: between 12.20 and 28.20 +1450801238.675087 DEBUG:__init__ call setup time between 7.00 and 15.00 -------- dash transmit time: 15.00 + 21.20 receive time: between 28.20 and 44.20 +1450801238.675211 DEBUG:__init__ call setup time between 7.00 and 15.00 - signalspace transmit time: 15.00 + 37.20 receive time: between 44.20 and 60.20 +1450801238.675311 DEBUG:__init__ call setup time between 7.00 and 15.00 --- wordspace transmit time: 15.00 + 53.20 receive time: between 60.20 and 76.20 +1450801238.675409 DEBUG:__init__ call setup time between 7.00 and 15.00 --------- EOM transmit time: 15.00 + 69.20 receive time: between 76.20 and inf diff --git a/plot/symbols_distances_optimistic.log b/plot/symbols_distances_optimistic.log new file mode 100644 index 0000000..c940111 --- /dev/null +++ b/plot/symbols_distances_optimistic.log @@ -0,0 +1,6 @@ +1450879717.839452 DEBUG:__init__ call setup time between 7.50 and 8.50 --------- dot transmit time: 8.50 + 5.20 receive time: between 12.70 and 14.70 +1450879717.839778 DEBUG:__init__ call setup time between 7.50 and 8.50 -------- dash transmit time: 8.50 + 7.20 receive time: between 14.70 and 16.70 +1450879717.840013 DEBUG:__init__ call setup time between 7.50 and 8.50 - signalspace transmit time: 8.50 + 9.20 receive time: between 16.70 and 18.70 +1450879717.840189 DEBUG:__init__ call setup time between 7.50 and 8.50 --- wordspace transmit time: 8.50 + 11.20 receive time: between 18.70 and 20.70 +1450879717.840359 DEBUG:__init__ call setup time between 7.50 and 8.50 --------- EOM transmit time: 8.50 + 13.20 receive time: between 20.70 and inf + diff --git a/plot/symbols_distances_savemysugar.log b/plot/symbols_distances_savemysugar.log new file mode 100644 index 0000000..41913af --- /dev/null +++ b/plot/symbols_distances_savemysugar.log @@ -0,0 +1,5 @@ +1450904135.350457 DEBUG:__init__ call setup time between 7.00 and 10.00 --------- dot transmit time: 10.00 + 5.20 receive time: between 12.20 and 18.20 +1450904135.350616 DEBUG:__init__ call setup time between 7.00 and 10.00 -------- dash transmit time: 10.00 + 11.20 receive time: between 18.20 and 24.20 +1450904135.351321 DEBUG:__init__ call setup time between 7.00 and 10.00 - signalspace transmit time: 10.00 + 17.20 receive time: between 24.20 and 30.20 +1450904135.351487 DEBUG:__init__ call setup time between 7.00 and 10.00 --- wordspace transmit time: 10.00 + 23.20 receive time: between 30.20 and 36.20 +1450904135.351558 DEBUG:__init__ call setup time between 7.00 and 10.00 --------- EOM transmit time: 10.00 + 29.20 receive time: between 36.20 and inf -- 2.1.4