Skip to main content
NIHPA Author Manuscripts logoLink to NIHPA Author Manuscripts
. Author manuscript; available in PMC: 2013 Jan 17.
Published in final edited form as: Conf Proc IEEE Eng Med Biol Soc. 2008;2008:2772–2776. doi: 10.1109/IEMBS.2008.4649777

Multi-taper transfer function estimation for stimulation artifact removal from neural recordings

Nick Chernyy 1, Steven J Schiff 2, Bruce J Gluckman 3
PMCID: PMC3547985  NIHMSID: NIHMS426819  PMID: 19163280

Abstract

The ability to simultaneously stimulate and record from neural tissue is paramount to the creation of a feedback-enabled control system. This stimulation creates additional electrical potential as seen by the recording system. This artifact can be approximated by a linear transfer function of the stimulus current. The computation of the transfer function is complicated by measurement noise and the bias and variance inherent in spectral estimation. We reduce bias and variance by using multi-taper techniques. We demonstrate the use of this transfer function as a method to remove stimulation artifact in the context of neural modulation with applied low-frequency (≪ 100Hz) electric fields in chronically instrumented animals.

Index Terms: neural recording, neural stimulation, artifact subtraction, epilepsy, feedback control, seizures, transfer function, multi-taper, DPSS

I. Introduction

Direct electrical stimulation of central nervous system structures is being increasingly used for for the treatment of human diseases and investigated for prosthetic input. The ability to craft custom continuous stimulation, in response to ongoing neural activity, is limited by recording artifact due to the stimulation. This is a result of a stimulation-induced change in differential mode and common mode potentials between electrode pairs with respect to the recording amplifier. In the stimulation target region, this additional potential can be of greater magnitude than the underlying neural signals. Therefore, typical neural stimulation is performed without regard for network activity (open-loop), in a response to network activity spatially far from the stimulation site, or in response to network activity during time periods without stimulation.

Under general assumptions similar to those used in the derivation of lead-field theory [1] [2] [3], the stimulation artifact can be approximated as a linear, complex transformation of the stimulation current:

V(t)=T(τ)I(t)+η(t) (1)

V is the measured voltage between a pair of electrodes, T is the transfer function, I is the applied current, η is a noise - here any potential source not due to the stimulation - term, and * denotes convolution. This form is convenient because the artifact can be estimated in analog circuitry using a linear filter. In Fourier space, this transforms to:

V(ω)=T(ω)I(ω)+η(ω) (2)

The transformation is complex, and allows the transfer function T (ω) will have frequency dependent amplitude and phase. The complex dispersion can come from the impedance of the tissue [4] [5], the electrochemical nature of the recording-electrode/tissue interface [6], and the filtering properties of the first-stage recording amplifier.

We demonstrate an efficient method for computing the linear transfer function based on periodic noise stimulation and multi-taper analysis in the context of a prototype device for low-frequency (≪ 100Hz) stimulation for seizure control [7] [8]. Discrete prolate spheroidal sequences (DPSS) are used as data windowing functions (tapers) in order to significantly reduce inherent spectral bias and variance in comparison to methods such as Welch’s overlapping segment averaging [9]. The sample variance of each tapered spectral estimate across all time windows is used to perform a weighted least-squares fit of the transfer function.

II. Methods

A. Overview

Both stimulation current and measured potential are recorded concurrently. As described below, this data is broken into short data windows, multiple orthogonal data tapers are applied to the time series, and fast Fourier transforms are computed. From these separate independent spectral estimates, a best fit is determined for the transfer function.

B. Multi-taper methods

