Automated sleep stage detection and classification of sleep disorders