Full-Band EEG Recordings Using Hybrid AC/DC-Divider Filters

Visual Abstract

Full-band DC recordings are the gold standard for exploration of infra-slow activity (Vanhatalo et al., 2005b;Dreier et al., 2017). However, in keeping with the powerlaw rule, infra-slow activities typically have larger amplitude than activity in fast frequency bands (Buzsáki and Draguhn, 2004). Along with the common problems of large signal offsets and drifts intrinsic to amplifiers and/or caused by poorly controlled electrochemical processes at the electrodes, full-band DC recordings impose the use of amplifiers with large (hundreds of millivolts) input ranges and high-resolution ADC that increases the cost of equipment tremendously. Alternatively, inverse filtering has been proposed for reconstruction of infra-slow electrophysiological signals from AC recordings (Hartings et al., 2009;Abächerli et al., 2016). The accuracy of reconstruction of ultraslow signals and constant DC signals with this approach is limited, however, because of severe attenuation of the signal along with a reduction in frequency that is an inherent feature of RC filters (Fig. 1A,B, RC filter). Neuralynx has proposed improved DC signal transfer by using a resistance (DC-divider) introduced in parallel to the capacitor in the RC filter chain as realized in the input filter of Digital Lynx SX Neuralynx amplifiers (Fig. 1A,B, RRC filter; https://support. neuralynx.com/hc/en-us/articles/360054937932-Hybrid-DC-Coupling-and-Getting-Back-to-Unity-Gain). Digital inverse filtering has further been proposed for reconstruction of full-band signals from recordings obtained using such a hybrid AC/DC-divider filter (Hybrid_Input_compensation_ v.1.0, https://neuralynx.com/software/hybrid-inputcompensation, hereafter referred to as IF NLX . However, the quality of signal reconstruction of biological signals has not yet been assessed. Further, the versatility of the NLX routine is limited by the standard set of inverse filter coefficients, which may vary between channels. Here, we propose a digital inverse filter based on a mathematical model describing the RRC filter, which provides high computational accuracy and versatility, and procedures for the evaluation of the inverse filter coefficients, adapted for each recording channel to minimize the error caused by deviation of the real values of the RRC filter elements from the nominal values. We demonstrate that this approach enables near 99% reconstruction quality of high-potassium induced SDs, endothelin-induced ischemic NUPs, and whole-cell recordings of membrane potential using RRC filters.

Materials and Methods
Amplitude-frequency characteristics of RC and RRC filters The rationale for using RRC filters for full-band recordings and reconstructions is illustrated by Figure 1. Commonly used RC filters for AC recordings (Fig. 1A, top panel) display sharp signal attenuation below the cutoff frequency f C , with the transfer coefficient approaching zero values at zero frequency (DC signal;Fig. 1B,red). The addition of Rc resistance in parallel to the capacitor C of the RC chain (as realized in the input filter of Neuralynx Digital Lynx SX systems) does not affect the transfer coefficient at frequencies above f C , causes smoother signal attenuation at frequencies below f C , and at infra-slow frequencies, the transfer coefficient (k 0 ) approaches a plateau value defined by k 0 ¼ R=ðR1R C Þ ratio. The latter plateau value corresponds to the transfer coefficient of DC signal. Thus, the RRC filter displays hybrid properties operating as a DC-divider at low frequencies and as a standard AC filter at higher frequencies.

Reconstruction of full-band signals through inverse filtering
The complex transfer function (K iv ð Þ Þ for the circuit from Figure 1A, bottom panel, is the following: where i is an imaginary unit and v is an angular frequency. The frequency response (FR v ð Þ) of this filter is described as An inverse filter can be used to reconstruct signals passing through the RRC filter. The reconstruction filter in the Laplace representation for Equation 1 has the following transfer function: where s is a complex number frequency parameter. The filter (Eq. 3) is stable at all frequencies since it has a single negative pole s p (the value of s at which K rec s ð Þ is equal to infinity) described as s P ¼ À1=ðCR C Þ,0. In practice it is convenient to use a digital analog of the filter. By applying the bilinear transform (T is sampling interval and the z-representation of the reconstruction filter (K rec z ð Þ) can be obtained Thus, the numerator and denominator of this equation contain coefficients b 1 ; b 2 ; a 1 ; a 2 used in the digital inverse filter. The bilinear transform was chosen to maintain the stability of the original filter. The error caused by frequency warping introduced by the bilinear transform is insignificant as the filter cutoff frequency is much lower than the sampling frequency. To estimate the frequency response error, we calculated the error function err f TÞtanðp TfÞ describes frequency warping of the bilinear transform. The err value was ,10 À10 through all frequencies. Hereafter, the bilinear transform error will be ignored.

Empirical estimation of the coefficients for the inverse filter
The discrete R and C components of the RRC filter may significantly vary from the nominal values (1-5% is typical) and this is a major concern for reconstruction most critically in terms of phase delay in the middle of the band over which the transfer coefficient is increasing (Fig. 2C). Therefore, it is essential to verify these values to ensure reconstruction quality. The parameters from Equation 5 can be assessed through the analysis of responses to specially constructed signals delivered to the amplifier input. This can be done either by the method described in (Hartings et al., 2009) or by the procedure that follows. None of the three parameters (R, R C , C) can be measured having only the voltage on time dependencies, but it is possible to determine their dimensionless or time-dependent combinations. By using the notations k 0 ¼ R=ðR1R C Þ and t ¼ CR C Equations 2, 5 can be rewritten as where V out1 and V out0 , output voltages during two constant levels V in and 0 with at least 200 s in duration. The duration of the test signal should be selected based on the temporal characteristics of the signal to be reconstructed. This is done to account for the effect of drift over the characteristic time of the signal.
The parameter t defined from Equation 7 as is measured by applying the harmonic signal V inh with amplitude 200 mV and frequency f = 0.1 Hz (for the Neuralynx amplifier). This frequency should correspond to the average value between the stopband and passband levels of the frequency response (indicated as f Test in Fig. 1B). To increase the SNR, the amplitudes V inh and V in should commensurate with the input range of the amplifier. We recommend generating signals using a DAC with at least 12-bit resolution. During reconstruction, the exponential transient process of the filter adjustment to the signal offset should be taken into account. This can be bypassed by prerecording a signal with a duration of at least 5t (for ,1% error) or more, or by post hoc addition of estimated values of the offset with the required duration to the start of recorded signal before reconstruction.

Surgery and recordings from animals
The animal experiments were conducted in compliance with the appropriate Animal Research: Reporting In Vivo Experiments (ARRIVE) guidelines. Animal care and procedures were in accordance with EU Directive 2010/63/EU for animal experiments, and all animal-use protocols were approved by the French National Institute of Health and Medical Research (APAFIS #16992-2020070612319346 v2) and the Local Ethical Committee of Kazan Federal University (No. 24/22.09.2020). Wistar rats of both sexes from postnatal day (P)16 to P60 were used. Intracortical recordings were performed on head restrained urethaneanaesthetized (1.2-1.5 g/kg, i.p.) rats as described previously (Nasretdinov et al., 2017). Recordings were performed using 16-channel linear probes with 100-mm separation distance (Neuronexus Technologies) from the Figure 2. Investigation of the RRC filter characteristics using test sine signals. A, Examples of sine signals at frequencies 1 mHz, 0.1 Hz, 4 Hz, and 15 Hz recorded simultaneously by the AC RRC (blue trace) and DC (black trace) channels as well as the result of signal reconstruction via IF EMPIR (inverse filter empirical) from AC RRC recording (orange trace). B, Amplitude ratio of sine signal recorded in AC RRC and DC modes at seven selected frequencies: 1 mHz, 10 mHz, 0.1 Hz, 1 Hz, 4 Hz, 8 Hz, and 15 Hz (red circles) and the amplitude ratio of reconstructed signal relative to the original signal recorded in DC mode (black crosses). C, Phase difference between DC and AC RRC signals (red circles) containing sine signals at the same frequencies as shown in panel B, and the phase difference between DC and reconstructed from AC RRC signals (black crosses).
Open Source Tools and Methods barrel cortex. The probe was inserted to the barrel cortex to a target depth of ;1600-mm SDs were evoked by distant epipial 1 M KCl application above the prefrontal or visual cortex. Signals from the silicone probe were amplified (1000Â) and recorded using a Digital Lynx SX amplifier (Neuralynx) in DC mode after offset compensation (Nasretdinov et al., 2017). SD-initiated NUPs were recorded during 1-h-long local epipial application of the vasoconstrictor endothelin-1 [ET-1; Sigma; 1 mM solved in artificial CSF (ACSF)] followed by 1 h of wash with ACSF (Dreier et al., 2002;Oliveira-Ferreira et al., 2010). Patchclamp recordings were obtained from layer 5 (L5) neurons of the barrel cortex in vivo with borosilicate glass patch pipettes of 5-to 7-MOhm resistance when filled with solution of the following composition: 144 mM K-gluconate, 4 mM KCl, 4 mM Mg-ATP, 10 mM Na 2 phosphocreatine, 0.3 mM Na GTP, and 10 mM HEPES (pH 7.3). Whole-cell signals were recorded using an Axopatch 200B amplifier and acquired using a Digidata 1440A (Molecular Devices), and/or Digital Lynx SX (Neuralynx). All recorded signals were replayed using the Multiclamp 1440A built-in DAC and acquired using a Digital Lynx SX.

Data analysis
Data analysis was performed using custom-written and built-in functions in MATLAB (The MathWorks). Amplitude ratios and phase shifts of sinusoidal signals were estimated using fast-Fourier transform. Signal amplitudes were calculated as the most negative value of LFP after baseline subtraction. Slopes of the signals were calculated from the first LFP derivate. The values in the text are presented as mean value 6 standard deviation. To estimate the quality of reconstruction the percentage root mean square difference (PRMSD) was calculated as For ideal reconstruction, PRMSD = 0. The MATLAB code used for reconstruction is available as Extended Data 1 and online at https://github.com/ Nasazat/Inverse-filter.
For SD reconstruction, the analysis intervals included a short period of control before the SD, the SD itself, and a short fragment after it, in total 100 s for each SD. Data were down-sampled to 100 Hz. SDs from all recordings alternating with zero-containing 30-s periods were merged into one long signal to estimate DAC and ADC offset fluctuations. Also, 3 min of zero-valued signal was added to the beginning of the dataset to eliminate the transient process of the filter.
For SD-initiated NUP reconstruction, each recording consisted of a control period, 1 h of ET-1 application and at least 1 h of ET-1 washout. Data were down-sampled to 10 Hz; 5 min of zero-valued signal was added to the beginning of the dataset to eliminate the transient process of the filter. Hundred-second zero intervals have been also added in between recordings from individual animals.
For whole-cell reconstruction 30-s periods of recordings at 32-kHz sampling frequency were used. At the beginning of each episode, 8 s of zero signal were added.

Theoretical and empirical estimation of the inverse filter coefficients
The mathematical model of the inverse filter assumes that adequate signal reconstruction depends critically on the value of the two coefficients k 0 and t (Eqs. 8, 9). The values of these coefficients can be determined theoretically based on the nominal values of the passive filter parameters according to the equations k 0 ¼ R=ðR1R C Þ and t ¼ CR C . For the Neuralynx RRC filter with values R = 1 MV, C = 1 mF and R C =10 MV, t and k 0 are equal to 10 s and 0.0909, respectively (inverse filter with theoretical coefficients, IF THEOR ). However, the actual values of the filter elements may differ from the nominal values, which should lead to distortions when using an inverse filter. Therefore, we conducted an experimental estimate of t and k 0 (inverse filter with coefficients measured empirically, IF EMPIR ) for each channel of the amplifier. First, a constant voltage of 1 V (V in ) was applied. This value was selected in accordance with the value k 0 = 1/11 to provide a high SNR and to stay within the input range of the amplifier (6131 mV). To estimate the offset, a constant voltage of 0 V was also applied. After ;2 min of prerecording (corresponds to error ,0.001%), the resulting AC RRC recordings were averaged over the flat 200-s intervals and the corresponding V out1 and V out0 values were estimated. The duration of interval for the average (200 s) was selected to minimize the contribution of drift and to provide acceptable reconstruction quality for both SDinitiated NUPs and SDs. Second, a sinusoidal signal of amplitude 200 mV (V inh , to provide a high SNR and to stay within the input range) and frequency 0.1 Hz (Fig. 1B) was applied. The amplitude of the recorded AC RRC signal (V outh ) was estimated using fast-Fourier transform. Coefficients k 0 and t were calculated according to Equations 8, 9, respectively. The experimentally measured values of t for 128 channels of the amplifier varied in the range 9.688-10.650 s (average: 10.087 6 0.204 s), with a deviation from the theoretical value of 10 s by 0.02-6.5% (on average, 1.910 6 1.121%; n = 128). Similarly, the experimentally measured values of k 0 varied in the range 0.0904-0.0922 (average: 0.0914 6 0.0003), with a deviation from the theoretical value of 0.0909 by 0.03-1.38% (on average, 0.54 6 0.33%; n = 128). For all subsequent signal reconstructions using an inverse filter, we used the experimentally determined values of t and k 0 . It should be noted that the proposed experimental technique for evaluating the coefficients of an inverse filter is universal and allows one to evaluate these parameters even in the absence of knowledge of the values of the elements of the RRC filter.

Sine waves
Further, we tested the filter on a series of sinusoidal signals with an amplitude of 50 mV. To estimate amplitude and phase reconstruction we used 5 periods for each frequency (seven values) with total signal duration ;1.5 h.
Signals with different frequencies generated by the DAC were sent simultaneously to the AC RRC and DC channels of the amplifier ( Fig. 2A).
According to the frequency response (Fig. 1B) the RRC filter reduced the amplitudes of sine signals at frequencies of 1 and 10 mHz by 10-to 11-fold. The amplitude of the signal at a frequency of 0.1 Hz decreased by half, while amplitudes of signals with frequencies of 1-15 Hz passed unchanged, although a slight phase shift is still observed for frequencies of 1, 4, and 8 Hz. However, the amplitudes and phases of reconstructed signals did not differ from DC recordings at all frequencies investigated (Fig. 2B,C).

SDs
At the next stage, we investigated the filter with real SD waveforms. SDs were induced by epipial high-potassium solution application at a distance of 4.2 6 1.1 mm from a recorded site in the barrel cortex. SDs appeared firstly in the superficial channels and propagated into the deep layers in keeping with previous studies (Nasretdinov et al., 2017;Zakharov et al., 2019). SDs recorded at a depth of 430 6 110 mm (L2/3) were used for analysis. DC reconstructions were tested on an SD-containing dataset replayed by DAC and recorded by the Neuralynx amplifier simultaneously at two different channels in the DC and AC RRC modes (Fig. 3). Method verification was performed by comparing real-waveform reconstructed signals to signals recorded in DC mode. An example of SD reconstruction is shown on Figure 3A. The error of reconstruction (PRMSD) was 1.11 6 0.11% for IF THEOR and 0.51 6 0.05% for IF EMPIR (n = 9 SDs from 9 animals, p , 0.05, Wilcoxon signed-rank test). SD reconstruction error was significantly higher than when using IF NLX (8.55 6 0.07%; n = 9, p , 0.01, Wilcoxon signed-rank test). After DC reconstruction, SD amplitude returned to 23.0 6 2.6 mV, only 0.7 6 0.1% smaller than the original DC-signal amplitude which was 23.1 6 2.6 mV (n = 9, p , 0.01, Wilcoxon signed-rank test; Fig. 3B). The slope of the reconstructed signal was also slightly less compared with DC signal (10.1 6 3.1 mV/s for reconstructed signal 10.2 6 3.1 mV/s mV for DC, n = 9, p , 0.01, Wilcoxon signed-rank test; Fig.  3B). Afterhyperpolarization (AHP) peak amplitude of SD also had minor differences (10.1 6 5.6 mV for DC signal and 10.1 6 5.5 mV for reconstructed, n = 9, p , 0.01, Wilcoxon signed-rank test; Fig. 3B). Timing characteristics of the signals were also comparable, half-duration of SD (duration at the half-amplitude) was 25.7 6 7.9 s for the DC signal and 25.7 6 7.9 s for reconstructed (n = 9, p , 0.01, Wilcoxon signed-rank test; Fig. 3B). Time from SD negative peak to AHP peak was 50.0 6 8.1 s for the DC signal and 50.0 6 8.1 s for the reconstructed signal (n = 9, p . 0.05, Wilcoxon signed-rank test; Fig. 3B).

NUPs
We next investigated the possibility of this method for reconstruction of an even slower class of signals, ischemic SD-initiated NUPs (Lückl et al., 2018;Dreier et al., 2019). SD-initiated NUPs were evoked by epipial application of the powerful vasoconstrictor ET-1 (1 mM) for 1 h, followed by wash of ET-1 for another 1-3 h (Fig. 4). SD-initiated NUPs progressively developed during 1 h of ET-1 application attaining negative values of À100.5 6 28.7 mV (at a cortical depth of 530 6 320 mm, n = 6 rats), and decayed on washout of ET-1. Example SD-initiated NUP traces obtained during recordings in DC mode, after passage through the RRC filter and the result of reconstruction using the inverse filter are presented in Figure 4A. It is noticeable that RRC filtering profoundly suppressed SDinitiated NUP, but the reconstructed signal fairly matched the original DC-trace. Estimation of reconstruction quality as described above for SD reconstructions revealed that the error did not exceed 1% through the entire course of  (Fig. 4A, bottom plot), and the PRSMD attained 0.20 6 0.12% for IF THEOR and 0.52 6 0.16% for IF EMPIR (n = 6 SD-initiated NUPs from 6 animals). SD-initiated NUP reconstruction error was significantly higher than that when using IF NLX (9.07 6 0.15%; n = 6, p , 0.05, Wilcoxon signed-rank test). SD-initiated NUP amplitude values after reconstruction using IF EMPIR matched with the DC signal values (100.6 6 28.7 and 100.5 6 28.7 mV, respectively; n = 6, p , 0.05; Fig. 4B). The maximal slope of reconstructed SD-initiated NUP had minimal difference from original DC-recordings (2.1 6 0.8 and 2.1 6 0.8 mV/s, respectively, n = 6, p , 0.05, Wilcoxon signed-rank test; Fig. 4B). The half-duration of reconstructed SD-initiated NUP was also similar compared with the DC signal (88.4 6 44.3 and 88.4 6 44.3 min, n = 6, p . 0.05, Wilcoxon signed-rank test; Fig. 4B).

Whole-cell recordings
We also estimated the possibility of reconstructing constant or very slowly changing shifts using recordings of membrane potential from single cells. For this purpose, a recording from an L5 barrel cortex cell was sent simultaneously to the DC and AC RRC channels of the amplifier. Acquiring this data in AC RRC mode can be helpful, for example, for simultaneous recording with LFP (Fig. 5). Slow wave activity was characterized by LFP oscillations with a dominant frequency of 1.9 Hz. This activity at the cellular level had a bimodal pattern with membrane potential fluctuations between hyperpolarized and depolarized states with an average value of À53.4 6 5.4 mV in DC recordings and À53.7 6 5.4 mV after reconstruction (p , 0.05, Wilcoxon signed-rank test, n = 6).
For these recordings we also obtained a high-quality reconstruction with PRMSD of 0.56 6 0.02% for IF THEOR , 0.19 6 0.02% for IF EMPIR , and 8.64 6 0.02% for IF NLX .

Discussion
In the present study, we developed a procedure for fullband, high quality reconstruction of signals recorded using hybrid AC/DC-divider RRC filters by virtue of Figure 5. Reconstruction of the membrane potential from whole-cell recordings. A, Example of LFP (local field potential) recording from the rat L5 barrel cortex with several up-down states. B, Example of whole-cell current-clamp DC recording (black trace) from an L5 cell near the LFP recording site shown in A; the same episode recorded in AC RRC mode (blue trace); the result of signal reconstruction from AC RRC data using IF EMPIR (inverse filter empirical) (orange trace). Histograms on the right show distributions of membrane potential values for each example, respectively. C, Trace demonstrating the difference between the original (DC) and reconstructed membrane potential recordings presented in B, red dashed line indicates zero value. inverse digital filtering based on a mathematical model of RRC filters. Our procedure also involves calibration of individual channels to minimize the error caused by deviation of the elements of RRC filters from their nominal values. Through validation in a number of datasets including extracellular recordings of high-potassium-induced cortical SDs, endothelin-induced ischemic NUPs and whole-cell recordings of the membrane potential we demonstrate that this approach enables near 99% reconstruction quality of the original signal in full-band that is superior to the IF NLX routine which provides reconstruction quality with ;10% error from the original signal. Our results thus demonstrate that the RRC recording filters proposed by Neuralynx in combination with the inverse filtering routines described here provide high fidelity fullband recordings. This involves not only recordings of infra-slow activity (SDs and SD-initiated NUPs) that can be achieved by reconstructions from AC recordings (Hartings et al., 2009), but also true DC recordings which are a priori impossible using AC recordings with RC input filters. However, several limitations of this approach for full-band recordings remain. These include the internal instrumental DC drift in the electrodes and amplifier. Also, while the approach for full-band recordings described in the present study may be useful for recordings large-amplitude infra-slow signals such as SDs and SD-initiated NUPs, it may be less suitable for recordings of low-amplitude infra-slow activities as division of signal in the infraslow frequency range will reduce their amplitude and thus decrease SNR for these signals. A potential application for this inverse filtering method could be long-term telemetrical monitoring in animals because the current devices do not provide satisfying solutions for DC recordings. To summarize, our study strongly supports the approach developed by Neuralynx for full-band recordings using hybrid AC/DC-divider filters for exploration of infra-slow activities by providing inexpensive and true DC recordings of large amplitude infra-slow brain signals at no cost to the resolution of the high-frequency activity.