Decreased electrocortical temporal complexity distinguishes sleep from wakefulness

In most mammals, the sleep-wake cycle is constituted by three behavioral states: wakefulness (W), non-REM (NREM) sleep, and REM sleep. These states are associated with drastic changes in cognitive capacities, mostly determined by the function of the thalamo-cortical system. The intra-cranial electroencephalogram or electocorticogram (ECoG), is an important tool for measuring the changes in the thalamo-cortical activity during W and sleep. In the present study we analyzed broad-band ECoG recordings of the rat by means of a time-series complexity measure that is easy to implement and robust to noise: the Permutation Entropy (PeEn). We found that PeEn is maximal during W and decreases during sleep. These results bring to light the different thalamo-cortical dynamics emerging during sleep-wake states, which are associated with the well-known spectral changes that occur when passing from W to sleep. Moreover, the PeEn analysis allows us to determine behavioral states independently of the electrodes’ cortical location, which points to an underlying global pattern in the signal that differs among the cycle states that is missed by classical methods. Consequently, our data suggest that PeEn analysis of a single EEG channel could allow for cheap, easy, and efficient sleep monitoring.

Pompe 10 introduced the Ordinal Pattern (OP) analysis, allowing to encode any signal into OPs and approximate its SE. This approximation is known as Permutation Entropy (PeEn). In contrast to other methods, PeEn is a time-series complexity measure that is simple to implement, is robust to noise and short time-series, and works for arbitrary data sets 13,[16][17][18][19][20][21][22][23][24] . In particular, it has been shown that PeEn applied to EEG signals captures different states associated with the level of consciousness, both during anesthesia [24][25][26][27] and sleep 28,29 . Hence, in order to study the thalamo-cortical function during W and sleep, PeEn is a practical and reliable method, where results can be understood from primary principles, and can be related to the signal characteristics.
Previous works have analyzed PeEn in standard EEG recordings [25][26][27][28][29] . However, EEG signals have frequency limitations due to scalp-filtering, are often recorded with low sampling rates, and pre-acquisition filters are commonly applied. In addition, as the recording electrodes are placed above the scalp's skin, other sources can interfere with the cortical neural activity (e.g., muscular activity) 30 . These limitations exclude the possibility of considering high-frequency oscillations; for example, γ frequency band ( − Hz 30 100 ), which is known to vary substantially during the sleep-wake cycle and is an active field of research in Neuroscience 3,5-9,31,32 . Thus, PeEn analysis of standard EEG signals is technically limited and is unable to assess the significance of the broad frequency spectrum in relation with the thalamo-cortical function and its cognitive counterpart. Consequently, it is still uncertain whether previous results hold when considering ECoG measurements and whether these results would depend on cortical location, frequency content, or PeEn parameters.
In the present study, we characterized the PeEn of recordings from freely moving rats during W and sleep. We found that ECoG's PeEn is maximal during W and decreases during both sleep states. Moreover, we noted that these results are independent of the cortical location (namely, the electrodes placement), pointing towards a global cortical pattern for each sleep-wake state that is captured by the PeEn analysis but is missed by classical methods. Figure 1a shows examples of polysomnographic recordings obtained from electrodes placed directly above the cortex of a representative rat. Electrode locations are shown on the left panel and the intra-cranial polysomnographic recordings for W (blue), NREM (green), and REM sleep (red) states are shown on the right panels, which have been distinguished by means of the standard sleep scoring criteria (see Methods). In Fig. 1b we show, for the same animal, the hypnogram (top), as well as the spectrogram (middle) and PeEn values (bottom) processed from the ECoG recorded with the V2r electrode (with a sampling rate of Hz 1024 and = D 3 embedding dimension for the PeEn analysis; see Methods for details). The hypnogram shows the standard sleep scoring, the spectrogram shows the ECoG frequency content, and the PeEn quantifies its complexity; namely, its randomness or unpredictability. Maximal PeEn values were achieved during W, PeEN values decreased during NREM sleep and reached minimum values during REM sleep. This result states that the ECoG becomes more predictable -less random -during sleep, especially during REM sleep. More importantly, we found that PeEn is able to detect transitions between behavioral states, which are typically difficult to be noticed from raw data or from the spectrogram. For example, the power spectrum in Fig. 1b Fig. 1c and Table 1, there are significant differences among behavioral states for all recorded neocortical regions; in the Olfactory Bulb (OBr, archicortex) there was a tendency to decrease = .

