Part B: Multi Template Matching

In many cases, a cyclic data series may represent two different actions, mixed together in an unknown way.  For instance, a subject jumping up and down.  If their landing surface varies between a soft and hard platform, the accelerometer data from the experiment will reflect it, but subtlety.  Even if a template for each action is identified, it will likely match against the opposite action, i.e. using action A as a template will produce matches in sections where action B is performed (false positives).  The Template Matching - Discriminator calculation performs correlations independently for action A and action B, then examines their matches to determine which one matches better.  The better match presides, and the worse match is discarded.  The result is a series of matches for action A and a series of matches for action B.  The matches do not overlap.

Step 1: Collecting cyclical data with two distinct patterns

The data displayed below is from a jumping experiment, where the landing surface was intermittently hard and soft.  As you can see, it is difficult to discern which surface was landed on from simply looking at the data, but we know the time interval of one hard landing and the time interval of one soft landing.

 

Step 2: Running the calculation

Using the known time intervals, we extract the template for a soft landing, and the template for a hard landing.  Displayed below is the result of a simple Template Matching calculation, run for the Soft Template, then run for the Hard Template

 

Soft Landing:

Hard Landing:

 

 

Clearly this is not what we are looking for.  The matcher cannot distinguish a hard landing from a soft landing, and thus matches all landings to either template.  However, if the discriminator is run, we end up with results like this, if we specify the soft landing as Template A, and the hard landing as Template B.