Whenever Fourier analysis is performed on a segment of a time-series, a rectangular data taper is inherently applied to the time-domain data under consideration. The resulting estimate of this spectrum will suffer from leakage [9] and will introduce estimator bias. This estimator bias can be determined and removed in the special case of a perfectly flat frequency spectrum, however, this implies that the spectrum shape must be known a priori. We can reduce this bias by applying a data taper, such as the Hanning window, whose narrow frequency domain representation leads to a reduction in leakage and therefore reduced bias. Further reduction in bias is difficult as we are attempting to approximate the underlying frequency spectrum with finite data points [10] resulting in some variance in our estimator. The next improvement we can make is to obtain several estimates of the spectrum from the same time segment using multiple, orthogonal data tapers and thereby reduce the overall measurement variance. Discrete prolate spheroidal sequences (DPSS) tapers are orthogonal in the time domain and therefore provide multiple, independent frequency domain estimates from the same time series. These functions were developed to maximize signal concentration simultaneously in the time and frequency domains which makes them ideal choice for this analysis.

Time series data for the input current and recorded voltage are binned into n segments to facilitate efficient computation of the Fourier transform and to match the periodicity of the stimulus signal (see II-C). All k DPSS are applied to each of the n segments resulting in n * k total time blocks whose Fourier transform was computed. As taper index (k value) increases, the taper becomes wider in the frequency domain thereby increasing the susceptibility to spectral leakage. We used four most narrow-band DPSS tapers as an adequate trade-off between reducing the spectral estimate variance due to multiple samples and increasing it due to leakage.

C. Periodic noise stimulus

For the purposes of this analysis, it is convenient to use a periodic noise signal with the fundamental period equal to the length of the time blocks. Such a signal is constructed by summing sinusoids of fixed amplitudes whose frequencies span the range of interest and whose initial phases are randomized.

n(t)=A0ω=ωlowωhighsin(ωt+φω) (3)
φω(-π,+π) (4)

The period of this noise signal is determined by the lowest frequency of interest (ωlow) and the amplitude (A0) is set so that the final signal has a desired root-mean-square (RMS) value. The set of frequencies that are summed is designed to match the frequencies of interest when the Fast Fourier Transform (FFT) is taken so that every frequency in the range of interest has the same magnitude. This noise sample is then sent to the stimulator repeatedly to ensure that each time window has an identical stimulus waveform.

D. Transfer function estimation

Once the stimulus current and recorded voltage time series are broken up, tapered, and the Fourier transform is applied (as described in section II-B), the optimal relationship between the current and voltage is computed. Initially, the frequency-domain data from each taper (hk) is compared across all time bins. The naive statistical assumption is that the frequency spectrum data from each time block, using a given taper, has the same variance, so the best estimator for stimulus current and recorded voltage spectra is an average across all time windows. The sample variance can also be computed.

Xk(n,ω)=F[hk(t)x(n,t)] (5)
Xk(ω)=1nnXk(n,ω) (6)
sXk2(ω)=1nn(Xk(ω)-Xk(n,ω))2 (7)

One of the consequences of this averaging is that any noise (η(ω)) in the recorded voltage V that is not coherent to the stimulus current I is reduced. This can be understood by breaking up the complex vector V into a component due to I and a component due to background activity. Since I is identical for every time bin, the vector component of V due to I should also be identical. The direction of the complex η vector is not correlated to I so the expectation value of η should decrease as n increases. A further reduction in variance can be made by using a jackknifing method [11] [10] where uniform variance across all samples is no longer assumed.

A complex linear function is then fit to the individual data using a weighted least squares method.

{Vk(ω)}=T(ω){Ik(ω)}+η(ω) (8)
R2=kT(ω)Ik(ω)+η(ω)-Vk(ω)sVk2+T(ω)2sIk2 (9)

The ‘slope’ (T) and ‘intercept’ (η) of this complex linear function are determined numerically to minimize R2 [12] [13]. T (ω) is a complex representation of the transfer function of the stimulus current to recorded artifact voltage while η(ω) represents the residual signal that did not average out to zero. The complex transfer function can then be used to design a matched filter to simulate the effects of the tissue’s complex impedance. One easy method to do this is using the invfreqz function of the Signal Processing toolbox in MATLAB (Mathworks Inc, Natick MA) which iteratively computes stable IIR filter based on a set of complex parameters (T(ω)) and their normalized, angular frequencies.

