]> git.itanic.dy.fi Git - log-plotter/blob - balancing.plot
Convert all existing prints into appropriate trace print
[log-plotter] / balancing.plot
1 set term png size 800,480
2
3 set datafile separator ";"
4
5 set ylabel "Voltage (mV)"
6
7 samples(x) = $0 > 4 ? 5 : ($0+1)
8 avg5(x) = (shift5(x), (back1 + back2 + back3 + back4 + back5) / samples($0))
9 shift5(x) =     (back5 = back4, \
10                  back4 = back3, \
11                  back3 = back2, \
12                  back2 = back1, \
13                  back1 = x)
14 init(x) = (back1 = back2 = back3 = back4 = back5 = sum = 0)
15
16 plot sum=init(0), \
17         datafile using (avg5($7 - ($7 + $8 + $9) / 3)), \
18         datafile using (avg5($8 - ($7 + $8 + $9) / 3)), \
19         datafile using (avg5($9 - ($7 + $8 + $9) / 3))