1 Introduction

The study of nocturnal sleep is currently a highly relevant task that is being addressed by a significant number of researchers around the world, both as part of the development of interdisciplinary approaches [1,2,3] and clinical research [4]. Neurological disorders [5, 6], cardiological diseases [7,8,9], pathological syndromes of endocrinological [10, 11], and other disorders of the body are accompanied by various disturbances of night sleep in patients. At the same time, the emergence of night sleep disorders contributes to the deterioration of both the course of the main diagnosis, and the emergence of further associated syndromes. For example, the inverse amplification loop of chronic pain syndromes and insomnia [12,13,14] has been well studied. At the same time, obstructive sleep apnoea syndrome remains the most studied primary syndrome of nighttime sleep disturbance today [4, 15]. In this case, when a person is horizontal during night sleep, there is a pathological decrease in the airways, which leads to periodic oxygen deprivation. Apnoea can be caused by obesity, alcoholism, or damage to the cartilage andor tissues of the nose and throat [16,17,18,19,20,21]. However, obstructive apnoea can also be a primary condition related to features of the structure of, for example, the oral cavity [22,23,24]. Obstructive sleep apnoea (OSA) syndrome is a very severe, almost disabling human condition. Extreme fragmentation of sleep, disturbance of its structure and duration does not allow the human central nervous system to rest sufficiently, which causes significant discomfort and problems with the cognitive background of patients [25, 26]. In addition, regularly occurring states of oxygen deprivation, as well as the lack of duration of deep slow and REM sleep stages leads to disturbances in the functional activity of organism [27]. In particular, cardiovascular dynamics are very seriously affected, showing both progressive arterial hypertension, rhythm disturbances, and other conditions [28, 29]. That said, obstructive nocturnal sleep apnoea syndrome is very common, aided greatly by the prevalence of sedentary lifestyles, obesity and other similar disruptions to normal behavioural habits in developed countries [30]. According to some studies, the prevalence of obstructive nocturnal sleep apnoea can be as high as about 15–30% in males and 10–15% in females [31].

Fig. 1
figure 1

a Layout of sensors for polysomnography, b scheme of electrodes arrangement for recording nocturnal EEG recordings during polysomnography. Electrode designations are given in standard international notation

Researchers are particularly interested in this syndrome when investigating it as a primary diagnosis. In other words, a number of patients with normal body weight, no cardiac or neurological disease, etc., may have OSA, which leads to subjective patient dissatisfaction with sleep quality and, without treatment, worsening of the objective clinical status [25].

One of the main tools for studying nocturnal sleep in such disorders is polysomnographic studies, the result of which is a set of physiological signals in digital form, characterising the patient’s state during sleep. Classical polysomnography (PSG) includes the recording of six symmetrical channels of electroencephalography (EEG), eye electrical activity (electrooculogram, EOG), chin muscle activity (electromyogram, EMG), electrocardiogram (ECG), leg and arm motor activity signals, nasal, thoracic, and abdominal respiratory signals and video recordings of nocturnal sleep. Figure 1, a shows a conventional scheme of performing nocturnal polysomnography. After recording the entire data set, the physician-somnologist, relying on the methods of visual (qualitative) and quantitative amplitude and frequency analyses of the entire data block, performs the transcription of the PSG by constructing a hypnogram. The hypnogram represents the division of the entire night’s sleep into a series of accepted stages—slow sleep (N1, N2, N3), rapid eye movement sleep (rapid eye movement sleep, REM) and awakenings [32]. The hypnogram is standardly constructed using a time window of about 30 s and may include a system for automatic diagnosis of the various stages, however, always under the control of a clinical expert.

At the same time, polysomnography is a typical example of a set of poorly structured digital data of different nature. The poorly structured nature of these data is primarily reflected in the very weak criteria for distinguishing between sleep stages. For example, distinguishing between N1 and REM sleep stages is still a very difficult task for automatic systems [33]. In addition, the difference in expert judgements of hypnograms after control by clinical experts can also reach the order of 15 – 20 % differences in the duration of the stages and the moments of their onset [34]. Note that, according to the generally accepted opinion, the erroneous nature of such hypnograms leaves them correct from the point of view of clinical practise and use in scientific research.