E. Experimental procedure

Multiple Sprague-Dolley rats (male, 350–400g) were implanted with iridium-oxide coated [14] stainless-steel stimulating electrodes (≈ 3mm2 surface area) in compliance with IACUC-approved experimental protocols. 125μm bipolar electrodes were implanted in both hippocampi and two pairs of cortical screw electrodes were inserted into the skull. After recovery, these animals were connected to chronic recording system consisting of custom amplifiers and an isolated, current-program stimulator. Each animal participated in multiple stimulation sessions to asses stimulation electrode impedance and stimulus artifact transfer function (recorded voltage versus stimulus current) over 0.5–20Hz range.

III. Results

Once the filter coefficients are determined for each of the bipolar recording electrodes, the current waveform is filtered and the result is subtracted directly from the recorded voltage waveform. The resulting recorded voltage waveform contains the electrophysilogical recording of the ongoing neural activity with negligible stimulation artifact. The remaining artifact can be measured by computing a cross correlation spectrum for the voltage signal and the stimulus current. Using these methods, we can predict the artifact voltage for an arbitrary waveform that is in the frequency range of the computed transfer function. Removal of single tone and chirp artifacts is demonstrated in figures 3 and 4 respectively. These data are from two separate animals and are generally representative of our ability to subtract stimulation artifact.

Fig. 3.

Fig. 3

Example of artifact subtraction from bipolar depth electrode recording during 10Hz sinusoidal stimulation. (A) Trace of raw recording from a bipolar hippocampal depth electrode ipsilateral to the stimulation electrode. (B) Trace of applied stimulation current. (C) Neuronal signal after artifact removal.

Fig. 4.

Fig. 4

Example of artifact subtraction of a signal containing a sweep of frequencies from 2Hz to 20Hz. The labels are the same as figure 3, however, this experiment was performed in a different animal.

The filtering coefficients can then be incorporated into the experiment acquisition and control software, or in the hardware of the recording amplifiers through the use of digitally-programmable filter arrays. Furthermore, the evolution of these filter coefficients, as a function of experiment time, can give insight into things like electrode performance and tissue response to chronic implantation.

IV. Discussion

We have demonstrated the possibility for online, real-time stimulation artifact removal through the estimation of the stimulus to recording transfer function and generating a matched filter. Although transfer function analysis is not new in various fields of engineering, we have shown that the performance of this analysis can be increased through the use of specially generated noise signals and by performing multiple measurements of the frequency spectrum for each time-bin. These techniques are crucial to developing neural feedback-control systems, however, there are other applications of this generic method. With the same experimental procedure, it is straight forward to compare the stimulus current spectrum and the required stimulus voltage to drive that current and compute the electrode impedance as a function of frequency.

We have demonstrated the possibility for real-time stimulation artifact removal through estimation of filter coefficients from a complex transfer function between the stimulus current and the recorded artifact voltage. There is no technological impediment to implementing this in hardware using digitally programmable filters.

Fig. 1.

Fig. 1

Example of the first four discrete prolate spheroidal sequences (DPSS) which are used as time domain tapers. The frequency content of each taper increases with index number with the first taper being the most narrow (in the frequency domain).

Fig. 2.

Fig. 2

Amplitude and phase of the computed transfer function T (ω). The transfer function is computed by taking a least squares fit of the transfer function estimates using each taper over all of the time windows of the applied current stimulus and neuronal recording.

Acknowledgments

The authors would like to thank Dr. Sridhar Sunderam for helpful discussions and Dr. Jonathan Mason for assistance with experiments.

This work has been supported by the National Institutes of Health through grants R01EB001507, R01MH50006 and K02MH01493. This project was funded, in part, with grants from the Pennsylvania Department of Community and Economic Development Keystone Innovation Zone Program, and the Pennsylvania Department of Health using Tobacco Settlement Funds (the Departments specifically disclaim responsibility for any analyses, interpretations or conclusions).

