Could you provide some mathematical explanations for the processNextMotion implementation ?
Add some details about the filter, what are the model parameters in the equation (mainly the relation between the user acceleration regarding Z axis and the computed acceleration) ?
That would make the internal algorithm understanding much easier.