Ethical permissions

The experiments were approved by the Institutional Animal Care and Use Committee of New York University Medical Center IACUC (protocol number: 160926–01), the Ethical Committee for Animal Research (ethical permission numbers: XIV/471/2012 and XIV/218/2016), and the Ethical Committee for Human Research (ethical permission numbers: 98/2013 and 164/2014, for the measurements on cadavers and healthy subjects, respectively) at the Albert Szent-Györgyi Medical and Pharmaceutical Center of the University of Szeged in accordance with European Union guidelines (2003/65/CE).

Experiments on rats

A total of 16 female, 3 male Long-Evans rats (350–450 g, 10–16 weeks old) and 8 male Wistar rats (250–450 g, 8–12 weeks old) were implanted with custom-made recording and stimulating electrodes under urethane anesthesia (1.3–1.5 g/kg, intraperitoneal injection) for the extracellular and the whole-cell patch clamp recording experiments, respectively. Sample size for each experiment was estimated on the basis of anticipated inter-animal neurophysiological variability and the expected high success rate of the experiments in terms of the number of recorded neurons and data quality based on our previous studies. No rats were excluded from the analysis. Each animal served as its own control, no randomization or blinding was employed. Rats were kept on a regular 12 h–12 h light–dark cycle and housed in pairs before implantation. No prior experimentation had been performed on these rats. After anesthesia induction, atropine (0.05 mg/kg, s.c.) was administered to reduce salivation, and the rectal temperature was kept constant at 36–37 °C with a DC temperature controller (TMP-5b; Supertech, Pécs, Hungary). Stages of anesthesia were maintained by confirming the lack of vibrissae movements and nociceptive reflex. Skin of the head was shaved and the remaining fur was completely removed by using depilatory cream.

Recording intracerebral electric fields in anesthetized rats

To record the stimulus-induced intracerebral electric fields, the skin was retracted after a mediosagittal incision, and the bone surface was cleaned and dried as described before51. Two strips of three custom-molded silicon pockets (2-by-2-by-1 mm, 4 mm2 surface area, 1.2 mm spacing) were glued onto the temporal bone bilaterally, and a single pocket above the prefrontal bone (2 mm anterior from bregma in the midline) using cyano-acrylic glue. Pockets were filled with conductive paste (Super Visc, Brain Products, Germany) and then sealed with silicon. An Ag/AgCl reference electrode was placed in the subcutaneous space behind the neck. Thirty holes (0.5 mm diameter) were drilled in the skull and a custom-made 6 × 5 recording electrode matrix was inserted into the brain 3 mm deep below the brain surface (Fig. 1a). The spacing between the individual electrodes was 2, 1.7, 2.2, 1.7, and 2 mm in the x axis and 2 mm in the y axis. Each recording electrode was made by a polyurethane-insulated, copper–nickel wire (50 µm diameter) inserted into a supporting polyimide tube (70 µm interior diameter, 86 µm outside diameter).

Subcutaneous tACS was performed in voltage controlled mode, generated by an STG4008–16mA (Multi Channel Systems, Reutlingen). To monitor the applied current, a 100 Ω resistor was placed in series with the stimulating electrodes and the voltage drop were measured across the resistor by an isolation amplifier circuit to preserve the ground-independent stimulation configuration. The prefrontal electrode was used as an anode and the lateral ones served as cathodes. Varying frequencies (10, 20, 50, 100, 200, 500, 1000, and 2000 Hz) at 3 V were delivered through the stimulating electrodes paired in various configurations. Recorded signals (n = 30 channels) were amplified (10× gain) and stored after digitization at 20 kHz sampling rate per channel (RHD2000 Evaluation System, Intan Technologies, Los Angeles).

Measuring the spatial selectivity of focused ISP in vivo

