Reliable REM sleep detector