The idea behind template or pattern recognition theories is that when we hear periodic sounds, the fundamental is in there, and some harmonics are there, but not always the not always the same ones. But over many experiences with sound you learn a pattern, these harmonics go with that fundamental. So when you hear a sound you compare what you hear with what you have heard in the past and pick the fundamental pitch that matches the best. Even when the fundamental isnŐt there the harmonics match best with the pattern or template for the fundamental.