label = 'ankle_angle_r';

%orig=read_motionFile('original.mot');
orig=read_motionFile('sine.sto');
%ext=read_motionFile('extract.sto');
ext=orig;
t0=read_motionFile('output0.sto');
t1=read_motionFile('output1.sto');
t2=read_motionFile('output2.sto');

startt = ext.data(1,1);
endt = ext.data(end,1);

extpad=storage_pad(ext,60);

%ft0=lowpassButterworth(q,50,6);
ft0=lowpassFIR(extpad,50,6);
ft1=storage_differentiate(ft0,1);
ft2=storage_differentiate(ft0,2);

plot_columns({t0 ft0 ext orig},label);
hold on;
line([startt startt],[-30 30]);
line([endt endt],[-30 30]);
hold off;
plot_columns({t1 ft1},label);
hold on;
line([startt startt],[-30 30]);
line([endt endt],[-30 30]);
hold off;
plot_columns({t2 ft2},label);
hold on;
line([startt startt],[-30 30]);
line([endt endt],[-30 30]);
hold off;
