There is only one way that's not disasterously bad.

1) Use 6-DoF to maintain an estimate of the orientation via DCM or quaternion

2) Subtract estimate of the gravity vector from the accelerometer output

3) integrate remaining acceleration to give velocity vector estimate

4) integrate velocity estimate to get position vector.

All of this must be done in 3D, any 2D approximation can be laughably wrong

when significant 3D rotation is present. 3D rotation is not commutative for

instance, and 2D cannot even understand that.

Unfortunately the last two steps have drift - once you integrate you will turn

small offsets into longterm drift which will rapidly degrade the information

when two integration steps are used.

You can high-pass filter to remove the worst of the drift, but that then will cancel

any uniform velocity component completely. However you may be able to get

fairly accurate short-term movement tracks, individual steps for instance, and

then use that to calibrate the model (if you can determine when the foot is

on the ground, that gives you a zero-velocity reference to reset the model and cancel

offsets and drift).

This is all theoretical, it may be harder than I suggest (!)