Two custom-designed (AutoCad, San Rafael, CA, USA) stimulation strips were 3-D printed (Form 1+, Formlabs, Somerville, MA, USA) and glued bilaterally on the surfaces of the temporal bones of the rats by cyano-acrylic glue (Loctite, Henkel). Each of the two symmetric strips (width 13 mm, height 3.3 mm, and wall thickness 0.7 mm) consisted of five individual pockets which were separated from each other by 3.7, 2.2, 2.2, and 3.7 mm (Fig. 2b), and their medial surfaces were resembling the temporal bone curvature of a magnetic resonance imaging (MRI) data-based 3D model of a rat skull. The middle pockets were positioned at 5.16 mm posterior from bregma. The pockets were filled with conductive paste through filling holes left open at the top (Super Visc, Brain Products, Germany) and then sealed with silicon. Craniotomies were drilled (2.2 mm diameter) and two silicon probes (Buzsaki32-H32; NeuroNexus, Ann Arbor, MI, USA) were implanted at 5.16 mm posterior from bregma and 4 mm lateral of the midline, in the CA1 region of the hippocampus. The hole around the probes was filled with non-conductive silicon (Dow Corning®, Midland, MI, USA). Proper locations of the electrodes were confirmed by the characteristic electrophysiological landmarks of the broadband signal at the pyramidal layer of CA1. ISP stimulation was performed in a voltage-controlled mode using phototransistor-based custom-made electronics described below.

Comparing the effect of TES and ISP stimulation

To compare the effects of ISP and DC stimulation in rats, the same surgery procedure was applied but the stimulation was performed in current-controlled mode (stimulus intensity 200 µA) using the high-speed analog switch-based circuits described below. The recorded signals (n = 64 channels) were amplified (400× gain) and stored after digitization at 20 kHz sampling rate per channel (KJE-1001, Amplipex, Szeged, Hungary). We repeated the same measurements on one awake, freely moving animal4.

Comparing transcutaneous and subcutaneous stimulation

For transcutaneous electrical stimulations, a pair of silicon single-pocket electrodes filled with conductive EEG gel was glued on both sides of the head of the rats, as described above (Fig. 1c). Small incision on the scalp was then made for craniotomy after subcutaneous lidocaine injections. Small craniotomy was drilled (1.2 mm diameter) and a silicon probe (Buzsaki32-H32; NeuroNexus, Ann Arbor, MI, USA) was inserted in the axis of the stimulating electrodes at 3 mm posterior from bregma and 2 mm lateral of the midline, into the CA1 region of the hippocampus. A 50-µm insulated wire electrode (California Fine Wire, Grover Beach, CA, USA) was attached 1.2 mm away from the fourth shank serving as a reference electrode. The hole around the probe was filled in with silicon (Dow Corning®, Midland, MI, USA).

After the transcutaneous stimulation, the silicon probe was removed and the skin was retracted and another set of silicon pocket electrodes were attached onto the temporal bone, as described above. The silicon probe was inserted again at almost the same location (2.8 mm posterior from bregma and 2 mm lateral of the midline).

Varying frequencies (10, 100, and 1000 Hz) at varying amplitudes (10, 20, 50, 100, and 200 µA) were used for both settings in current-controlled mode (STG4002; Multi Channel Systems, Reutlingen, Germany).

The recorded signals (n = 32 channels) were amplified (400× gain) and stored after digitization at 20 kHz sampling rate per channel (KJE-1001, Amplipex, Szeged, Hungary).

Measuring the effect of postmortem age

Rats were implanted with a pair of silicon pocket electrodes as described above. Twelve holes (0.5 mm diameter) were drilled in the skull and a custom-made 6 × 2 recording electrode matrix was inserted into the brain. The spacing between the individual electrodes was 2, 1.7, 2.2, 1.7, and 2 mm in the x axis and 2 mm in the y axis. The electrode matrix was inserted at 3 mm depth in the brain and the craniotomies were filled with silicon (Dow Corning®, Midland, MI, USA). Once the silicon dried, the whole skull was covered by dental cement (Duracryl™ Plus, Spofa Dental, Jičín, Czechia) and the skin was closed by sutures to restore its conductive integrity. Subcutaneous tACS was performed in voltage-controlled mode using various stimulation parameters as described above (STG4002; Multi Channel Systems, Reutlingen, Germany).

