A recent neurophysical model of propagation of electrical waves in the cortex is extended to include a physiologically motivated subcortical feedback loop via the thalamus. The electroencephalographic spectrum when the system is driven by white noise is then calculated analytically in terms of physiological parameters, including the effects of filtering of signals by the cerebrospinal fluid, skull, and scalp. The spectral power at low frequencies is found to vary as f(-1) when awake and f(-3) when asleep, with a breakpoint to a steeper power-law tail at frequencies above about 20 Hz in both cases; the f(-1) range concurs with recent magnetoencephalographic observations of such a regime. Parameter sensitivities are explored, enabling a model with fewer free parameters to be proposed, and showing that spectra predicted for physiologically reasonable parameter values strongly resemble those observed in the laboratory. Alpha and beta peaks seen near 10 Hz and twice that frequency, respectively, in the relaxed wakeful state are generated via subcortical feedback in this model, thereby leading to predictions of their frequencies in terms of physiological parameters, and of correlations in their occurrence. Subcortical feedback is also predicted to be responsible for production of anticorrelated peaks in deep sleep states that correspond to the occurrence of theta rhythm at around half the alpha frequency and sleep spindles at 3/2 times the alpha frequency. An additional positively correlated waking peak near three times the alpha frequency is also predicted and tentatively observed, as are two new types of sleep spindle near 5/2 and 7/2 times the alpha frequency, and anticorrelated with alpha. These results provide a theoretical basis for the conventional division of EEG spectra into frequency bands, but imply that the exact bounds of these bands depend on the individual. Three types of potential instability are found: one at zero frequency, another in the theta band at around half the alpha frequency, and a third at the alpha frequency itself.