An oscillator is a mechanical or electronic device that works on the principles of oscillation: a periodic fluctuation between two things based on changes in energy. Computers, clocks, watches, radios, and metal detectors are among the many devices that use oscillators.
A clock pendulum is a simple type of mechanical oscillator. The most accurate timepiece in the world, the atomic clock, keeps time according to the oscillation within atoms. Electronic oscillators are used to generate signals in computers, wireless receivers and transmitters, and audio-frequency equipment, particularly music synthesizers. There are many types of electronic oscillators, but they all operate according to the same basic principle: an oscillator always employs a sensitive amplifier whose output is fed back to the input in phase. Thus, the signal regenerates and sustains itself. This is known as positive feedback. It is the same process that sometimes causes unwanted "howling" in public-address systems.
The frequency at which an oscillator works is usually determined by a quartz crystal. When a direct current is applied to such a crystal, it vibrates at a frequency that depends on its thickness, and on the manner in which it is cut from the original mineral rock. Some oscillators employ combinations of inductors, resistors, and/or capacitors to determine the frequency. However, the best stability (constancy of frequency) is obtained in oscillators that use quartz crystals.
In a computer, a specialized oscillator, called the clock, serves as a sort of pacemaker for the microprocessor. The clock frequency (or clock speed) is usually specified in megahertz (MHz), and is an important factor in determining the rate at which a computer can perform instructions.