After the in vivo measurement, the rats were euthanized by sodium pentobarbital (150 mg/kg, intraperitoneal injection). The corpses were kept at 4 °C after death in plastic bags to prevent desiccation. Subcutaneous tACS and recordings were repeated on postmortem day 1, 2, 3, 4, and 5. In one case, the implantation was done 5 days after the euthanasia, which resulted in qualitatively and quantitatively similar results (data not shown).

In vivo whole-cell patch clamp recordings

A pair of silicon pocket electrodes filled with conductive EEG gel were glued bilaterally on the skin or on the temporal bone of rats for transcutaneous and subcutaneous stimulation, respectively, similarly to extracellular recording experiments (Fig. 1c). A small craniotomy (~2 mm diameter) was made 5.0 mm posterior from the bregma, 4.0 mm lateral of the midline. Patch-pipettes were made from borosilicate glass capillaries (GC150TF-10; Harvard Apparatus, Holliston, MA, USA) and their tip resistance were 5–7 MΩ when filled with an intracellular solution: (in mM) 135 K-gluconate, 10 HEPES, 10 Na 2 -phosphocreatine, 4 KCl, 4 ATP-Mg, and 0.3 GTP-Na 3 (pH = 7.25, 290 mOsm). Liquid junction potential calculated as +18.6 mV was offline-compensated. The patch-pipettes attached to a fine stepper motor manipulator were lowered perpendicularly and blind in vivo whole-cell recordings from cortical neurons (0.5–1.3 mm from the pia) were obtained as previously described52. Recordings were performed using an EPC10 USB amplifier (HEKA Elektronik, Lambrecht/Pfalz, Germany) with PATCHMASTER software (ver. 2.901 HEKA Elektronik). Signals were filtered at 3 kHz and digitized at 20 kHz. The pipette capacitance, membrane capacitance, and series resistance were compensated. If series resistance varied more than 20% or increased above 50 MΩ, the data were discarded. Isolated direct constant current stimuli (~ ±800 µA) were delivered via a multifunction stimulator (STG4002; Multi Channel Systems, Reutlingen, Germany). After the whole-cell transmembrane potential recordings, the recorded neurons were detached from the pipette with retraction and positive pressures. After retraction, the artifacts of the same set of electrical stimuli applied during the whole-cell recordings were recorded extracellularly. The recorded artifacts were subtracted from intracellularly recorded potentials to recover the true transmembrane potentials25. Finally, a 4-shank 32-channel silicon probe (Buzsaki32-H32; NeuroNexus, Ann Arbor, MI, USA) was inserted in the vicinity of the recorded neuron to record extracellular electrical gradients in response to the same stimulation as during intracellular recordings. The extracellular recordings were performed at 20 kHz sampling rate using a KJE-1001 amplifier (Amplipex, Szeged, Hungary).

Measurements on human cadavers

Recordings were performed at the Department of Pathology, Faculty of Medicine, University of Szeged. Medical history of cadavers was consulted in advance and only those with no known brain disorder were selected for measurements. The corpses were kept at 4 °C after death in plastic bags until autopsy to prevent desiccation. The autopsy theater temperature was 22 °C. The routine medical autopsy procedure was done on the same day as experimental measurements. The sample size required (number of cadavers and recording sessions) was extrapolated from the results of animal studies. There was no blinding or randomization employed. No cadaver was excluded from the analysis.

Recording tACS-induced intracerebral electric fields

