Publisher Summary This chapter assumes that each class is represented by a single pattern. A set of such reference patterns (or prototypes) is available and stored in a database. Given an unknown test pattern, template matching consists of searching the database for the reference pattern most “similar” to the given test pattern. This is equivalent to defining a matching cost that quantifies similarity between the test pattern and the reference patterns. Template-matching techniques are very common in string matching, speech recognition, alignment of molecular sequences, image retrieval, and so forth. They often come with different names depending on the application. This chapter is concentrates on a series of examples of increasing complexity, culminating in an example from speech recognition. In speech recognition the term dynamic time warping is used, whereas in string matching Edit (or Levenstein) distance is quite common. A string pattern is defined as an ordered sequence of symbols taken from a discrete and finite set. For example, if the finite set consists of the letters of the alphabet, the strings are words. The Edit distance is defined as the minimum total number of changes (C), insertions (I), and deletions (R) required to change pattern A into pattern B. The aim of the aim matching sequences of real numbers is to measure how similar/dissimilar are two given ordered sequences of numbers. Dynamic time warping in speech recognition focuses on a simple task in speech recognition known as isolated word recognition (IWR).