#function to read data from pipe-based ECG
#Bluepipe(TM)

f=fopen("ecg_data_EXG_12.COG");
a=fread(f,'uchar');
b=reshape(a,16,length(a)/16).';
channel1 = 256..^3*b(:,4) + 256..^2*b(:,3) + 256..^1*b(:,2) + 256..^0*b(:,1);
channel2 = 256..^3*b(:,8) + 256..^2*b(:,7) + 256..^1*b(:,6) + 256..^0*b(:,5);
channel3=channel1-channel2;s=215650+0;plot(channel3(s:s+10000-1));

% when it was put on...
% around noon turned on, put on electrodes around 12:20, jumping jacks around 12:23... arrived at beach 1:30pm.
% arrived at beach, noticed FLEXVOLT electrodes had fallen off so I put back onto hospital electrodes from feb12
% the electrodes came off right after swim (while drying off).

