Sleep promotes consolidation in several memory systems in humans and rodents. The cortical sleep slow oscillation (SO) occurring during slow wave sleep provides a temporal time frame for the hippocampal-neocortical dialog which is assumed to be crucial for long-term storage of memories in neocortical networks . Studies on sleep-related rhythms have shown that oscillating weak electric fields can entrain neuronal activity to the applied frequency, being most effective if matching in frequency to the prevailing endogenous rhythms [2, 3]. Stimulation at the frequency of endogenous SO during non-rapid eye movement (NREM) sleep not only boosted endogenous SO activity, but also improved memory consolidation for a hippocampus dependent task [4, 5].
The subject-dependent SO frequency fSO is typically determined from the spectrum of a baseline electroencephalographic (EEG) recording. Stimulation with this SO frequency is performed manually during a stable phase of NREM sleep. Identifying these NREM phases requires visual monitoring of the ongoing EEG recordings. Thus, manual in-phase stimulation of slow oscillations is time-consuming, labor-intensive and error-prone. Here, we present a novel method for closed-loop tACS of slow oscillations using a custom built stimulation device.
2 Material and methods
2.1 Offline detection of slow oscillations
In offline analyses, slow oscillations are identified after low-pass filtering the recorded EEG signal. Commonly, filtering is performed in forward and backward direction to avoid phase shifts in the data. An automatic threshold algorithm is then applied . If the following three criteria are fulfilled, the peak time of a negative half-wave is accepted (Fig. 1A): (1) Two succeeding zero-crossings (ZC) of the filtered EEG signal are separated from each other by a given period (e.g. 0.2 to 1.0 s), (2) A peak amplitude between both ZC exceeds a given threshold (e.g. -80 μV), and (3) The negative-to-positive peak-to-peak amplitude exceeds a given threshold (e.g. 120 μV).
2.2 Online SO detection and stimulation
For the closed-loop stimulation, this threshold algorithm had to be adapted to online detection. The recorded EEG is low-pass filtered on-the-fly. For minimal phase shift, a finite impulse response (FIR) filter is used. For a given signal (or time series) x(t) the output of a FIR filter f at some point i incorporates the values x (i), x (i + 1), . . ., x (i + ℓ), where ℓ is the length of the FIR filter, i.e. the filter output fi corresponds to the signal input x (i + ℓ). This filter induced delay has to be considered in the following steps of the online SO detection method (Fig. 1B): (1) A positive-to-negative ZC is detected. (2) If the signal exceeds a given threshold, the current event is marked as a preliminary SO. (3) The following negative-to-positive ZC is detected. If the time period between both ZC is within a given range, the preliminary SO is confirmed and the frequency fSO of that oscillation is estimated.
For entrainment of slow oscillations, stimulation should be in-phase with the endogenous SO , e.g. with the rising part of the SO. But, with respect to the delay caused by the FIR filtering, the stimulation actually cannot start at that point. Thus, the output signal has to be initialized with some precomputed value at the correct point (Fig. 1B, dashed line).
2.3 Stimulation device
The stimulation device (Fig. 2) is based on a Spartan®-6 (Xilinx Inc., San Jose, CA) FPGA (field programmable gate array) serving as master control unit. Acquisition of EEG signals is done by an ADS1291 (Texas Instruments Inc., Dallas, TX) 24-bit, delta-sigma ADC (analog-to-digital converter). The tACS is performed by isolated, electronically configurable Howland current sources based on AD5667R (Analog Devices Inc., Norwood, MA) 16-bit DACs (digitalto-analog converter). A global AFSL1 (Abracon LLC., Rancho Santa Margarita, CA) 32 MHz clock synchronizes the input and output components on the custom built PCB (printed circuit board). Electrical and electronic safety is ensured by (a) an ADuM4160 (Analog Devices Inc.) 5 kV reinforced USB isolator to the host computer and (b) LTM2883 (Linear Technology Corporation, Milpitas, CA) 2.5 kV isolators for each stimulation channel .
After A/D conversion of the analog input EEG signal recorded from the subject, digital time-tagged EEG data is processed by the FPGA. The described procedure for the online SO detection and closed-loop stimulation is performed. After identifying a SO, the output signal is generated, e.g. a sinusoidal waveform of the corresponding SO frequency. The digital output values are sent to the current sources. After D/A conversion, the current is applied to the subject.
Simultaneously, the FPGA communicates with an external computer. For later analysis, the recorded and generated data is stored there. The control software is also located on the external computer to save computing power on the stimulation device. Both tasks are not time-critical, such that possible delays are acceptable.
3.1 Artificial data
The proposed online SO detection method was tested on several artificial data. As an exemplification, Fig. 3A shows a 15 second epoch of white noise. Five sinusoidal waves were added to mimic slow oscillations. Their corresponding frequencies are 0.6 Hz, 0.8 Hz, 1.5 Hz, 2.2 Hz, and 2.4 Hz. The aim was to identify slow oscillations with frequencies between 0.7 and 2.3 Hz. The threshold for the negative peak was set to 0.2 (arbitrary unit here).
The results after processing the online SO detection method, which also includes the low-pass filtering, are shown in Fig. 3B. Both the 0.6 Hz wave and the 2.4 Hz wave have been neglected, whereas the three other waves were correctly identified (Fig. 3B, red dots). How well this distinction can be done, depends on the desired SO frequency range and the sampling rate. For example, when using 0.7 Hz as the lower limit for signal detection and 1 kHz as sampling rate, the corresponding duration of a half-wave should not exceed 1000/0.7/2 π 714 samples. So, detecting 0.6 Hz and 0.8 Hz waves is simple, since the corresponding half-wave durations are about 833 samples and 625 samples. This margin is smaller for the upper limit of 2.3 Hz with a half-wave duration of about 217 samples. The corresponding values for 2.2 Hz and 2.4 Hz are 227 samples and 208 samples.
3.2 Experimental data
The presented system is currently used in experiments investigating the sleep dependent memory consolidation in rodents. Results are to be compared with those previously obtained without closed-loop stimulation .
Preliminary analyses of the recorded data show a promising performance of the online SO detection method also in experimental data. Fig. 4A shows a 22 second epoch of EEG recording. Three stimulations were triggered, each with three sinusoidal oscillations. When investigating the signal right before the stimulation starts (Fig. 4B and 4C), the specificity of the detection method regarding the desired SO frequency range is evident. In Fig. 4B, the first two negative half-waves are too short, and in Fig. 4C, the first half-wave is too long (each marked red) for the desired SO frequency range. For the half-waves in range (marked blue), the stimulation is triggered.
Extensive cross-validation against expert scoring of slow oscillations of the experimental data is still work in progress.
3.3 Electrical measurements
The signal-to-noise ratio (SNR) and the total harmonic distortion (THD) are measures to confirm the quality of the device’s electronics. The SNR and THD of the whole implementation were determined in a closed-loop setup, i.e. the generated output was fed back to the input. The measured SNR and THD, and thus the input-to-output signal distortions are both less than -80 dB.
4 Discussion and conclusion
We presented a promising approach for the closed-loop transcranial alternating current stimulation of slow oscillations. The proposed detection and stimulation method is easy to implement and computationally inexpensive. Other detection procedures, for example incorporating machine learning techniques, are likely to be too complex to be used in real-time applications. Also, the algorithm resembles the well-studied offline SO detection method, such that existing SO descriptions can be used.
The current implementation performs well on artifi-cial as well as on preliminary experimental data. The electronics incorporated in the stimulation device were extensively tested and proved their high quality.
Results from this project are integrated into the development of a novel electronically configurable multi-channel stimulation device for focal tACS . Studies on human subjects demonstrating the proposed effects are currently planned.
Funding: This work was partially supported by the Priority Program 1665 of the German Research Foundation (DFG SPP 1665).
Conflict of interest: Authors state no conflict of interest. Material and Methods: Informed consent: Informed consent has been obtained from all individuals included in this study. Ethical approval: The research related to animals use has been complied with all the relevant national regulations and institutional policies for the care and use of animals.
Mölle M, Yeshenko O, Marshall L, Sara S, Born J. Hippo-campal Sharp Wave-Ripples Linked to Slow Oscillations in Rat Slow-Wave Sleep. J Neurophysiol 2006; 6: 62–70.
Marshall L, Kirov R, Brade J, Mölle M, Born J. Transcranial Electrical Currents to Probe EEG Brain Rhythms and Memory Consolidation During Sleep in Humans. PLoS ONE 2011; 6: e16905.
Ozen S, Sirota A, Belluscio MA, et al. Transcranial Electric Stimulation Entrains Cortical Neuronal Populations in Rats. J Neurosci 2010; 30: 11476—11485.
Marshall L, Helgadottir H, Mölle M, Born J. Boosting Slow Oscillations During Sleep Potentiates Memory. Nature 2006; 444: 610–613.
Binder S, Berg K, Gasca F, et al. Transcranial Slow Oscillation Stimulation During Sleep Enhances Memory Consolidation in Rats. Brain Stim 2014; 7: 508–515.
Fröhlich F, McCormick DA. Endogenous Electric Fields May Guide Neocortical Network Activity. Neuron 2010; 67: 129–143.
Wilde C, Bruder R, Binder S, Marshall L, Schweikard A. Towards Closed-Loop Transcranial Alternating Current Stimulation. 87th Conference of the German Society of Neurology 2014; Munich, Germany.
Bruder R, Wilde C, Trillenberg P, Binder S, Marshall L, Schweikard A. An Electronically Configurable Multi-Channel tACS Device. 88th Conference of the German Society of Neurology 2015; Düsseldorf, Germany (accepted).