%
%    train experiment 2, samp=512, duration=15 s
%
g=9.81;
load train_26_2.txyz
t=train_26_2(:,1);
N=length(t);
tN=t(N);
i=1:N;
x=train_26_2(:,2);
y=train_26_2(:,3);
z=train_26_2(:,4);
cal=train_26_2(:,5);
%
%   plot each channel
%
figure(1)
subplot(4,1,1);plot(t,x);
axis([0,tN,-12.,12.])
ylabel('acceleration m/s**2')
title('CH1')
subplot(4,1,2);plot(t,y);
axis([0,tN,-12.,12.])
ylabel('acceleration m/s**2')
title('CH2')
subplot(4,1,3);plot(t,z);
axis([0,tN,-12.,12.])
ylabel('acceleration m/s**2')
title('CH3')
subplot(4,1,4);plot(t,cal);
axis([0,tN,0.5,1.5])
ylabel('|g|/g0')
xlabel('time (s) ')
%
%   integrate channel 1
%
dt=1/512;
v=cumsum(x-mean(x))*dt;
d=cumsum(v)*dt;
figure(2)
clf
subplot(3,1,1);plot(t,x);ylabel('acceleration (m/s**2)')
title('CH 1, WDL 26')
subplot(3,1,2);plot(t,v);ylabel('velocity (m/s)')
subplot(3,1,3);plot(t,d);ylabel('displacement (m)')
xlabel('time (s)')