Second, the substantial heterogeneity of characteristics of different signals used in PSG analysis also complicates digital processing. For example, myograms, oculograms, electrocardiograms and electroencephalographs have significantly different scales of oscillatory activity. It is more usual in terms of physical approaches and digital processing to perform separate analyses for groups of signals of similar nature. For example, such analysis of ECG and photoplethysmogram has allowed us to recognise different scenarios of cardiovascular activity in patients with [35] obstructive breathing disorders. The study of brain electrical activity during nocturnal sleep has also attracted considerable attention from researchers around the world [1,2,3, 36]. Note that brain activity attracts much attention both from general considerations of the relevance of research in the field of neuroscience, and from the applied aspects of the convenience of conducting PSG. In particular, the ability to automatically establish a diagnosis based solely on the recording of EEG signals would both reduce the cost of the study and complement standard PSG with an important additional tool to support medical decision making.

In the presented work, we demonstrate the results of EEG activity pattern assessment in patients with obstructive sleep apnoea syndrome and healthy participants. This assessment allows us to distinguish a patient with obstructive apnoea without constructing a hypnogram and analysing the full set of polysomnography signals.

2 Materials and methods

The study analysed EEG signals recorded during nocturnal polysomnography recordings. Six symmetrical EEG channels recorded in the left and right hemisphere leads, Fp1, C3, O1 and Fp2, C4, O2, respectively, were used for the study. The names of the leads are given according to the international standard [37], and the electrode locations are shown in Fig. 1b.

All polysomnographic recordings were obtained from two groups of patients. The first group included participants with no subjective health problems and no objectively diagnosed clinical diagnoses. The group of patients with obstructive nocturnal sleep apnoea syndrome included only patients with respiratory disorders with the exclusion of patients with abnormalities in cardiovascular activity and other diseases. Fifteen participants were included in the group of essentially healthy participants (age \(51.5\pm 29.5\) years, median 42 years; malefemale ratio: 87) and ten participants were included in the OSA patients’ group (age \(52.8\pm 13\) years, median 49 years; malefemale ratio: 73).

All polysomnographic recordings were processed in a standardised manner to construct hypnograms. Table 1 summarises the statistical characteristics of all stages of nocturnal sleep as well as nocturnal awakenings. In the OSA group of patients, the average number of awake periods was slightly increased due directly to the specifics of the diagnosis. However, no statistically significant differences were found in the duration and number of sleep stages between apnoeic patients and essentially healthy participants. The Mann–Whitney U-test [38] was used to evaluate group differences hereafter.

Table 1 Statistical characteristics of sleep for two groups of patients

For each EEG recording, the mean number N and duration T of oscillatory patterns in consecutive frequency ranges presented in Table 2 were calculated. These quantities were evaluated based on skeleton analysis of the continuous wavelet transform in a time window \(\Delta t = 30\) s [39,40,41,42]. As a result of the calculations performed, the entire nocturnal EEG signal recording was characterised by an array of values \(N_{\Delta t}\) and \(T_{\Delta t}\). The number of values in these arrays was determined by the total duration L of the nightly recording. We could characterise each of the study participants by the distribution of magnitudes of the number N and duration T of patterns in any of the 20 bands, according to Table 2. Colour schemes were used to represent the laws of distribution of these characteristics of all 25 patients in each frequency range, where different colours correspond to the frequency of observation of a certain value of a numerical EEG parameter. In these schemes, all EEG channels of each patient were plotted on the OX axis and the observed values for the number N or duration T of patterns were plotted on the ordinate axis, as shown in Figs. 2 and 3.

Table 2 Characteristics of frequency bands for assessing the integral characteristics of EEG signals, where # is sequence number of frequency bands, \(f^k_1\) and \(f^k_1\) are minimal and maximal values of band #, \(\Delta f_k\) is band length

The distributions constructed possessed a shape with a pronounced single maximum and some finite width, as conventionally demonstrated in Fig. 4g. In considering such distributions, the coordinates (XY) of the maximum value of each of the distributions (Fig. 4g) were detected. The detected coordinates (XY) in each of the EEG channels recorded in the two groups of study participants were plotted on the corresponding planes defined by the frequency bands \(\Delta f_{1}\) – \(\Delta f_{20}\).

For further analyses, we used averaging of N and T – arrays calculated for each of the EEG signals recorded for the study participants. This approach allowed statistical analysis of group differences in the calculated quantitative characteristics for healthy volunteers and OSA – patients.

Fig. 2
figure 2

a and b: Map distributions of the number N of oscillatory wavelet patterns in the frequency bands \(\Delta f_{11}\) and \(\Delta f_{18}\), respectively. On the vertical axis are the 25 participant numbers, where the green colour shows the numbers of healthy volunteers and the red colour shows OSA patients. The horizontal axis corresponds to the numerical value of the N number of patterns. The colour shows the frequency of observation of the corresponding N for every participant, the colour scale is given on the bottom in the figure

3 Results

