clear;

tenTurns = loadData('tenTurns5RPM');
plotXYZ(tenTurns);

t_mins = 0:(1/6000):(length(tenTurns.accel)-1)/6000.0;
t_secs = 0:.01:(length(tenTurns.accel)-1)/100.0;

%xAccF1 = filter(filt1.tf.num, filt1.tf.den, tenTurns.accel(:,1));

vel = cumtrapz(t_secs,(tenTurns.accel(:,1)))*100;
%velF1 = cumtrapz(t_secs,xAccF1);

figure;
subplot(2,1,1);
plot(t_secs, vel);
xlabel('Time (min)');
ylabel('X velocity (cm/s)');
title('Integrated X acceleration');

vel = cumtrapz(t_secs,tenTurns.accel(:,2))*100;
subplot(2,1,2);
plot(t_mins, vel);
xlabel('Time (min)');
ylabel('Y velocity (cm/s)');
title('Integrated Y acceleration');

x_acc = tenTurns.accel(:,1);