A continuous scale of sleep depth which replaces the traditional sleep stages has been proposed earlier. This paper presents a computerized implementation of such a method. Nonlinear filters and mathematical morphological operations were applied to physiological signals. A variable window a-trimmed mean filter was developed to derive the raw sleep depth from EEG (electroencephalogram). Other nonlinear filters and the mathematical morphological operations were utilized to extract arousals and REM stages by using EEG, EOG (electrooculogram) and EMG (electromyogram).