Pattern recognition applied to sleep state classification.