Results permutation entropy during wakefulness and sleep.
p ( 0056) when REM was compared to NREM sleep (first row in Table 1). Consequently, the PeEn of the ECoG characterizes and follows the state transitions regardless of the electrode's location. permutation entropy dependence on the embedding dimension. We characterized how PeEn reflects the ECoG temporal complexity during W and sleep. In order to do this characterization, we modified the embedding dimension D, which is the parameter that sets the ordinal pattern (OP) length encoding the ECoG signal. Specifically, each OP captures the relationship between the relative amplitudes (ranking its values) inside a D-sized non-overlapping time-window of the signal (see Methods for details on the encoding procedure). Hence, changing D modifies the time scale of the ECoG being analyzed and the resultant PeEn calculation. The larger the OP, the more details are obtained from the signal; thus, the less random the signal becomes and the smaller its PeEn value. For example, Fig. 2 shows that the PeEn values consistently decrease as we increased the embedding dimension from = D 2 to = D 4, either for W or sleep. Overall, averaged PeEn values during W were larger than during sleep for all Ds. Also, the fact that PeEn variability is minimal for = D 2 is because this dimension has the greatest sensitivity to random fluctuations: i.e., it mainly captures noise. permutation entropy relationship with the frequency spectrum. As our results show that REM sleep had the lowest temporal complexity out of all states considered, we examined whether the frequency content could be influencing our PeEn assessment. In order to associate the PeEn values with the different frequency bands, we performed successive down-samples to the ECoG signals. This process allows for the ordinal patterns to capture lower frequency components of the ECoG signal, while keeping constant the embedding dimension, D.
We down-sampled the ECoG from a sampling rate of Hz 1024 , halving it down to Hz 64 ; thus, changing the maximum frequency resolution from Hz 512 to Hz 32 . By doing this, the PeEn value changed, revealing its relationship to the frequency spectrum. Fig. 3a shows averaged PeEn using = D 3 for all rats and electrode locations, for W (blue), NREM (green) and REM sleep (red). The shaded areas indicate the mean ± standard error of these averages, showing that the states differentiate in average significantly (the exact statistics are exhibited in Table S1 Table 1). www.nature.com/scientificreports www.nature.com/scientificreports/ further understood by comparing these results with the power spectral density (PSD) analysis shown in Fig. 3b. In general, the PSD of a signal is the probability distribution function of its frequency content; namely, the degree of presence that each frequency component has in the signal. As we down-sampled the ECoG signals, as in , there is a large difference in the PSD value between W and sleep. However, when lower frequencies are considered, REMs PSD increased above NREMs. Note that below Hz 200 REMs lower frequencies become more relevant (Fig. 3b) and PeEn (Fig. 3a) values are larger than NREM sleep and closer to W. ordinal pattern probability distributions. In addition to the Entropy quantification, we considered the qualitative differences and variations appearing in the OP probability distributions during W and sleep. The OP distributions shown in Figs. 4 and 5 quantify the relative frequency of appearance that each OP has in the encoded ECoG signal; namely, the OP probability. Figure 4a shows the 6 possible OPs when the embedding dimension is = D 3 (top panel), and the resultant OP probability distribution we found from the ECoGs in each sleep-wake state (bottom panel). Similarly, Fig. 4b shows the OPs and OP distribution for = D 4. It is readily observed from both panels that the increasing or decreasing OPs (i.e., labels 1 and 6 in Fig. 4a and labels 1 and 24 in Fig. 4b) have a larger probability of occurrence, irrespective of the sleep-wake state or the embedding dimension (results hold for larger D -not shown). We note that, in spite of having qualitatively similar distributions for = D 4, other OPs start to emerge, such as labels 7 and 18, which are modified versions of labels 1 and 24, respectively. Nevertheless, these OPs are not statistically significant, since they fall within the null hypothesis confidence interval (signaled by the shaded grey areas in both panels). On the contrary, the OP distribution in Fig. 4a for = D 3 during sleep (red and green) significantly departs from the null hypothesis, which corresponds to the uniform distribution (shaded grey area).  www.nature.com/scientificreports www.nature.com/scientificreports/ comparison with classical amplitude encoding. Classical analysis of time-series uses the probability distribution function of the signal; namely, the signal is encoded using a histogram of its amplitudes. This process discards the information coming from the signal's time stamps; in other words, the amplitude time-dependence. We compared the entropy values using histograms with 18 bins of the ECoG, where the results are shown in Fig. 5. As can be directly observed, there were some differences among the sleep states (either NREM or REM), but there were no consistent global pattern and no single electrode was able to differentiate between all sleep-wake states (see Table S2). Moreover, these results remain practically invariant when using larger number of bins (data not shown).