The scalp was cut along the coronal plane connecting the mastoids. The anterior and posterior halves of the scalp were retracted forward and backward, respectively, until the supraorbital ridge and the occipital protuberance was revealed. The temporal muscles and soft tissue were also removed. After the skull was cleaned, the head was fixed in a custom-made acrylic glass frame (Supplementary Figure 3). The top of the skull was pushed against the acrylic frame as close as possible. Four stainless-steel screw bars (6 mm diameter, 10 cm length) held the head steady on each side. One end of the screw bar was attached to the tower by a hexagonal nut, the other end held a rubber ring (3 cm diameter) against the skull. Once the head was positioned, the positions of the 36 penetration holes were marked by an ink-filled needle through the pre-made hole-matrix of the plexiglass back panel. The frame was removed and holes were drilled (1.2 mm diameter) and rinsed by physiologic saline. The frame was placed back to its original position, and the head was repositioned by the screw bars. Four or seven pairs of stimulation electrodes (Ag/AgCl EEG electrodes, 10 mm diameter, Ambu, Copenhagen, Denmark) were placed between the rubber rings and the skull surface with conductive paste (Ten20, D.O. Weaver, Aurora, CO, USA). Custom-made multiple-site electrodes were prepared as follows: three to seven holes were drilled on the outer surface of a translucent polyimide tube (724 μm internal diameter, 775 μm outside diameter). Three to seven 127-μm diameter, polyurethane-insulated, copper–nickel wires were threaded into the polyimide tube through these holes space 1 cm from each other. The wires were secured by a drop of cyano-acrylic glue at the side-holes of the polyimide tube and the other end of it was soldered to a connector socket. The tubes were backfilled with epoxy glue to increase stiffness. Once the epoxy dried, the wires were cut back at the surface of the polyimide tube, and the tip of the tube was sharpened. Impedances of the contact sites varied between 50 and 300 kΩ at 1 kHz. Electrodes were inserted into the brain through the previously drilled skull holes and the matching plexiglass matrix while rotating continuously, to preserve parallel alignment.

A needle was inserted through the skull above the prefrontal cortex and served as reference electrode. Physiologic saline solution (2–5 ml) was injected through the same hole to refill the cerebrospinal fluid lost during the drilling procedure. Recording electrodes made a watertight seal in the skull holes, thus further leakage was not significant. The chest wall was used as grounding. Subcutaneous (electrodes placed on the skull surface) alternating and direct current stimulation was performed using stimulation signals generated by either an STG 4008–16 mA (Multi Channel Systems, Reutlingen) or an NI 6343 board (National Instruments) with precision isolation amplifier circuits. The floating (cadaver) side of the isolation amplifiers were powered using two 9-V batteries for each stimulator pair. To monitor the applied current, a 100-Ω resistor was placed in series with the stimulating electrodes and the voltage drop across the resistor was measured by an isolation amplifier circuit. The stimulating electrodes of the two sides were paired using different parallel or diagonal arrangements. Sinusoid stimuli with varying intensities (1, 2, 3, 4, 5, and 6 V) at 10 Hz and varying frequencies (5, 20, 50, 100, 200, 500, 1000, and 2000 Hz) at 5 V were used for at least 200 cycles, each. To mimic the effect of increasing electrode sizes, multiple stimulating electrodes were coupled together. In some cases, an additional stimulation electrode was placed in the midline of the forehead, and used against a selected lateral electrode to achieve a fronto-lateral stimulation configuration. The recorded signals (n = 198 channels) were amplified (10× gain) and stored after digitization at 1.6 kHz sampling rate per channel by a custom-designed circuit (for DC coupled recordings) or at 20 kHz sampling rate per channel by another custom-designed recoding system based on the RHD2000 Evaluation System (for AC coupled recordings, 0.1–6 kHz bandwidth, Intan Technologies, Los Angeles, CA, USA).

Recording tDCS-induced intracerebral electric fields

