A method and device for generating a template that includes identifying
events of a plurality of sensed events having predetermined
characteristics as first selected events and generating the template from
the first selected events. Events of the plurality of events having the
predetermined characteristics are identified as second selected events,
and a determination is made as to whether the template is valid in
response to the second selected events. The template is updated from the
second selected events in response to the template not being valid.