Discussion
In this work, we described that the collective cortical activity measured by ECoG in male adult rats fluctuates between periods of high temporal complexity during W, and periods of low temporal complexity during sleep (see Fig. 1b,c). These ECoG complexity variations reflect the differences in the thalamo-cortical function between sleep-wake states. Consequently, our results strongly support and extend studies in human that carried out PeEn analyses and other complexity measures in standard EEG recordings [25][26][27][28][29]33 .  Fig. 1; i.e., olfactory bulb, right and left motorsensory, somatosensory, and visual cortices, respectively. The colour code signals the sleep-wake cycle states (W, blue; NREM, green and REM sleep, red) and the symbols and horizontal lines represent the same as in Fig. 1c. The entropy values were calculated from the ECoG amplitude histograms using 18 bins. The sampling rate was Hz 1024 . The statistic is shown in the Supplementary Material (see Table S2). (2019) 9:18457 | https://doi.org/10.1038/s41598-019-54788-6 www.nature.com/scientificreports www.nature.com/scientificreports/ We also showed that PeEn profile during W and sleep did not change according to the cortical recording site, reflecting a common micro-structure motif and a dynamical behavior which are independent from the origin of the cortical signal. The average randomness of these micro-structure patterns distinguished sleep from W, regardless of the changes in the embedding dimensions employed in PeEn analysis (Fig. 2) and the sampling frequencies considered (Fig. 3a). These results suggest the use of PeEn as a quantitative tool for understanding thalamo-cortical dynamics during various physiological conditions, the influence of psychoactive drugs, or pathological conditions. A strong benefit from PeEn analyses is that PeEn variations across states can be explained by dynamical systems theory 10,16,34 ; conversely, with other techniques the tractability is lost (such as, machine-learning approaches). During NREM sleep, the neuro-modulation coming from the activating systems drastically decreases, which favors the occurrence of slow δ waves ( − Hz 1 4 ) and sleep spindles ( − Hz 9 12 ) in the thalamus and cortex 1 . This means that, as the animal transits from W to sleep, the higher-frequency cortical patterns (complex signals) decrease, while lower-frequency oscillations (less complex signals) rise (Fig. 3b). As a consequence, the OPs probability distribution becomes less uniform (in other words more predictable). Specifically, we found that strictly increasing or decreasing OP motifs are strongly favored in all ECoG signals, particularly during sleep (Fig. 4), making the remaining OP motifs to appear less frequently.
Surprisingly, we found that NREM's PeEn is larger than REM's PeEn, which contradicts previously reported results 28,29 . However, we showed that as the frequency content of the ECoG varies, the PeEn changes its value. For example, Fig. 3a exhibits that as we down-sampled the ECoG, REM sleep PeEn becomes larger than NREM's PeEn; these low sampling rates are similar to those used in previous studies 28,29 . Moreover, we analyzed the results from the PeEn as a function of the maximum frequency resolution (Fig. 3a) in conjunction with those from the power spectral density (PSD) of the ECoG (Fig. 3b). We observed that the rise in REM's PeEn as the frequency content decreased follows the variations in the PSD. Specifically, REM sleep presents larger power than NREM sleep around and below Hz 120 corresponding to the high frequency oscillations and gamma band oscillations 5,6 . This means that when higher frequencies are cut-off, the PSD slope significantly increases approaching a more uniform frequency distribution, which corresponds to a more complex time-series. These analyses reveal that PeEn results depends on the frequency content of the signal. In particular, REMs temporal complexity resembles W when gamma oscillations are captured by the PeEn.
One of the main differences between W and sleep, is that muscle tone and movements are mainly absent during sleep (specially during REM sleep). In this regard, the power of the higher frequencies of the spectrum is significantly higher during W than during sleep. It is possible that exists a contribution of muscular activity on the ECoG (by volume conduction) on the high frequency bands (> Hz 100 ), as supported by experimental evidence 30 . Hence, the high values of PeEn during W could be determined by the muscle electrical activity (produced mainly by the muscle tone, because epochs with movement artifacts were discarded from the analysis) that inevitably pollutes the ECoG. Nevertheless, the PeEn values remained constant during W following downsampling, in spite of the fact that higher frequencies were bypassed and the contribution from muscle tone became less relevant. Still, more research is needed in order to quantify the weight of the muscle artifact in the PeEn results.
As a final remark, sleep classification is usually performed by visual analysis, or automated spectral methods usually in research contexts. For instance, in rodents methods which employ spectral ratios (such as the theta/ delta ratio) obtained from hippocampal or intra-craneal recordings in rodents, are able to distinguish sleep-wake states 35,36 . Thus, these methodologies rely heavily upon the use of narrow band characteristics of the EEG signal. In contrast, our data suggest that the sleep-wake states differ globally in their time-series complexity as assessed by PeEn. Hence, we suggest that cheap, robust, and reliable sleep monitoring could be achieved by means of PeEn analysis of a single ECoG channel.