Instead of the above-mentioned electrode matrix, six custom-made single contact Ag/AgCl electrodes were introduced in the fourth coronal plane in 2 cadavers. A silver wire (400 µm diameter) was inserted into a translucent polyimide tube. The contact sites were cleaned by scratching with a razor blade and then immersed into NaOCl (42 g/l) for 16 h. The same recording system was used to acquire signals (10× gain, 1.6 kHz sampling rate per channel). All stimulating electrode pairs were active simultaneously and anodal or cathodal stimulation was applied for 50–50 s (5 V intensity).

Measuring the shunting effect of the skin and skull

Instead of retracting the skin, four or six 5-mm long incisions (15 mm apart from each other) were made on both sides of the sagittal suture in the coronal plane, connecting one mastoid with the other. To prevent soft tissue damage, the drilling head was used through a metal tube (1.3 mm diameter) and four holes were made. Then stimulation electrodes (n = 4, Ag/AgCl, Ambu, Copenhagen, Denmark) were attached to the skin by conductive paste (Ten20, D.O. Weaver, Aurora, CO, USA). Four or six custom-made 7 contact site recording electrodes were inserted into the brain, transcutaneous alternating current stimulation was performed, as described above. The recorded signals (n = 28 or 42 channels) were amplified (10× gain) and stored after digitization at 15 kHz sampling rate per channel (RHD2000 Evaluation System, Intan Technologies, Los Angeles, CA, USA). After the skin measurements, the skin incisions were carefully connected and the scalp was removed while the recording electrodes were kept in place. The stimulating electrodes were attached to the skull surface and the same stimulation protocol was applied. In separate experiments, to compare the effect of subcutaneous stimulation to intracranial stimulations, in some cases additional stimulating electrodes were placed intracranially, in between the subcutaneous electrodes as follows: the additional skull holes were drilled with incrementally increasing (2, 4 and 8 mm) drill-bit sizes, and externally threaded, hollow plastic dowels (15 mm long, 8 mm diameter, Hettich Furntech, Germany) were introduced in the holes to form an electrical isolation toward the skull. Sponge electrodes with the encapsulated Ag/AgCl plates, soaked in physiologic saline, were glued to the tip of screws, and introduced into the plastic dowels to touch the brain surface.

Registering the anthropometric data of the cadavers

At the end of the measurements, the cranium was opened with an oscillating saw in the line of the stimulating electrodes. After removing the skull cap, the brain was also removed. Anthropometric data of the skull was measured (circumference, sagittal, horizontal, vertical distance, and skull thickness below the stimulating electrodes). After the brain was examined by the pathologist, a 5-g piece of the occipital lobe was removed to measure the water content of the brain tissue by desiccation. As reference, hydration value of living tissue was taken from reference53.

Measurements on human subjects

Human transcutaneous stimulation and recording experiments were performed on healthy subjects (all males, age = 21–66 years). Subjects with short hair were preferably selected, thus including only males was incidental. All subjects gave their informed consent to the experiments. Each subject served as his/her own control; no randomization or blinding was used.

Before performing the ISP stimulation protocol, each subject was briefly exposed to a few seconds of 1 Hz constant current stimulation with increasing intensities (1, 2, 4, and 8 mA) to familiarize them with the expectable subjective experience during the ISP protocol, and to test if any adverse effects are present. The intensity was increased to the next level only if the previous intensity was reported as being well tolerable. In addition to the well documented tingling, burning feeling of the skin and perception of phosphenes11, stimulus intensities above 4.5 mA stimulation induced feeling of horizontal head-movements and horizontal oscillation of the visual and auditory fields at the frequency of the stimulation. All subjective effects were stronger at the beginning of the stimulation and attenuated during the course of stimulation. None of these are considered Serious Adverse Effect or Event by the US Food and Drug Administration54. No aftereffects were reported after any session. Phosphenes were likely induced by current spread through the orbits, whereas vestibular and auditory effects were likely due to the spread of currents through the ear canals.

