## Abstract

Full-band DC recordings enable recording of slow electrical brain signals that are severely compromised during conventional AC recordings. However, full-band DC recordings may be limited by the amplifier’s dynamic input range and the loss of small amplitude high-frequency signals. Recently, Neuralynx has proposed full-band recordings with inverse filtering for signal reconstruction based on hybrid AC/DC-divider RRC filters that enable only partial suppression of DC signals. However, the quality of signal reconstruction for biological signals has not yet been assessed. Here, we propose a novel digital inverse filter based on a mathematical model describing RRC filter properties, which provides high computational accuracy and versatility. Second, we propose procedures for the evaluation of the inverse filter coefficients, adapted for each recording channel to minimize the error caused by the deviation of the real values of the RRC filter elements from their nominal values. We demonstrate that this approach enables near 99% reconstruction quality of high-potassium-induced cortical spreading depolarizations (SDs), endothelin-induced ischemic negative ultraslow potentials (NUPs), and whole-cell recordings of membrane potential using RRC filters. The quality of the reconstruction was significantly higher than with the existing inverse filtering procedures. Thus, RRC filters with inverse filtering are optimal for full-band EEG recordings in various applications.

## Significance Statement

This study describes an optimized inverse filtering procedure with calibrated passive filter parameters for high-quality full-band EEG recordings using hybrid AC/DC-divider filters, and shows that this approach provides significantly higher quality reconstruction of cortical spreading depolarizations (SDs), ischemic negative ultraslow potentials (NUPs), and whole-cell recordings of membrane potential than the existing inverse filtering procedure.

## Introduction

While the conventional bandwidth of clinical EEG encompasses frequencies above 0.5 Hz, several important physiological and pathologic patterns of brain activity occur within the infra-slow (<0.5 Hz) frequency range (Kovac et al., 2018). These include retinal waves- driven slow activity transients (Vanhatalo et al., 2005a; Colonnese and Khazipov, 2010), activity associated with different cognitive tasks and behavior (Birbaumer et al., 1990; Cui et al., 2000), resting state networks (Fox and Raichle, 2007; Grooms et al., 2017), and infra-slow oscillations during slow-wave sleep (Vanhatalo et al., 2004; Onton et al., 2016; Lecci et al., 2017; Miyawaki et al., 2017). Also included in infra-slow activity are long, high amplitude DC shifts during focal onset seizures (Voipio et al., 2003; Rodin et al., 2014) and the continuum of spreading depolarizations (SDs) during epilepsy, migraine, brain trauma, and ischemia (for review, see Dreier, 2011; Pietrobon and Moskowitz, 2014; Dreier and Reiffurth, 2015; Herreras and Makarova, 2020). Finally, extremely slow and large SD-initiated negative ultraslow potentials (NUP) have recently been reported in humans during brain ischemia representing the extreme end of the SD continuum (Oliveira-Ferreira et al., 2010; Drenckhahn et al., 2012; Hartings et al., 2017; Carlson et al., 2018; Dreier et al., 2018, 2019; Lückl et al., 2018).

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 power-law 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. 1*A*,*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. 1*A*,*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-input-compensation, 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. 1*A*, 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. 1*B*, 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*, and at infra-slow frequencies, the transfer coefficient (

_{C}*k*) approaches a plateau value defined by

_{0}### Reconstruction of full-band signals through inverse filtering

The complex transfer function (*A*, bottom panel, is the following:

The frequency response (

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:
*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

Thus, the numerator and denominator of this equation contain coefficients *f* is frequency *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. 2*C*). 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

*V _{out1}* and

*V*, output voltages during two constant levels

_{out0}*V*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.

_{in}The parameter *τ* defined from Equation 7 as
*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*in Fig. 1

_{Test}*B*). To increase the SNR, the amplitudes

*V*and

_{inh}*V*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 5

