'Algorithm to detect tapping-events in an XYZ-signal of an accelerometer

How do I find signal-sections with a particular shape in a noisy signal?

I want to detect tap-events (user tapped a device) using the 100Hz 3-axis accelerometer data provided by the device. This detection needs to be done on the PC retrospectively, not in the device.

A typical tap-event has a distinct shape, approx. like this:

Tap event (from Octave)

Naturally the signal can have different amplitudes and be noisy. I need an algorithm to detect sections of the accelerometer signal with similar shapes.

As a side-note (may help later in the process): Tapping will always happen on the same side of the device, so I know the event is mainly seen on channel Z, channel X and Y show the tap very small only.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source