title: How does knocktounlock work?
body: <p>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)</p>
  
  <p>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.</p>
  
  <p>I have tried things like high/low pass (not sure if there would be a better option)</p>
  
  <p>This is a duplicate of this: <a href="https://stackoverflow.com/questions/20156940/detect-hard-taps-anywhere-on-iphone-through-accelerometer">Detect hard taps anywhere on iPhone through accelerometer</a> But it has not received any answers. </p>
  
  <p>Any help/suggestions would be awesome! Thanks.</p>
  
  <p>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. </p>