# Monitoring Brain State and Behavioral Performance during Repetitive Visual Stimulation
## 2 Materials and Methods
### EEG Recording  
For registration of EEG signals, a monopolar method and a classical extended 10-10 electrode scheme were used. We recorded signals from 31 channels using an electrode cap, with two reference electrodes on the earlobes (\(A1\) and \(A2\)) and a ground electrode \(N\) above the forehead. Ag/AgCl cup adhesive electrodes placed on the \"Tien-20\" paste (Weaver and Company, Aurora, CO, USA) were used for signal acquisition. Immediately before the experiments, a special abrasive \"NuPrep\" gel (Weaver and Company, Aurora CO, USA) was applied to the electrode attachment areas to increase skin conductivity. We maintained the impedance values in the range of 2-5 k\(\Omega\). For registration, amplification, and analog-to-digital conversion of the EEG signals, we used a multichannel electroencephalograph \"Encephalan-EEG-19/26\" (Medicom MTD company, Taganrog, Russian Federation) with a two-button input device (keypad). This device holds the registration certificate from the Federal Service for Supervision in Health Care No. FCP 2007/00124 of 07.11.2014 and European Certificate CE 538571 from the British Standards Institute (BSI).  
The raw EEG signals were filtered by a fourth-order Butterworth (1-100)-Hz bandpass filter and a 50-Hz notch filter with built-in acquisition hardware and software. In addition, we performed an independent component analysis (ICA) to remove eye blinking and heartbeat artifacts. To determine components with artifacts, we examined their scalp map projections, waveforms, and spectra. The components containing eye-blinking artifacts usually had leading positions in the component array due to high amplitude. They demonstrated a smoothly decreasing spectrum, and their scalp map showed a strong far-frontal projection. Finally, eye-blinking artifacts had the typical waveform; therefore, those segments of EEG signals were marked by the experienced neurophysiologist, and used for determining the corresponding independent components.  
We then segmented the EEG signals into 4-s trials, where each trial was associated with a single presentation of the Necker cube, and included a 2-s interval before and 2-s interval after the moment of the stimulus demonstration. After the EEG pre-processing procedure, we excluded some trials due to the remaining large-amplitude artifacts. To exclude trials containing large amplitude artifacts, we used the \(z\)-value threshold \(z<1\). The rejection procedure was performed using FieldTrip toolbox in Matlab [21].  
After all preprocessing procedures, we had \(52\pm 11\) SD trials for the interval 1, \(47\pm 11\) SD trials for the interval 2, \(47\pm 11\) SD trials for the interval 3, and \(55\pm 11\) SD trials for the interval 4. We calculated the wavelet power for each trial in the (4-40)-Hz frequency range using the Morlet wavelet, and the number of cycles \(n\) was defined as \(n=f\), where \(f\) is the signal frequency. Finally, we computed the event-related spectral perturbation (ERSP) by normalizing the wavelet power estimates \(W\) to the wavelet power of 40-s resting-state EEG as \(ERSP=(W-W_{rest})/W_{rest}\). All processing procedures were performed offline.  
Our goal was to study how the participant's state changed in the course of the experiment, regardless of the type of stimulus. Therefore, we measured brain activity before the start of the stimulus presentation (1.5-s prestimulus interval, TOI1 in Figure 1D).