clear
close all

A2Din=2.5 %volts 16 bits
conv=2.5/2^16;%A2Din / 2^16;
load('dat_insion1');
drk=conv*d19;
ref=conv*r19;

drka=mean(drk);
refa=mean(ref);
figure; plot(drka'); title('Insion Dark Average'); xlabel('Record Number]'); ylabel('PD out [V]');
figure, plot(refa');  title('Insion Ref Average'); xlabel('Record Number]'); ylabel('PD out [V]');

drks=std(drk-drk);
refs=std(ref-ref);
figure; plot(drks'); title('Insion Dark RMS'); xlabel('Record Number'); ylabel('PD out [Vrms]');
figure, plot(refs'); title('Insion Ref RMS'); xlabel('Record Number'); ylabel('PD out [Vrms]');

dc=mean(drka);

%refd=refs-refa;
%drkd=drks-drka;
%figure; plot(drkd'); title('Insion Dark RMS'); xlabel('Record Number'); ylabel('PD out [Vrms]');
%figure, plot(refd'); title('Insion Ref RMS'); xlabel('Record Number'); ylabel('PD out [Vrms]');

