For long trains of short electron bunches, a mechanism is found which, at the expense of beam population, enables resonant excitation of the wakefield even if the bunch repetition frequency appreciably differs from the plasma frequency. Frequency synchronization results from defocusing of those bunches which fall into a wrong phase with respect to the plasma-frequency wave.