This article relies largely or entirely on a single source. (July 2017)
Virtual pitch is the pitch of a complex tone (a physical vibration that can be decomposed into partials or pure tone components). Virtual pitch corresponds approximately to the fundamental of a harmonic series that is recognized among the audible partials. A virtual pitch may be perceived even if the perceived pattern is incomplete (in particular, if the fundamental is missing) or mistuned. In that respect, virtual pitch perception is similar to other forms of pattern recognition. It corresponds to the phenomenon whereby one's brain extracts tones from everyday signals (including speech) and music, even if parts of the signal are masked by other sounds. Virtual pitch is contrasted to spectral pitch, which is the pitch of a pure tone or spectral component. Virtual pitch is called "virtual" because there is no acoustical correlate at the frequency corresponding to the pitch: even when a virtual pitch corresponds to a physically present fundamental (or first harmonic), as it often does in everyday harmonic complex tones, the exact virtual pitch depends on the exact frequencies of higher harmonics and is almost independent of the exact frequency of the fundamental.
Virtual pitch is an experimentally established phenomenon in humans that can be mathematically described. In its basic form, given a series of pure tones whose frequencies correspond to a harmonic series, one will hear a virtual pitch near the fundamental frequency, even if there is no pure tone at that frequency. The perceptual salience (clarity, probability of noticing) of the virtual pitch depends on how closely the audible partials match lower harmonics above the virtual pitch. In Terhardt's pitch algorithm, virtual pitches are predicted by looking for subharmonic coincidences between audible partials in a complex tone - in other words, by looking for missing fundamentals.
Virtual pitch can be visualized in the time domain by adding together sine waves corresponding to harmonics of a given fundamental and deleting the fundamental. The resulting wave has a period corresponding to the fundamental frequency, regardless of their phase relationship. However, in Terhardt's theory the virtual pitch does not depend on this period. Instead, it depends on relationships between spectral pitches.
Terhardt rejected the idea of periodicity pitch, because it was not consistent with empirical data on pitch perception, e.g. measurements of the gradual shift of the virtual pitch of a complex tone with a missing fundamental when the partials were gradually shifted. Terhardt instead broke pitch perception into two steps: auditory frequency analysis in the inner ear, and harmonic pitch pattern recognition in the brain. The inner ear effectively performs a running frequency analysis of incoming sounds - otherwise we would not be able to hear out spectral pitches within a complex tone. Physiologically, each spectral pitch depends on both temporal and spectral aspects (i.e. periodicity of the waveform and position of excitation on the basilar membrane), but in Terhardt's approach the spectral pitch itself is a purely experiential parameter, not a physical parameter: it is the outcome of a psychoacoustical experiment in which the conscious listener plays an active role. Psychoacoustic measurements and models can predict which partials are "perceptually relevant" in a given complex tone; they are perceptually relevant if you can hear a difference in the whole sound if the frequency or amplitude of a partial is changed). The ear has evolved to separate spectral frequencies, because due to reflection and superposition in everyday environments spectral frequencies are more reliably carriers of environmental information than spectral amplitudes, which in turn are more reliable carriers of environmentally relevant information than phase relationships between partials (when perceived monoaurally). On this basis, Terhardt proposed that spectral pitches - which are what the listener experiences when hearing out partials (as opposed to the physical partials themselves) - are the only information available to the brain for the purpose of extracting virtual pitches. The "pitch extraction" process then involves the recognition of incomplete harmonic patterns and happens in neural networks.