Indonesian Journal of Electrical Engineering and Computer Science Vol. 29, No. 2, February 2023, pp. 761~771 ISSN: 2502-4752, DOI: 10.11591/ijeecs.v29.i2.pp761-771 761 Journal homepage: http://ijeecs.iaescore.com Brain signals analysis for sleep stages detection using virtual instrumentation platform Abdeljalil El Hadiri, Lhoussain Bahatti, Abdelmounime El Magri, Rachid Lajouad Laboratory of Electrical Engineering and Intelligent Systems, ENSET Mohamedia, Hassan II University of Casablanca, Mohammedia, Morocco Article Info ABSTRACT Article history: Received Aug 4, 2022 Revised Oct 11, 2022 Accepted Oct 24, 2022 This paper discusses the use of the laboratory virtual instrumentation engineering workbench (LabVIEW) software tool for analyzing brain waveforms (i.e EEG: electroencephalogram) to study sleep stages such as deep sleep, light sleep and so on. The used EEG signals are generated in order to span all sleeping phases. Indeed, a mandatory step of signal processing has been performed, such as sampling, filtering and features extraction. This analysis is carried out with the LabVIEW program, which is a popular virtual instrumentation platform. The EEG signals used in the analysis were obtained from an open-source database and went through several steps, including noise removal, classification and feature extraction. To extract the feature, different filters are employed and the outputs of all filters are compared, leading to a sleep level detection. The simulation results show clearly the performances of this analysis. Keywords: Electroencephalogram LabVIEW Real time Signal processing Sleep detection This is an open access article under the CC BY-SA license. Corresponding Author: Abdeljalil El Hadiri Laboratory of Electrical Engineering and Intelligent Systems, ENSET Mohamedia Hassan II University of Casablanca Boulevard Hassan II, Mohammedia BP 159, Morocco Email: abdeljalil.elhadiri-etu@etu.univh2c.ma 1. INTRODUCTION Safety is a fundamental issue for all road users, particularly vehicle drivers, as traffic accidents occur around the world, resulting in significant losses ranging from serious injury to death [1]–[3]. Strong management in all areas of safety on the road is essential for achieving effective road safety outcomes. It is suggested that a financed lead agency is in place to drive the national road safety effort and execute a Safe Systems strategy. The government only has a significant road safety goal, which is to minimize deaths by 20% and 50%, accordingly, between 2016 and 2020 and 2016 and 2026 [4], In the statistical situation of road safety in Morocco, data on traffic accidents and their victims are mainly derived from field observations and statistics compiled by government agencies [5], In this context, the Moroccan Ministry of Equipment and Transport, declared that there were more than 67,300 accidents, 2500 fatal accidents, 3026 people killed, 10037 people seriously injured, and 92366 people potentially suffering injuries [6]. Driver sleepiness is currently one of the main causes of of fatal accidents [7]. Many accidents can be averted if tiredness is identified and communicated to the driver as a mental state. As a result, driver drowsiness and the time of falling asleep can be detected. All of these possibilities have resulted in the establishment of a human drowsy state surveillance system for drivers, which has become a key emphasis subject in the field of safe driving [8]. Researchers have developed various techniques to identify drowsiness, Several of these approaches are extremely accurate, such as, detecting eyes blinking, detecting mouth [9]-[12] and detecting faces from