You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

44 lines
1010 B

  1. Some processing thoughts:
  2. zcat log.gz | grep ^1 | tail -n +200000 > log-locked
  3. octave:
  4. a=load("log-locked");
  5. len=size(a,1)
  6. t=1:10000;
  7. keith=a(:,3);
  8. calib=a(1,4)
  9. dac=a(:,5);
  10. adc=a(:,6);
  11. meas=-(dac - calib * adc);
  12. plot(keith(t),meas(t)) # should be linear
  13. p = polyfit(keith, meas, 1)
  14. plot(t,keith(t) * p(1) + p(2),t,meas(t)) # should match
  15. t=1:len;
  16. plot(t,keith(t) * p(1) + p(2) - meas(t)) # absolute error (units=dac)
  17. axis([0 len -1 1])
  18. Range is something like +- 0.5 over the entire range (of "DAC values")
  19. This gives log(1024 / 1.0) / log(2) = 10 bits
  20. No good!
  21. Now let's convert the DAC values to their more-accurate value using the lookup table
  22. lookup=load("../../../firmware/lookup.inc");
  23. size(lookup)
  24. meas=-(lookup(dac + 1)/64 - calib * adc);
  25. p = polyfit(keith, meas, 1)
  26. t=1:len;
  27. plot(t,keith(t) * p(1) + p(2) - meas(t)) # absolute error (units=dac)
  28. axis([0 len -0.3 0.3])
  29. Now closer to +- 0.05
  30. This gives log(1024 / 0.1) / log(2) = 13.3 bits