acc = loadData('3turns');
x_acc = acc.accel(:,1);

zero = mean(x_acc(1:13000));
endPart = mean(x_acc(32500:34250));
slope = (endPart - zero)/(31000 - 15000);
offset1 = slope*(0:10000);
offset2 = slope*(12500:16000);

offset = zero + slope*(0:16000);

five = mean(x_acc(15000:25000) - offset(1:10001)')
ten = mean(x_acc(27500:31000) - offset(12500:16000)')


r = .0127; %m
radToRPM = 60/(2*pi);

zeroRPM = sqrt(zero/r)*radToRPM
fiveRPM = sqrt(five/r)*radToRPM
tenRPM = sqrt(ten/r)*radToRPM
endRPM = sqrt(endPart/r)*radToRPM

% means = [zero five ten endPart];
% x = [0 5 10 15]
% 
% figure;
% plot(x, means);