Figures 2ab and 3ab show typical results of constructing distributions of the number N and duration T of oscillatory patterns in the frequency ranges \(\Delta f_{11}\) and \(\Delta f_{18}\) for all 25 participants of the study, respectively. It can be clearly seen that relatively slow oscillations whose frequency belongs to the \(\Delta f_{11}\) region do not show any differences for the group of healthy volunteers (highlighted in green in the figures) and OSA patients (red). The maximum number of N patterns is observed between 1.9 and 3.2 in both patient groups. In the low-frequency region, the number of N patterns of OSA patients changes more frequently from the first and second nights of recordings compared to the group of healthy volunteers, namely 50 % of OSA patients and 40 % of volunteers.

At the same time, high-frequency activity in the \(\Delta f_{18}\) band shows visually prominent differences between the two groups considered. The maximum values of the probability distribution for healthy participants fall in the 1.9 – 4.0 value zone, whilst those for apnoeic patients are observed in the region of 1.0 – 3.0 patterns. A similar pattern is observed for all frequency bands with numbers #  17 –19. Thus, the differences in the number of patterns detected in windowed EEG analysis in the presence of obstructive breathing disorders are concentrated at frequencies greater than 30 Hz.

Fig. 3
figure 3

Map distributions of the duration T of oscillatory wavelet patterns in the frequency bands \(\Delta f_{11}\) and \(\Delta f_{18}\), a and b, respectively. On the vertical axis are the 25 participant numbers, where the green colour shows the numbers of healthy volunteers and the red colour shows OSA patients. The horizontal axis corresponds to the numerical value of the N number of patterns. The colour shows the frequency of observation of the corresponding N for every participant, the colour scale is given on the bottom in the figure

Note that the plotted distributions vary markedly for some channels in power (red luminance level) and even in the immediate boundaries of maximum values. Such a picture, for example, is observed for channel C3 recorded on the second night in patient # 6, as shown in Fig. 2a. This situation appears to be related to some common alterations of the repeat recording—possibly due to technical interference. In particular, the recordings of the second night of patient # 6 show significant changes in the number of patterns already for all channels in band \(\Delta f_{18}\).

The duration of oscillatory patterns in the groups of healthy participants and patients shows similar dynamics. For slow oscillatory modes, the duration of oscillatory patterns does not change much when moving from healthy to OSA patients (Fig. 3a). The maximum values of the duration distribution of T patterns in the \(\Delta f_{11}\) band are observed for values of 0.5 – 0.6 s and 0.1 – 0.3 s. The maximum values of the frequency of observation of each of the T durations of the patterns fluctuate in the region 0.0032 – 0.0036.

Fig. 4
figure 4

a, b, c and d, e, f Maps of the location of the maximum density distribution characteristics of the number N and duration T of patterns, respectively. The maps are constructed for frequency bands \(\Delta f_{17}\)\(\Delta f_{18}\) and  \(\Delta f_{19}\) (top, middle and bottom rows, respectively). g Scheme for determining coordinates X and Y from the probability density distribution plot of quantity N and duration T. The green colour corresponds to the data obtained in the group of healthy participants and the red colour corresponds to the data in the group of apnoea patients

Analysis of the high-frequency band \(\Delta f_{18}\) demonstrates slightly different characteristics of the durations of oscillatory patterns in the patients’ EEG, as shown in Fig. 3b. First of all, the probability distribution exhibits significantly superior values for the frequency of observations (0.0044 – 0.0052). Second, the duration of patterns in the high-frequency region possesses a pronounced single maximum, the coordinates of which decrease when moving from healthy participants (green patient numbers) to OSA patients (red patient numbers). Third, the distribution of pattern durations is “higher” in the OSA patient group, corresponding to the darker red colour in the map demonstrated in Fig. 3b.

Further analyses focus on the estimates of oscillatory patterns computed in the high-frequency bands, \(\Delta f_{17}~--~\Delta f_{19}\). As demonstrated in Fig. 4, the simplest visualisation of the spread of the magnitude of the distribution and the value of the number and duration of patterns for the maximum value of the corresponding distributions in six of the EEG channels shows different clouds corresponding to healthy volunteers (green dots) and OSA patients (red dots).

Group analysis of the number and duration of patterns calculated for all six EEG signals in the ranges \(\Delta f_{17}\), (Fig. 5a and d), \(\Delta f_{18}\), (Fig. 5b and e) and \(\Delta f_{19}\), (Fig. 5c and f) shows the presence of statistically significant differences between the groups of healthy and OSA patients. The level of differences is shown using asterisks by Mann–Whitney U-test [38]. In these high-frequency EEG bands, the activity recorded in the groups of apnoea patients and healthy participants is significantly different. We found maximum differences when analysing the number of patterns in the range \(\Delta f_{18}\).