_{in}*τ*(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 urethane-anaesthetized (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-μm separation distance (Neuronexus Technologies) from the barrel cortex. The probe was inserted to the barrel cortex to a target depth of ∼1600-μm 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 μm solved in artificial CSF (ACSF)] followed by 1 h of wash with ACSF (Dreier et al., 2002; Oliveira-Ferreira et al., 2010). Patch-clamp 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 ± 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.

### Extended Data 1

MATLAB codes used for the reconstruction: IFtheor.m – reconstruction using *IF _{THEOR}*. IFempir.m – reconstruction using

*IF*. Download Extended Data 1, ZIP file.

_{EMPIR}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.

## Results

### 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

*τ*(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

*R*=

*1 MΩ,*

*C*=

*1 μF and*

*R*=10 MΩ,

_{C}*τ*and

*k*are equal to 10 s and 0.0909, respectively (inverse filter with theoretical coefficients,

_{0}*IF*). 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

_{THEOR}*τ*and

*k*(inverse filter with coefficients measured empirically,

_{0}*IF*) for each channel of the amplifier. First, a constant voltage of 1 V (

_{EMPIR}*V*) was applied. This value was selected in accordance with the value

_{in}*k*= 1/11 to provide a high SNR and to stay within the input range of the amplifier (±131 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

_{0}_{RRC}recordings were averaged over the flat 200-s intervals and the corresponding

*V*and

_{out1}*V*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 SD-initiated NUPs and SDs. Second, a sinusoidal signal of amplitude 200 mV (

_{out0}*V*, to provide a high SNR and to stay within the input range) and frequency 0.1 Hz (Fig. 1

_{inh}*B*) was applied. The amplitude of the recorded AC

_{RRC}signal (

*V*) was estimated using fast-Fourier transform. Coefficients

_{outh}*k*and

_{0}*τ*were calculated according to Equations 8, 9, respectively. The experimentally measured values of

*τ*for 128 channels of the amplifier varied in the range 9.688–10.650 s (average: 10.087 ± 0.204 s), with a deviation from the theoretical value of 10 s by 0.02–6.5% (on average, 1.910 ± 1.121%;

*n*= 128). Similarly, the experimentally measured values of

*k*varied in the range 0.0904–0.0922 (average: 0.0914 ± 0.0003), with a deviation from the theoretical value of 0.0909 by 0.03–1.38% (on average, 0.54 ± 0.33%;

_{0}*n*= 128). For all subsequent signal reconstructions using an inverse filter, we used the experimentally determined values of

*τ*and

*k*. 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.

_{0}### 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. 2*A*).

According to the frequency response (Fig. 1*B*) 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. 2*B*,*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 ± 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 ± 110 μm (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 3*A*. The error of reconstruction (PRMSD) was 1.11 ± 0.11% for *IF _{THEOR}* and 0.51 ± 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*(8.55 ± 0.07%;

_{NLX}*n*= 9,

*p*< 0.01, Wilcoxon signed-rank test). After DC reconstruction, SD amplitude returned to 23.0 ± 2.6 mV, only 0.7 ± 0.1% smaller than the original DC-signal amplitude which was 23.1 ± 2.6 mV (

*n*= 9,

*p*< 0.01, Wilcoxon signed-rank test; Fig. 3

*B*). The slope of the reconstructed signal was also slightly less compared with DC signal (10.1 ± 3.1 mV/s for reconstructed signal 10.2 ± 3.1 mV/s mV for DC,

*n*= 9,

*p*< 0.01, Wilcoxon signed-rank test; Fig. 3

*B*). Afterhyperpolarization (AHP) peak amplitude of SD also had minor differences (10.1 ± 5.6 mV for DC signal and 10.1 ± 5.5 mV for reconstructed,

*n*= 9,

*p*< 0.01, Wilcoxon signed-rank test; Fig. 3

*B*). Timing characteristics of the signals were also comparable, half-duration of SD (duration at the half-amplitude) was 25.7 ± 7.9 s for the DC signal and 25.7 ± 7.9 s for reconstructed (

*n*= 9,

*p*< 0.01, Wilcoxon signed-rank test; Fig. 3

*B*). Time from SD negative peak to AHP peak was 50.0 ± 8.1 s for the DC signal and 50.0 ± 8.1 s for the reconstructed signal (

*n*= 9,

*p*> 0.05, Wilcoxon signed-rank test; Fig. 3

*B*).

### 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 μm) 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 ± 28.7 mV (at a cortical depth of 530 ± 320 μm, *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 4*A*. It is noticeable that RRC filtering profoundly suppressed SD-initiated 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 recordings (Fig. 4*A*, bottom plot), and the PRSMD attained 0.20 ± 0.12% for *IF _{THEOR}* and 0.52 ± 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*(9.07 ± 0.15%;

_{NLX}*n*= 6,

*p*< 0.05, Wilcoxon signed-rank test). SD-initiated NUP amplitude values after reconstruction using

*IF*matched with the DC signal values (100.6 ± 28.7 and 100.5 ± 28.7 mV, respectively;

_{EMPIR}*n*= 6,

*p*< 0.05; Fig. 4

*B*). The maximal slope of reconstructed SD-initiated NUP had minimal difference from original DC–recordings (2.1 ± 0.8 and 2.1 ± 0.8 mV/s, respectively,

*n*= 6,

*p*< 0.05, Wilcoxon signed-rank test; Fig. 4

*B*). The half-duration of reconstructed SD-initiated NUP was also similar compared with the DC signal (88.4 ± 44.3 and 88.4 ± 44.3 min,

*n*= 6,

*p*> 0.05, Wilcoxon signed-rank test; Fig. 4

*B*).

### 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 ± 5.4 mV in DC recordings and −53.7 ± 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 ± 0.02% for *IF _{THEOR}*, 0.19 ± 0.02% for

*IF*, and 8.64 ± 0.02% for

_{EMPIR}*IF*.

_{NLX}## Discussion

In the present study, we developed a procedure for full-band, high quality reconstruction of signals recorded using hybrid AC/DC-divider RRC filters by virtue of 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 full-band 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 infra-slow 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.

## Acknowledgments

Acknowledgements: We thank Dr. J. Dreier, Dr. O. Herreras, Dr. S. Vanhatalo, Dr. R. Giniatullin, Dr. C. Stengel, Dr. C. Bernard, and Dr. A. Ivanov for their careful and critical reading of this manuscript.

## Footnotes

The authors declare no competing financial interests.

This work was supported by the Russian Science Foundation (RSF) Grant 17-15-01271-P (electrophysiological experiments, data analysis, development of the inverse filter) and the subsidy allocated to Kazan Federal University for the state assignment No. 0671-2020-0059 in the sphere of scientific activities (development of the analytical software Eview).

This is an open-access article distributed under the terms of the Creative Commons Attribution 4.0 International license, which permits unrestricted use, distribution and reproduction in any medium provided that the original work is properly attributed.