How to remove 'gravity' (DC component) from the acceleration data?
As the accelerometers used measure true acceleration, there is always a DC component or acceleration due to gravity in the readings.
While many approaches exist, a simple one is to band-pass filtering the data. For human movement the start and stop bands are often set to 0.2-20Hz.
Another method that removes DC component is calculating the standard vector magnitude (SVM) and then subtracting 1g (where g=9.81m/s^2). Although computationally inexpensive, this method is not ideal as the axis aligned information is lost.