Considerations of TES effects on human subjects

There are no accepted guidelines about the current limit of either tDCS or tACS24,49,54. The main reason for this is the lack of reliable information about the induced fields in the human brain, and this is what we supply in our cadaver studies. Most TES studies use <2 mA, mainly because this is the threshold where peripheral sensation and phosphenes are typically detected. Other related measures include (1) current density (in A/m2) at the electrode calculated by taking the applied current to a given electrode and dividing by electrode area and (2) stimulation charge (in Coulombs, C) determined by multiplying current by duration. Since the adverse and risk effects of stimulation are related to current density and duration of stimulation (i.e., the total charge or ‘dose’), 1 mA for 10 min, 2 mA for 5 min, and 10 mA for 1 min are considered equivalent from the perspective of charge54, yet these three categories may not be equivalent for subjective side effects or instantaneous direct brain effects. Direct stimulation of the brain via subdural electrodes using 1 ms pulses of 5 mA intensity for several seconds considered to be safe55. The brain-penetrating currents used in our studies remained well below these widely accepted values. One of 19 subjects in the ramp stimulation experiments (Fig. 5) requested to terminate ISP stimulation because of feeling dizzy. For the experiments shown in Fig. 6, we recruited 7 subjects (3 subjects overlapped with the experiments shown in Fig. 5 but were tested several weeks apart). In one of them, the instability of the electrodes was only discovered after the experiments and the results from this subject could not be analyzed due to excessive artifacts.

Stimulation methods

Stimulating sponge electrodes for ISP were prepared from a 2 × 3 × 1.5 cm sponge glued to a 2 × 3 cm copper mesh, and glued to a rubber washer with the sponges inside, keeping approximately 2.5 cm distance between sponges. The rubber washer with the 12 electrodes was soaked in 0.9% saline solution and tightened gently around the head. Conductivity was further improved by putting electrode gel (SuperVisc, EasyCap GmBH, Germany) between the wet sponges and the skin. For abdominal ISP stimulation, the same sponge electrodes were placed around the trunk.

Modeling of current-induced fields

To model the effect of soft-tissue resistivity on intracerebral electric fields, a finite element method model was constructed, and the theoretical values of the electric field inside the brain were calculated for different conditions using Comsol Multiphysics (Comsol, Burlington, MA, USA). Concentric spheres simulated the scalp, skull, cerebrospinal fluid, and brain (Supplementary Figure 9b). Conductivity values were set to 0.465, 0.015, 1.65, 0.3 s/m, respectively17,35. The dimensions of each layer were set to match one of the cadaver’s anthropometric data (8, 5, and 2 mm thicknesses for the skin, skull, and cerebrospinal fluid, respectively, while the brain diameter was set to 142.6 mm). Two virtual stimulating electrodes attached to each side of the head were modeled as conductors of 1 cm2 with the conductivity of copper (5×107 s/m). Induced electric fields were calculated inside the model brain with a virtual 5 × 6 electrodes array, mimicking the experimental setup. Maxwell’s equations were solved within an adaptive mesh of 366619 elements, using a linear solver and a relative tolerance of 1e−6. The effect of skin and soft tissue resistivity change on electric fields was similar to those reported in earlier publications investigating postmortem resistance changes of soft tissues and muscle37,38.

We used a leaky-integrate and fire neuron model to visualize the ISP principle. Extracellular electric fields were derived from in vivo tACS measurements using 1 kHz sinusoid stimuli in the same arrangement as shown on Fig. 1a, but using epidural stimulation with screw electrodes. The directionless electric field intensities (35 mV/mm peak intensity) at each point were converted to intracellularly injected current values by multiplying with a factor (4.5 nA/mV/mm) to mimic transmembrane currents. A dimensionless leaky-integrate and fire neuron model was established in Matlab based on ref. 31. Parameters were set as the following: temporal constant of the membrane = 10 ms; resting membrane potential = −70 mV; membrane resistance = 1 MΩ; spiking threshold = −54 mV; spike peak potential = 20 mV; repolarization level = −80 mV. Extracellular electric field duration = 0.5 ms. The effects of three different magnitude current injections on the firing rate were demonstrated by the leaky-integrate and fire neuron model is illustrated in Fig. 2a.

