1.1. Sleep Stages
Sleep is one of our integral daily needs since we spend about one-third of our time doing it. Sleep is a complex and dynamic process that several structures within the brain are involved with it such as the hypothalamus, brain stem, thalamus, pineal gland, and basal forebrain. Rapid eye movement (REM) sleep and non-REM sleep (which have three different stages) are two basic types of sleep. Each is linked to specific brain waves and neuronal activity . The sleep stages, descriptions, and electroencephalogram (EEG) Waveform are summarized in Table 1. Non-REM sleep is necessary for the normal physical and intellectual performance and behavior .
Sleep stage is a significant factor in determining signal diversity of scalp EEG, for all diversity measures used. Hemispheric correlation distinctly changes with the gross sleep type (REM/NREM) as well as with different sleep stages (stages 1 - 4) within NREM. It also varies in the presence of arousal events and apnea .
1.2. Sleep Disorders
Sleep disorders affect an individual’s ability to sleep well on a regular and natural basis. More than 40 million people in the United States suffer from chronic disorders of sleep and wakefulness. About 35 percent of the population has difficulty in falling asleep, maintaining sleep, early morning awakening, or nonrestorative sleep and in 10 percent this insomnia is a persistent problem interfering with daytime function .
Sleep deficiency is associated with significant adverse outcomes for safety and health. There are many biological factors, individual behaviors, and societal and economic pressures that result in insufficient sleep duration, inadequate sleep quality, and/or sleep disorders. These factors often co-occur, and frequently have similar adverse outcomes. Insufficient sleep and other factors may be responsible for the observed relationship between increased weight gain and obesity, as well as increased risk of diabetes, hypertension, dyslipidemia, and other cardiovascular and metabolic disorders, as well as cognitive, behavioral, and, mood alterations associated with sleep deficiency in population studies .
Table 1. The stages and physiological criteria of sleep  .
Common sleep disorders include insomnia, narcolepsy-cataplexy syndrome, obstructive sleep apnoea syndrome, circadian rhythm sleep disorders (e.g., jet lag, shift work disorder, etc.), and parasomnias (e.g., partial arousal disorders, REM behavior disorder, etc.). Insomnia is not a symptom of other disorders but secondary to other medical conditions. Daytime sleepiness, irritable mood, increased possibility of workplace accidents, inability to effectively operate machinery, lapse in concentration while driving are the effects generated due to insomnia . Most sleep disorders, once diagnosed, can be managed with limited consultations. The initial step is to treat any condition that may be secondarily responsible for excessive sleepiness or inability to have an adequate amount of quality sleep .
1.3. Contribution of EEG for Diagnosing Sleep Disorders
Electroencephalogram (EEG) is a common base signal used to monitor brain activities and diagnose sleep disorders. Since each EEG recording is around 8-hour long on average, the manual scoring of such a long signal for a sleep expert is a time-consuming task. The human-based annotation methods also highly rely on an inter-rater agreement in place. Therefore, such restrictions call for an automated sleep stage classification system that is able to score each epoch automatically with high accuracy .
A perfect EEG signal originates only from the cerebral cortex. In reality, EEG signals are contaminated with electrical activities from sources other than the brain. EEG analytical methods are based on detecting features from regions on the cortex as intra-regional analyses. Features can vary depending on the type of task given to the participants in a neuropathic study and on the type of analysis intended by the researcher .
Electrical activity recorded by electrodes placed on the surface of the brain mostly reflects the summation of excitatory and inhibitory postsynaptic potentials in apical dendrites of pyramidal neurons in the more superficial layers of the cortex. Quite large areas of the cortex have to be activated synchronously to generate enough potential for changes to be registered at electrodes placed on the scalp .
2. Sleep EEG Recording and Monitoring
In this section, different procedures will be described for EEG recording and monitoring brain activity during sleep.
2.1. Case Study Protocol 1
Campbell protocol, in UC Davis lab, describes EEG electrode application using a 10 - 20 electrode system. According to this protocol, distinct landmarks were identified on the head, and electrodes were placed at 10% or 20% intervals of the distance between the landmarks. The number of electrodes used will depend on the purpose of the study. Signals from the EEG electrodes are referred to as electrodes placed over the contralateral mastoid. This protocol also described the application of ground and reference electrodes, chin electromyogram (EMG; electrical activity of muscles) electrodes, and electro-occulogram (EOG; used to monitor eye movements) electrodes 1 .
2.2. Case Study Protocol 2
Dennis et al. have presented three steps to observe and analyze the sleep pattern. First, the test subject is required to rest and awake. EEG data are recorded by Activewave EEG recorder for five minutes. Second, the test subject is required to watch the movie for 20 minutes and EEG data are recorded for five minutes immediately after watching the movie. Second, EEG data are recorded for five minutes while the test subject still remains in sleeping condition. Test subjects who are participated in the experiment should at least remain 12 hours of incessant wakefulness and after a day of normal activity.
For the collection of EEG signals, the EEG gold plate electrodes were placed in five channels of the scalp. CamNtech Actiwave EEG System was used to perform the data collection. The Actiwave Recorder is used to collect and record the EEG signal and the CamNtech Interface Dock acts as a reader to show the EEG data collection from the recorder .
2.3. Case Study Protocol 3
Arnal et al. introduce the Dreem headband (DH) which is intended as an affordable, comfortable, and patient-friendly EEG-reduced montage with a high level of accuracy regarding both physiological signal acquisition and automatic sleep stage analysis using a deep learning algorithm along with five dry-EEG electrodes (O1, O2, FpZ, F7, and F8). In this experiment, a total of 25 subjects who wear the DH have been included in the analysis. They assessed the ability of the DH to monitor brain sleep frequencies during the night. The results demonstrated the capacity of the DH to both monitor sleep-related physiological signals and process them accurately into sleep stages .
3. EEG Methods and Procedures
The EEG procedure and methods to assess sleep disorders which we study in this review paper are showed in Figure 1.
3.1. Extraction Stage of Sleep from EEG Signals
In humans, sleep patterns undergo a marked change from birth to old age. According to the EEG signals extraction, human EEG slow waves are typically 100 to 500 μV in amplitude. Visual sleep stage scoring provides some information such as sleep latency and time spent in various stages of sleep, but it does not quantify EEG activity.
Wake EEG is characterized by low amplitude high-frequency waves . In sleep stage 1 (N1), the EEG shows medium amplitude, mixed frequency predominantly of 4 - 7 Hz activity, and irregularly spaced bursts of slow waves. Stage 2
Figure 1. The EEG procedures to assess sleep disorders (17, 20, 21, 24).
(N2) is distinguished by the presence of theta activity accompanied by sleep spindles or K-complexes or both. Stage 3 (N3) is characterized by high amplitude, delta slowing in the range of 0.5 - 2 Hz with amplitudes equal to 75 μV . High-frequency, low-amplitude EEG is present in REM sleep . Stage REM is characterized by the presence of rapid eye movements (REM) which are conjugate, irregular, and sharply contoured eye movements with an initial phase deflection usually lasting less than 500 ms .
3.2. EEG Signal Processing
Sleep state recognition from EEG signals requires specific signal processing and machine learning tools. Signal processing is one of the critical steps in the design of Brain-Computer Interface (BCI) applications based on EEG, in order to identify the mental state of the user. The aim of EEG signal processing is to translate raw EEG signals into the class of these signals. Two main steps are signal extraction and classification . There are different signal processing methods used to extract hidden information from the signals. Zhang et al. reported that for obtaining high accuracy of classification, before the feature extraction, the raw EEG signals should be preprocessed due to the low signal-to-noise ratio. In that study, they have used channel selection, time window setting, and artifacts removal methods. In channel selection, Some EEG sampling channels are closely related to the sensorimotor rhythm.
Removing unrelated channels can improve spatial feature extraction. In time window setting, proper length of the signal segment should be cut out according to the mental activity tasks .
Aboalayon et al. in their study reported many of the sleep stage detection schemes to employ pre-processing techniques before extracting the features from the signal, such as using frequency-selective-filtering and Discrete Wavelet Transform (DWT). However, a few studies do not employ any form of filtering prior to the analysis . Alturki et al. split the EEG dataset into an equal segment with a specific length to ensure that in each segment the amount of information is equal. After the EEG signals were segmented, the EEG segments were filtered to remove the noises and interferences generated during EEG signal recording .
3.2.1. Artifacts Removal
Artifacts are undesirable electrical potentials that come from sources other than the brain. Artifacts are to be detected and removed in order to improve the interpretation of EEG signals. Small amplitude EEG signals are highly sensitive to artifacts. This includes electro galvanic signals (slow artifact), movement artifact, and frequency artifacts . There are different methods for removing artifacts. Some methods are only focused on the detection and removal of particular artifacts, such as ECG, EOG, EMG. Some methods need reference channels to enhance the accuracy of artifact removal, which is not feasible for some specific applications. BSS or Wavelet methods remove artifacts with great accuracy, however, methods operating with high computational complexity may not be suitable for online applications .
The filtering technique aims to remove all the interference and noise to improve and increase the classification accuracy results. Alturki et al. have presented different filtering methods such as finite impulse response (FIR) filters and infinite impulse response (IIR) filters . Filtering will modify the shape of EEG waveforms and the amplitude as well. The degree to which the waves are affected depends on their frequencies and the characteristics of the filter. Therefore, the results of analysis of a filtered EEG will differ from those of an unfiltered EEG .
3.2.2. Signal Processing Tools
Many automated sleep classification algorithms have become commercially available, such as QUISI, a single channel, self-applicable ambulatory EEG recording device. Automated sleep staging algorithms do offer the potential for low-cost screening, with reduced EEG lead sets, and less intensive human training required. However, since most algorithms have not been designed to replicate the clinical sleep stages exactly, there is not a general trust of automated sleep staging in the clinical setting .
The software tools usually used for signal processing include MATLAB, Octave, and SciPy. Interactive MATLAB tools, NeuroView, and other similar software can use for processing continuous and event-related EEG, MEG and electrophysiological data, and other methods including artifacts rejection .
3.3. EEG Signal Analysis
Different stages of sleep can be analyzed by EEG signals to help in diagnoses sleep disorders. Alpha power is lowered and theta power is enhanced in subjects with a variety of different neurological disorders. Furthermore, after sustained wakefulness and during the transition from waking to sleeping when the ability to respond to external stimuli ceases, upper alpha power decreases, whereas theta increases . Subha et al. used various measurement techniques of analysis such as time-domain, frequency-domain, time-frequency, and non-linear methods to extract information from EEG signals. Time-domain measures are susceptible to bias secondary to non-stationary signals. The limitation of time-domain measure is that it does not reliably distinguish between distinct biological signals. There can be many signals with identical means and standard deviations but with different underlying rhythms, whereas Frequency-domain analysis helps in characterizing EEG signals as they fall in different frequency bands . Raman et al. have presented other feature extraction methods such as Principal Component Analysis (PCA) and Independent Component Analysis (ICA). PCA represents the d-dimensional data in a lower-dimensional space. ICA is used to convert random signals with multiple variables into one with mutually independent components .
The result of a study showed that signal diversity of scalp EEG in healthy volunteers changed significantly with sleep stage, and was progressively reduced with deeper stages of non-REM sleep. Signal diversity decreased with sleep depth but was not significantly different between dreaming and non-dreaming stages .
Siddiqui et al. reported that for the Alpha activity, the normalized power for insomnia cases the range is low (0.006 - 0.02) while the normalize power for normal cases is in the range of 0.04 - 0.12 which is high. Normalized power of Beta activity for normal cases is found in the range 0.004 - 0.007 which is high, on the other hand in insomnia cases the range is 0.0005 - 0.0007 which is quite low. For Theta activity, the normalized power of normal cases is low as compare to insomnia victims. Delta activity normalized power for the normal case is found in the range of 0.58 - 0.76 and for insomnia cases, it is found in the range of 0.81 - 0.89 which means the normalized power of insomnia case is high as compare to the normal case. The insomnia patients have high normalized power for Delta wave and low normalized power for respectively Theta, Alpha, and Beta waves of EEG signals .
An overview of the brain structures involved in non-REM sleep generation showed that the thalamus and the cerebral cortex are absolutely necessary for the most significant bioelectric and behavioral events of non-REM sleep to be expressed. Cortical and thalamic mechanisms are also involved in the generation of EEG delta wave that appears in N3 stage non-REM. Sleep homeostasis depends not only on the duration of prior wakefulness but also on its intensity, and sleep need increases when wakefulness is associated with learning .
5.1. Sleep Disorders Detection
EEG test can be used as an authentic indicator. The extracted signals from EEG allow us to monitor brain activities and diagnose sleep disorders such as insomnia, narcolepsy-cataplexy syndrome, obstructive sleep apnoea syndrome, circadian rhythm sleep disorders, and parasomnias.
EEG test is a functionally safe, non-invasive, fast, simple, and cheap method of analyzing the functionality of the brain. High-resolution EEG technology is available that can detect activities of even one-millisecond .
In this review paper, different procedures have been described for EEG recording and monitoring brain activity during sleep. In the EEG electrodes system, signals were referred to an electrode placed at the landmarks of the head . Another protocol described the EEG gold plate electrodes based on the Actiwave and the CamNtech system . On the last protocol, Dreem headband (DH) was introduced as an affordable, comfortable, and patient-friendly EEG-reduced montage with a high level of accuracy regarding both physiological signal acquisition and automatic sleep stage analysis .
The diverse waveform can be extracted from EEG which indicates a particular stage of sleep (REM and non-REM) with different amplitude and frequencies.
Various measurement techniques of analysis such as time-domain, frequency-domain, non-linear method, PCA, and ICA are also presented .
5.2. Sleep Disorders Management
The results of various stages of sleep from an EEG test help the sleep specialists to diagnose or evaluate sleep disorders accurately. As normal sleep plays an important function in human life, sleep disorder management is integral to provide patients with a safe sleeping environment.
Appropriate strategies to assess sleep disorders and employee wellness are an occupational safety issue that requires administrative, and regulatory mandates . Melatonin is the first-line treatment, and in refractory cases, Clonazepam in lower doses may be tried . Also, multi-component cognitive behavioral therapy, multicomponent brief therapies, stimulus control, sleep restriction therapy, and relaxation therapy as specific behavioral and psychological therapy for the treatment of chronic insomnia disorder in adult patients are recommended using by clinicians .
 Abeyratne, U.R., Swarnkar, V., Rathnayake, S.I. and Hukins, C. (2007) Sleep-Stage and Event Dependency of Brain Asynchrony as Manifested through Surface EEG. 29th Annual International Conference of the IEEE Engineering in Medicine and Biology Society, Lyon, 22-26 August 2007, 709-712.
 Estrada, E., Nazeran, H., Nava, P., Behbehani, K., Burk, J. and Lucas, E. (2004) EEG Feature Extraction for Classification of Sleep Stages. The 26th Annual International Conference of the IEEE Engineering in Medicine and Biology Society, 1, 196-199.
 Zee, P.C., Badr, M.S., Kushida, C., Mullington, J.M., Pack, A.I., Parthasarathy, S., Redline, S., Szymusiak, R.S., Walsh, J.K. and Watson, N.F. (2014) Strategic Opportunities in Sleep and Circadian Research: Report of the Joint Task Force of the Sleep Research Society and American Academy of Sleep Medicine. Sleep, 37, 219-227.
 Siddiqui, M.M., Srivastava, G. and Saeed, S.H. (2016) Diagnosis of Insomnia Sleep Disorder Using Short Time Frequency Analysis of PSD Approach Applied on EEG Signal Using Channel ROC-LOC. Sleep Science, 9, 186-191.
 Mousavi, S., Afghah, F. and Acharya, U.R. (2019) SleepEEGNet: Automated Sleep Stage Scoring with Sequence to Sequence Deep Learning Approach. PLoS ONE, 14, e0216456.
 Smith, S.J.M. (2005) EEG in the Diagnosis, Classification, and Management of Patients with Epilepsy. Journal of Neurology, Neurosurgery & Psychiatry, 76, ii2-ii7.
 Arnal, P.J., Thorey, V., Debellemaniere, E., Ballard, M.E., Bou Hernandez, A., Guillot, A., Jourde, H., Harris, M., Guillard, M., Van Beers, P., et al. (2020) The Dreem Headband Compared to Polysomnography for Electroencephalographic Signal Acquisition and Sleep Staging. Sleep, 43, zsaa097.
 Lotte, F. (2014) A Tutorial on EEG Signal-Processing Techniques for Mental-State Recognition in Brain-Computer Interfaces. In: Miranda, E. and Castet, J., Eds., Guide to Brain-Computer Music Interfacing, Springer, London, 133-161.
 Zhang, W., Tan, C., Sun, F., Wu, H. and Zhang, B. (2018) A Review of EEG-Based Brain-Computer Interface Systems Design. Brain Science Advances, 4, 156-167.
 Aboalayon, K.A.I., Faezipour, M., Almuhammadi, W.S. and Moslehpour, S. (2016) Sleep Stage Classification Using EEG Signal Analysis: A Comprehensive Survey and New Investigation. Entropy, 18, Article No. 272.
 Alturki, F.A., AlSharabi, K., Abdurraqeeb, A.M. and Aljalal, M.J.S. (2020) EEG Signal Analysis for Diagnosing Neurological Disorders Using Discrete Wavelet Transform and Intelligent Techniques. Sensors, 20, Article No. 2505.
 Roebuck, A., Monasterio, V., Gederi, E., Osipov, M., Behar, J., Malhotra, A., Penzel, T. and Clifford, G.D. (2013) A Review of Signals Used in Sleep Analysis. Physiological Measurement, 35, R1.
 Raman, S.S., Lakshmi, A.S., Murthy, P.A. and Faizan, M. (2020) Electroencephalogram (EEG), Its Processing and Feature Extraction. International Journal of Engineering and Technical Research, 9, 1030-1034.
 Klimesch, W. (1999) EEG Alpha and Theta Oscillations Reflect Cognitive and Memory Performance: A Review and Analysis. Brain Research Reviews, 29, 169-195.
 Aamodt, A., Nilsen, A.S., Thurer, B., Moghadam, F.H., Kauppi, N., Juel, B.E. and Storm, J.F. (2021) EEG Signal Diversity Varies with Sleep Stage and Aspects of Dream Experience. Frontiers in Psychology, 12, Article No. 655884.
 Walch, O., Huang, Y., Forger, D. and Goldstein, C. (2019) Sleep Stage Prediction with Raw Acceleration and Photoplethysmography Heart Rate Data Derived from a Consumer Wearable Device. Sleep, 42, zsz180.
 Edinger, J.D., Arnedt, J.T., Bertisch, S.M., Carney, C.E., Harrington, J.J., Lichstein, K.L., Sateia, M.J., Troxel, W.M., Zhou, E.S. and Kazmi, U. (2021) Behavioral and Psychological Treatments for Chronic Insomnia Disorder in Adults: An American Academy of Sleep Medicine Clinical Practice Guideline. Journal of Clinical Sleep Medicine, 17, 255-262.