Periodicity pitch is the most salient and important of all pitch percepts. Psychoacoustical models of this percept have long postulated the existence of internalized harmonic templates against which incoming resolved spectra can be compared, and pitch determined according to the best matching templates [J. Goldstein, J. Acoust. Soc. Am. 54, 1496-1516 (1973)]. However, it has been a mystery where and how such harmonic templates can come about. We present here a biologically plausible model for how such templates can form in the early stages of the auditory system. The model demonstrates that any broadband stimulus, including noise and random click trains, suffices for generating the templates, and that there is no need for any delay lines, oscillators, or other neural temporal structures. The model consists of two key stages: cochlear filtering followed by coincidence detection. The cochlear stage provides responses analogous to those recorded in the auditory nerve and cochlear nucleus. Specifically, it performs moderately sharp frequency analysis via a filterbank with tonotopically ordered center frequencies (CFs); the rectified and phase-locked filter responses are further enhanced temporally to resemble the synchronized responses of cells in the cochlear nucleus. The second stage is a matrix of coincidence detectors that compute the average pairwise instantaneous correlation (or product) between responses from all CFs across the channels. Model simulations show that for any broadband stimulus, a degree of high coincidence occurs among cochlear channels that are spaced precisely at harmonic intervals. Accumulating coincidences over time results in the formation of harmonic templates for all fundamental frequencies in the phase-locking frequency range. The model accounts for the critical role played by three subtle but important factors in cochlear function: the nonlinear transformations following the filtering stage, the rapid phase shifts of the traveling wave near its resonance, and the spectral resolution of the cochlear filters. Finally, we discuss the physiological correlates and location of such a process and its resulting templates.