Electronic circuit of ISP stimulation

For the ISP stimulation approach, both positive and negative leads of the stimulus generators were connected to 12–12 TLP52-4 phototransistors (Toshiba, Japan). Bidirectional, ground-independent conductivity was achieved the following way. Two phototransistors were serially coupled through their emitter and collector, and the input signal from the waveform generator was fed into both the emitter and the collector end of the transistor doublet, through two Schottky-diodes, which allowed current flow only to the appropriate member of the doublet, depending on the polarity of the signal. The common segment of diode, the doublet, was connected to a stimulation electrode on the head. The same circuit was constructed for the other pole of the signal as well. Common driver signal to the infrared emitting diode sides opened all four transistors, but due to the diodes two of them were always floating, while the other two closed the circuit through the head (Supplementary Figure 1a). Six such circuits were used for the six electrode pairs, forming six quadruplets (blocks) of transistors. In rats, only three pairs were used. Blocks were activated in a pseudorandom order by transistor–transistor logic (TTL) pulses generated by a CD74HC4017 Decade counter (Texas Instruments, USA), driven by a 100-kHz TTL generator (ADG3051C, Tektronix, USA).

In sessions employing variable ISP intensities in human subjects, the phototransistors were replaced with ADG412 high-speed analog switches (Analog Devices, Norwood, MA, USA) and the control TTL signals were generated by a PIC18F4525 (Microchip, Chandler, AZ, USA) microcontroller and isolated by ADuM1400 (Analog Devices) digital isolators. This circuit allowed the unrestricted flexible assignment of stimulus polarities to the electrodes. This latter circuitry was also used for the experiments on rats when we compared the spatial effect of ISP and TES pulses.

EEG recording during ISP stimulation

EEG scalp recordings were performed by a 16-channel V-Amp amplifier and ActiCap BP active electrodes (Brain Products GmBH, Germany). Impedances were measured online and adjusted to remain below 20 kΩ by applying electrode gel. Electrodes were placed according to the International 10/20 electrode scheme. The broad dynamic range of the active electrodes, and their buffering capacity allowed the low-noise transmission of EEG signals and stimulus artifacts without on-head amplification. To prevent the saturation of the amplifier, the output range of the active electrodes was matched to the input range of the EEG amplifier through custom-made voltage dividers.

Data processing

The recorded data were analyzed by custom-written scripts in MATLAB (MathWorks, USA). Single unit analyses were performed on the time series of semi-automatically clustered and manually refined unit clusters of extracellular action potential waveforms, as described earlier (PHY56,57). Only well isolated single units were used in the analysis. Units were categorized as putative pyramidal cells or interneurons based on their physiological properties.

To measure the electric field in cadavers and rats, 500 sinus cycles were averaged for each condition and then the peak-to-peak amplitude was measured for each channel. The first spatial derivative of these voltage signals was calculated .

In the silicon probe experiments, we measured the impedance of all contact sites at 10, 100, and 1000 Hz (Intan recording software, Intan Technologies, Los Angeles) and excluded those channels whose impedance values were higher than 2 MOhm: 500 sinus cycles were averaged for each condition and then the peak-to-peak amplitude was measured for each channel and a mean shank voltage was computed. Finally, we calculated the first spatial derivative of these potential values.

Statistical tests

