zoom/pc/data/20090722/makeplotdata.m
jim 8d82916dc0 slightly wider range
git-svn-id: https://bucket.mit.edu/svn/nilm/zoom@8132 ddd99763-3ecb-0310-9145-efcb8ce7c51f
2009-11-25 18:43:45 +00:00

31 lines
708 B
Matlab

data=load('log');
dac=data(:,1);
adc=data(:,2);
t=1:size(data,1);
calib=1.385419;
length(t)
%% adc to actual current in (A/ADC count)
scale = computeI/1000;
scale = scale(1); % just the gain part only
%% get the dc value
t=50:100;
dc = mean(dac(t)-calib*adc(t));
% extract the part for the light and pc
t=1079950:1080290;
out = [t' - t(1), (dac(t) - calib*adc(t) - dc)/calib*scale, (adc(t) < 400 | adc(t) > 1650)];
save("-ascii","lightpc.dat","out");
% light only
t=100090:100358;
out = [t' - t(1), (dac(t) - calib*adc(t) - dc)/calib*scale];
save("-ascii","light.dat","out");
% keithley stepping
t=1590000:1680000;
out = [t' - t(1), (dac(t) - calib*adc(t) - dc)];
save("-ascii","keithley.dat","out");