Filter for noisy accelerometer data
Most accelerometers suffer from bias --- a non-zero, constant rest measurement. See, for example, this page. 


  A further imperfection is called zero g bias level, or offset. This is the reading the sensor provides with no acceleration, and, unfortunately, that is rarely zero (in the Z direction it should be 1 g). In fact, the error can be substantial, frequently hundreds of times larger than the device’s resolution.


So you need to remove this DC offset (which is how the bias appears) from all your measurements.  If you need to know the $g$ value from the $z$ accelerometer, you will need to calibrate it first in the $x$ or $y$ plane (to remove the effect of gravity).

Have a read through this answer to another question, and try applying a DC blocker to your data.