Browse Source

notes

git-svn-id: https://bucket.mit.edu/svn/nilm/zoom@8032 ddd99763-3ecb-0310-9145-efcb8ce7c51f
tags/zoom-1.0
nilm 12 years ago
parent
commit
8a92526b58
1 changed files with 31 additions and 17 deletions
  1. +31
    -17
      pc/data/20091104/process.txt

+ 31
- 17
pc/data/20091104/process.txt View File

@@ -4,25 +4,39 @@ grep ^1 log | tail -n +125 > log-locked

octave:

octave:1> a=load("log-locked");
octave:2> len=size(a,1)
octave:3> t=1:10000;
octave:5> keith=a(:,3);
octave:7> calib=a(1,4)
octave:8> dac=a(:,5);
octave:9> adc=a(:,6);
octave:12> meas=-(dac - calib * adc);
octave:25> plot(keith(t),meas(t))
octave:48> p = polyfit(keith, meas, 1)
octave:59> plot(t,keith(t) * p(1) + p(2),t,meas(t))
octave:66> t=1:len;
octave:73> plot(t,keith(t) * p(1) + p(2) - meas(t))
octave:75> axis([0 len -5 -5])
a=load("log-locked");
len=size(a,1)
t=1:10000;
keith=a(:,3);
calib=a(1,4)
dac=a(:,5);
adc=a(:,6);
meas=-(dac - calib * adc);
plot(keith(t),meas(t))
p = polyfit(keith, meas, 1)
plot(t,keith(t) * p(1) + p(2),t,meas(t))
t=1:len;
plot(t,keith(t) * p(1) + p(2) - meas(t))
axis([0 len -1 1])

Range is something like +- 0.5 over the entire range (of "DAC values")
This gives log(1024 / 0.5) / log(2) = 11 bits

No good!
Now let's convert the DAC values to their more-accurate value using the lookup table

lookup=load("../../../firmware/lookup.inc");
size(lookup)
meas=-(lookup(dac + 1)/64 - calib * adc);
p = polyfit(keith, meas, 1)
t=1:len;
plot(t,keith(t) * p(1) + p(2) - meas(t))
axis([0 len -0.3 0.3])

Now closer to +- 0.1
This gives log(1024 / 0.1) / log(2) = 13.3 bits





Loading…
Cancel
Save