An oscillator is any device or circuit that generates a periodically oscillating electric signal (usually a sine wave or a square wave). ... A crystal is a piece of piezoelectric material that generates an oscillating sinusoidal electric signal due to the mechanical vibration of its structure.