Contributor Information

Nick Chernyy, Email: nchernyy@psu.edu, The Engineering Science and Mechanics Department, The Pennsylvania State University, State College, PA 16802 USA.

Steven J. Schiff, Department of Neurosurgery and Department of Engineering Science and Mechanics, The Pennsylvania State University, University Park, PA

Bruce J. Gluckman, Email: bjg18@psu.edu, Department of Engineering Science and Mechanics, and Department of Neurosurgery, The Pennsylvania State University, University Park, PA. phone: 814-865-0178.

References

  • 1.Jackson JD. Classical electrodynamics. 3. Wiley; 1998. [Google Scholar]
  • 2.Plonsey R, Barr R. Bioelectricity: a quantitative approach. 3. Springer; 2007. [Google Scholar]
  • 3.Nunez P, Srinivasan R. Electric fields of the brain: the neurophysics of EEG. Oxford University Press; 2005. [Google Scholar]
  • 4.Logothetis NK, Kayser C, Oeltermann A. In vivo measurement of cortical impedance spectrum in monkeys: implications for signal propagation. Neuron. 2007;55:809–823. doi: 10.1016/j.neuron.2007.07.027. [DOI] [PubMed] [Google Scholar]
  • 5.Polk C, Postow E. Handbook of biological effects of electromagnetic fields. 2. CRC Press; 1995. [Google Scholar]
  • 6.Cantrell DR, Inayat S, Taflove A, Ruoff RS, Troy JB. Incorporation of the electrode-electrolyte interface into finite-element models of metal microelectrodes. J Neural Eng. 2008;5:54–67. doi: 10.1088/1741-2560/5/1/006. [DOI] [PubMed] [Google Scholar]
  • 7.Gluckman BJ, Neel EJ, Netoff TI, Ditto WL, Spano ML, Schiff SJ. Electric field suppression of epileptiform activity in hippocampal slices. J Neurophysiol. 1996;76(6):4202–4205. doi: 10.1152/jn.1996.76.6.4202. [DOI] [PubMed] [Google Scholar]
  • 8.Sunderam S, Chernyy N, Mason J, Peixoto N, Weinstein SL, Schiff SJ, Gluckman BJ. Seizure modulation with applied electric fields in chronically implanted animals. Conf Proc IEEE Eng Med Biol Soc. 2006:1612–1615. doi: 10.1109/IEMBS.2006.259454. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Percibal DB, Walden AT. Spectral analysis for physical applications. Cambridge University Press; 1993. [Google Scholar]
  • 10.Thomson DJ, Chave AD. Jackknifed Error Estimates for Spectra, Coherences, and Transfer Functions. In: Haykin S, editor. Advances in Spectrum Analysis and Array Processing. 1. Prentice Hall; 1991. [Google Scholar]
  • 11.Thomson DJ. Spectrum estimation and harmonic analysis. Proceedings of the IEEE. 1982;70(9):1055–1096. [Google Scholar]
  • 12.Olsson DM, Nelson LS. The nelder-mead simplex procedure for function minimization. Technometrics. 1975;17(1):45–51. [Google Scholar]
  • 13.Fletcher R, Reeves CM. Function minimization by conjugate gradients. The Computer Journal. 1964;7(2):149–154. [Google Scholar]
  • 14.Meyer RD, Cogan SF, Nguyen TH, Rauh RD. Electrodeposited iridium oxide for neural stimulation and recording electrodes. IEEE Trans Neural Rehab Eng. 2001;9(1):2–11. doi: 10.1109/7333.918271. [DOI] [PubMed] [Google Scholar]
  • 15.Jarvis MR, Mitra PP. Sampling properties of the spectrum and coherency of sequences of action potentials. Neural Comput. 2001;13(4):717–749. doi: 10.1162/089976601300014312. [DOI] [PubMed] [Google Scholar]

RESOURCES