Fig. 5
figure 5

a, b, c and d, e, f Diagrams of the distribution of the number N and duration T of patterns, respectively. The green colour corresponds to the data obtained in the group of healthy participants and the red colour corresponds to the data in the group of apnoea patients. All diagrams depict the following statistical characteristics of third numerical parameters: the first and the quartiles (25 – 75%, inside the box); the median and the mean (transverse line and point inside the box, respectively); 1.5 interquartile range (shown by whiskers) and outliers represented by asterisks

4 Discussion

In the presented work, we develop a method for nonlinear processing of polysomnography components. By estimating the number and duration of oscillatory patterns on the basis of continuous wavelet analysis, we calculated quantitative characteristics for each EEG signal recorded during polysomnography. For numerical and statistical analysis of the characteristics of brain electrical activity, we propose to use the evaluation of the entire polysomnographic recording, without dividing it into sleep stages and moments of nocturnal awakenings. This approach allows us to estimate brain activity independently of the construction of the hypnogram. In other words, automatic analysis based on the evaluation of the number and duration of wavelet patterns in the high-frequency region of 32–38 Hz will allow us to detect the presence of apnoea independently of the expert judgement of a clinical somnologist. Such systems may find application in home primary diagnostics of patients’ respiratory system pathologies. The development of such systems is currently underway in various centres and is aimed at independent diagnosis and unification of the work without exception of the clinical doctor to make a diagnosis [43].

The demand for such independent systems is due to some peculiarities of polysomnographic studies. Today polysomnography is the gold standard of sleep research, but at the same time, it suffers from several limitations. In practise, the process of correct start-up of a PSG installation is complicated and time-consuming. Until now, the installation of all sensors and the initial setup of the system by a qualified technician takes up to an hour and is quite expensive. Clinical PSG is still very bulky, even in the case of wireless sensors, which interferes with the patient’s usual sleep. In addition, the whole hospital environment is often stressful for patients. Due to all these aspects, the result of PSG is to analyse sleep on only one of the nights, which does not take into account the intraindividual variability of sleep parameters [44] observed even when assessing the apnoea–hypopnoea index [45]. In addition, the definition of sleep stages itself suffers from low reliability and lack of agreement between different experts. For example, a study by Rosenberg and Van Hout using the AASM ISR dataset demonstrated that the level of agreement on sleep stage estimates was less than 83 % based on hypnogram estimates from over 2,500 experts [34]. Note that the concordance of estimates varied significantly across stages, being highest for the REM sleep stage (90.5%) and lowest in stages N3 and N1 (67.4% and 63.0%, respectively). Moreover, expert estimates vary considerably in the case of different sleep pathologies, as well as the conduct of the study in different clinical centres [34, 46]. Thus, the development of methods and systems for independent numerical evaluations of biomedical signals recorded during human sleep is a very promising area of development for information systems and sleep medicine.

At the same time, differences in high-frequency brain activity could be demonstrated for both the duration and the number of patterns in the EEG oscillatory structure. In other words, in the region of frequencies exceeding the standard beta oscillation band (17 – 30 Hz), not only quantitative changes during apnoea but also a qualitative transition of the structure to a different state was demonstrated. The combined analysis of the Figs. 4 and 5 suggests that the clustering of sleep, associated to OSA, is significant compared to normal sleep. At the same time, brain EEG studies during sleep often capture oscillatory activity up to the theta [47,48,49] and beta [50] bands. This research position is particularly motivated by the direct search for correlations between EEG and heart rate, the most susceptible to respiratory disturbances. However, it is well known that obstructive disturbances of normal breathing during sleep lead to structural changes in the brain, which has been shown in numerous magnetic resonance imaging studies [51,52,53]. In such a case, the fundamental changes in cortical activity at high-frequency bands may well be a consequence of such structural abnormalities. It is important to note that, as shown in the patient descriptions, these differences in high-frequency EEG activity cannot be directly attributed to changes in nocturnal sleep patterns and the presence of a large number of waking episodes of OSA patients, since no significant differences in the sleep of the study participants were observed (see Table 1).

5 Conclusion

The presented work demonstrates quantitative differences in the analysis of brain electrical activity of participants in a clinical overnight sleep study. The observed significant differences in the oscillatory pattern of brain electrical activity are concentrated in the high-frequency region (32 – 38 Hz). The quantitative characteristics of the patterns in OSA patients are significantly reduced compared to those calculated in healthy volunteers. Analyses of OSA patients and essentially healthy participants demonstrate different clusters in the density estimation space of the number and duration distributions of oscillatory patterns for high-frequency bands.