A knowledge-based approach to automated sleep EEG (electroencephalogram) analysis is described. In this system, an object-oriented approach is followed in which specific waveforms and sleep stages ("objects") are represented in terms of frames. The latter capture the morphological and spatio-temporal information for each object. An object detection module ("frame matcher"), operating on the frames, is employed to identify what features need to be extracted from the EEG and to trigger the appropriate "specialist"--specialized signal processing modules--to obtain values for these features. This leads to an opportunistic approach to EEG interpretation with quantitative information being extracted from the signal only when needed by the reasoning processes. The system has been tested on the detection of K complexes and sleep spindles. Its performance indicates that the approach followed is feasible and can become a powerful tool for automated EEG interpretation.