Unless otherwise noted Student’s paired t-test with Bonferroni correction was used for pairwise data comparison, Pearson’s linear correlation was calculated for correlation analyses and mean ± SEM values are displayed with the full data sets superimposed. Data with non-normal distribution are reported as median and interquartile range (IQR). Boxplots with whiskers denote the medians, interquartile ranges, and full ranges. For data sets with non-normal distribution, non-parametric tests were used instead. Welch’s correction was applied when variances were not equal. To preserve visibility of the figure panels, significance levels of <0.05, <0.01, and <0.005 are marked by one, two, or three asterisks, respectively. For simplicity, P values smaller than 0.001 are reported as <0.001 instead of stating the absolute value. The detailed conditions, numeric results, and effect sizes of the statistical comparisons are listed in the Supplementary Results.

Analysis of whole-cell patch clamp recordings

To remove the stimulation artifacts, after retracting the patch-pipettes, the artifacts of the same set of electrical stimuli applied during the whole-cell recordings were recorded extracellularly. The recorded artifacts were subtracted from the intracellularly recorded potentials to recover the true transmembrane potentials25. Power spectra of the stimulated and control epochs were calculated on a trial-by-trial basis, using fast Fourier transform, before averaging. Spectra were whitened by the 1/f method.

Noise removal and analysis of EEG activity

The stimulus artifact was removed offline by subtracting a triggered moving average (t = 10 epochs), followed by triple-sweeps of 100th order zero phase-lag high-pass finite impulse response filter (f = 2 Hz) in MATLAB.

For analyses performed on the time domain (e.g., alpha amplitude) the artifact-free signal was filtered in the alpha band with a zero phase-lag fourth-order Butterworth filter. Instantaneous alpha amplitudes were determined by calculating the magnitude of the Hilbert-transformed filtered signal, and binned based on the corresponding ISP amplitude and phase. Binned values were averaged across epochs. To estimate the amplitude of the remaining electrical noise time locked to the epochs, signal was first averaged across epochs, and then Hilbert transformed. This approach preserved time-locked features. For frequency domain analyses, spectral amplitudes were calculated using fast-Fourier transformation, and smoothed using a moving average filter (width = 2 Hz). 120–140 Hz was chosen as a control frequency band, as this range does not represent measurable physiological oscillatory signals on the scalp but would still mirror the presence of broadband electrical artifacts. For time-resolved spectral analysis, spectra were calculated using a multitaper fast Fourier transform on 1-s long consecutive segments. Spectra were whitened by multiplying each frequency by the frequency value (1/f method).

Frequency-amplitude and phase-amplitude analysis of EEG

We employed two complementary analyses to assess the modulation of EEG amplitude by the phase of the sinusoidal ISP stimulation current. Analyses were performed on 1-min-long consecutive epochs, and the epoch results were pooled. First, we applied the complex wavelet transform using Morlet mother wavelets to calculate the amplitude and phase for a wide range of EEG frequencies. Wavelet amplitudes were calculated from 1 to 30 Hz at 59 levels from the artifact-free EEG and wavelet phase for 21 levels from 0.5 to 5 Hz at 15 levels from either the original EEG or a synthetic signal constructed from the stimulation pulses. Phase–amplitude cross-frequency coupling was quantified using a modulation index (MI58). To quantify frequency–amplitude modulation, 2-D comodulograms were constructed with the MI values for every phase–amplitude frequency pair and the maximal MI in the band of interest was detected59. For phase–amplitude modulation, phase time-series were binned into phase intervals and the mean wavelet amplitude was calculated for each of them and z-scored. Phase time-series were binned into phase intervals and the mean wavelet amplitude was calculated for each of them59.

For a complementary phase–amplitude analysis performed on the time domain, the estimated peak-to-peak amplitude values of the individual alpha waves were binned based on the actual stimulus phase, and alpha amplitude values during the stimulus peak and trough bins (45, 90, 135, 225, 270, 315°) were compared to the alpha amplitude values present at the transitional phase (0° and 180°) bins using a t-test.

Data availability

The data sets generated and analyzed during the current study are available upon reasonable request from the corresponding authors for further analyses.