A method and device for generating a template that includes determining
whether there are consecutive events of a plurality of sensed events
having first characteristics, and if a predetermined number of events of
the plurality of sensed events subsequent to the consecutive events are
identified as first selected events having second characteristics, the
template is then generated from the first selected events.