Methods experimental animals.
All experimental procedures were conducted in agreement with the National Animal Care Law (No. 18611) and with the "Guide to the care and use of laboratory animals" (8th edition, National Academy Press, Washington DC, 2010). Furthermore, the Institutional Animal Care Committee (ComisiÃşn de Etica en el Uso de Animales) approved the experiments (Exp. No 070153-000332-16), where 12 Wistar adult rats were maintained on a − h 12 light/dark cycle (lights on at h 07: 00 ) with food and water freely available. The animals were determined to be in good health by veterinarians of the institution. We took adequate measures to minimise pain, discomfort, and stress in the animals, and all efforts were made to use the minimal number of animals necessary to obtain reliable scientific data.
Surgical procedures. The animals were chronically implanted with electrodes to monitor the states of sleep and W. We employed similar surgical procedures as in previous studies 5,6 . Anaesthesia was induced with a mixture of ketamine-xylazine ( mg kg 90 / ; mg kg 5 / i.p., respectively). The rat was positioned in a stereotaxic frame and the skull was exposed. To record the ECoG, stainless steel screw electrodes were placed on the skull above motor, somatosensory, visual cortices (bilateral), the right olfactory bulb, and cerebellum, which was the reference electrode (see Fig. 1a and Table 2). In order to record the EMG, two electrodes were inserted into the neck muscle. The electrodes were soldered into a 12-pin socket and fixed onto the skull with acrylic cement. At the end of the surgical procedures, an analgesic (Ketoprofen, mg kg 1 / , s.c.) was administered. After the animals had recovered from these surgical procedures, they were left to adapt in the recording chamber for 1 week. www.nature.com/scientificreports www.nature.com/scientificreports/ and food ad libitum. Experimental sessions were conducted during the light period, between 10 AM and 4 PM in a sound-attenuated chamber with Faraday shield. The recordings were performed through a rotating connector, to allow the rats to move freely within the recording box. Polysomnographic data were amplified (X1000), acquired and stored in a computer using Dasy Lab Software employing Hz 1024 as a sampling frequency and a 16 bits AD converter. The states of sleep and W were determined in 10 s epochs. W was defined as low voltage fast waves in the motor cortex, a strong theta rhythm ( − Hz 4 7 ) in the visual cortices, and relatively high EMG activity. NREM sleep was determined by the presence of high voltage slow cortical waves together with sleep spindles in motor, somatosensory, and visual cortices associated with a reduced EMG amplitude; while REM sleep as low voltage fast frontal waves, a regular theta rhythm in the visual cortex, and a silent EMG except for occasional twitches. An aditional visual scoring was performed to discard artifacts and transitional states.
ordinal pattern encoding. In order to quantify the EEGs' randomness, we encoded the time-series into ordinal patterns (OPs) following Bandt and Pompe method 10 . The encoding involves dividing a time-series, )/ non-overlapping vectors, where ⌊ ⌋ y denotes the largest integer less than or equal to y and D is the vector's length, which is much shorter than the time-series length (  D T ). Then, each vector is classified according to the relative magnitude of its D elements. The classification was done by determining how many permutations are needed to order its elements increasingly; namely, an OP is associated to represent the vector's permutations. For example, for = D 2, the time-series would be divided into vectors containing two consecutive values, such as { . These vectors have only two possible OPs for any time t i : Randomness quantification. Shannon entropy (SE) is a quantity used in Information theory to quantify the average randomness (information content) of a signal. It is defined as 15 , where α p( ) is the probability of finding symbol α in the signal (among the set of symbols S) and the summation is carried over all possible symbols. In other words, SE shows that H S ( ) is the average value of p log(1/ ) with respect to an alphabet S. Hence, in order to find H for any real-valued time-series, we need to transform the time-series into a symbolic sequence. When using OPs, the resultant symbolic sequence has a finite number of symbols; i.e., the alphabet, which is given by the OP's length D and holds = D S ! #{ } possible symbols. For bin histograms, the number of possible symbols depends on the number of bins, N b , used to create the time-series histogram, which is another way of encoding any bounded time-series into a finite set of values. In order to compare entropy values coming from OPs or bins, we need to set both quantities such that the probabilities involved in the summation of H S ( ) are found with identical statistics. For example, when using non-overlapping OPs with = D 3, there are = D! 6 possibly different symbols in an encoded time-series of length T , which accounts to ~T D / total encoded symbols.
We highlight that the number of bins we chose corresponds to making an amplitude encoding that has the same statistical average as the OP encoding with dimension, D. Namely, a signal with T time-stamps, is encoded by non-overlapping OPs into a symbolic sequence of length   www.nature.com/scientificreports www.nature.com/scientificreports/ On the other hand, the statistics for each ECoG PeEn calculations were based on non-overlapping windows of is the statistical average we use for our null-hypothesis. Namely, our null-hypothesis is a Bernoulli process where each ordinal pattern of size D has an equal probability of appearance, . × − 2 64 10 2 , which makes its confidence interval σ ± p 2 NH NH narrow and the statistical significance of the PE results robust. In general, given an embedding dimension D, any time-series with T data points is analysed using non-overlapping windows with × × D D N ! S data points. OP probabilities -as well as the corresponding PeEn value -are found for each of the × × T D D N / ! S data windows and then averaged (namely, results are time-averaged).
For the state comparisons, we verified that PeEn distributes normally through Lilliefors test, and then applied a repeated measures ANOVA together with the Bonferroni post-hoc test and < .
p 0 05 in order for the result to be considered significant.

Data availability
Data is available upon reasonable request to the authors.