if (length(who("calibdata")) == 0) 
  calibdata = load("../calibrate-25-second.log");
endif
if (length(who("a")) == 0)
  for i = 1 : (length(calibdata) / 4000)
    block=1:4000;
    a(i, block, 1) = calibdata((i-1) * 4000 + block, 2);
    a(i, block, 2) = calibdata((i-1) * 4000 + block, 3);
    a(i, block, 3) = calibdata((i-1) * 4000 + block, 1);
  endfor
endif
clf;
figure(1);
hold on
#for i = 1:100
#  x(i) = a(i, 2000, 1);
#  y(i) = a(i, 2000, 3);
#endfor
#plot(x, [diff(y) 0]);



for i = 25 : 10 : 75
   unclamped = 1000:3000;
   unclamped = 1:4000;

   x = a(i, unclamped, 1);
   y = a(i, unclamped, 2);

   filterlen = 1;
   y = filter(ones(1,filterlen)/filterlen,1,y);

 #  y = [ diff(y) 0 ];
   plot(x(filterlen:(length(x)-1)), y(filterlen:(length(y)-1)));
 endfor

  
