My apologies..."Ground Reaction Force (GRF)" is force collected from a forceplate set into the floor. It collects force and moments in x,y,z directions.
I have GRF and Time data. To get to acceleration I use the equation F=ma. From this, a = F/m, where F is GRF and m is body mass
The GRF is represented in Newtons and looks like a bell-shaped curve (as step on and step of).
Because I have difficulty with the actual numeric integration, I tried using polyfit, polyval, and polyint to fit the data, create values and integrate, respectfully.
p_fit = polyfit(time, acc, 9);%9th order polynomial - returns 10 coefficients of polynomial
acc_fitted = polyval(pf, time);%fitted acc data
p_int = polyint(pf);%integrates the polynomial p_fit - returns 11 coefficients from p_fit value.
velocity = polyval(p_int, time);%gives values for velocity
p_int2 = polyint(p_int);%integrates p_int polynomial - returns 12 coefficients
position = polyval(p_int2, time);
The other code I tried is: velocity = cumtrapz(acceleration)*(1/sampling_rate);%
Please pardon my choice of variable names, but I am new to Matlab and programming. Is this correct?? Thank you.