In electronics, an oscillator is a device converting direct to alternating current, used, for example, in generating radio waves. Most types are based on an electronic amplifier, and small portion of the output being returned via a feedback circuit to the input, so as to make the oscillation self-sustaining. The feedback signal must have the same phase as the input; by varying the components of the feedback circuit, the frequency for which this occurs can be varied, so that the oscillator is easily "tuned." Crystal oscillators incorporate a piezoelectric crystal (see piezoelectric effect in the tuning circuit for stability; in heterodyne oscillators, the output is the beat frequency between two higher frequencies.