I am trying to figure out how knocktounlock.com is able to detect "knocks" on the iPhone. I am sure they use the accelerometer to achieve this, however all my tries come up with false flags (if user moves, jumps, etc it sometimes fires)

Basically, I want to be able to detect when a user knocks/taps/smacks their phone (and be able to distinguish that from things that may also give a rise to the accelerometer). So I am looking for sharp high peeks. The device will be in the pocket so the movement of the device will not be very much.

I have tried things like high/low pass (not sure if there would be a better option)

This is a duplicate of this: [Detect hard taps anywhere on iPhone through accelerometer](https://stackoverflow.com/questions/20156940/detect-hard-taps-anywhere-on-iphone-through-accelerometer) But it has not received any answers. 

Any help/suggestions would be awesome! Thanks.

EDIT: Looking for more thoughts before I accept the answer below. I did hear back from Knocktounlock and they use the fourth derivative (jounce) to get better values to then analyse. Which is interesting.