Abstract—Stimulus evoked field potentials are commonly used in studying sensory systems. But, the stimulus induced signals are often contaminated by stimulus artifacts. Especially, microstimulation greatly affects the recorded field potentials. In this paper, we present a novel technique capable of removing the microstimulation induced stimulus artifacts from the recorded sensory signals (local field potentials, LFPs). The algorithm detects the start and the end of the artifact based on signal derivative and removes the artifacts from the recordings. This algorithm overcomes the barrier of artifact shape, duration, and frequency imposed by many existing techniques and provides the flexibility of automatic batch processing of multiple neuronal signals. This technique provides the advantages of being simple, straight- forward, and computationally efficient, demonstrating to be an efficient and accurate artifact removal method, as validated by analyzing recordings from the rat somatosensory cortex (S1) using standard borosilicate micropipettes (1 MΩ). Keywords—stimulus artifact; microstimulation; artifact removal; local field potentials; neuronal activity. I. INTRODUCTION N sensory system and system neurobiology, how perception relates to neuronal network activity is a research question that has been explored by many neuroscientists. Intracortical microstimulation has proven to be a powerful means of investigating the neuronal network activity [1]. Studies on neural responses to stimulation are often contaminated by undesired contributions caused by the stimuli. These contaminants, or stimulus artifacts, often obscure part or the entire neural signal under investigation; particularly when investigating the brain mapping upon stimulating a particular area. Stimulus artifact poses a distinct problem in S1 evoked potential recordings in that it is coherent with the evoked response, and thus cannot be reduced by ensemble averaging [2]. Literature studies show that the frequency spectra of the neural signals and stimulus artifact often overlap and the most common technique of filtering the Manuscript received June 15, 2011. This work was supported by the European Commission under the Seventh Framework Programme (ICT- 2007.8.3 Bio-ICT convergence, 216528, CyberRat). Mufti Mahmud is with the NeuroChip Laboratory of Department of Human Anatomy & Physiology, University of Padova, 35131, Padova, Italy (e-mail: mahmud@dei.unipd.it). Marta Maschietto (e-mail: marta.maschietto@unipd.it) and Stefano Girardi (e-mail: stefano.girardi.1@unipd.it) are with the NeuroChip Laboratory of Department of Human Anatomy & Physiology, University of Padova, 35131, Padova, Italy. Stefano Vassanelli is with the NeuroChip Laboratory of Department of Human Anatomy & Physiology, University of Padova, 35131, Padova, Italy (Corresponding Author ; phone: +39 049 8275337; fax: +39 049 8275331; e-mail: stefano.vassanelli@ unipd.it). frequency components of the stimulus artifact may result in distortion of the neural signal. Therefore, researchers invested time in developing techniques to remove stimulus artifacts with minimal signal distortion. For example, artifact template subtraction [3], [4], [5], and [6], artifact blanking combined with artifact template subtraction [7], stimulus artifact identification and removal through local curve fitting algorithms [8], and [9]. However, most of these methods were developed taking into account the spiking neuronal ensembles. In case of LFPs with artifacts recorded from somatosensory cortex these methods are not applicable due to the complicated shape of the LFPs immediately followed by the artifacts induced by the microstimuli. Thus, a new approach is required which will not be bounded by the artifact shape and will work also on LFP based neuronal recordings. In this work, we present an automatic, simple to implement and computationally efficient method capable of detecting artifacts in the LFPs recorded from different cortical layers and removing them to make the LFPs useable for further processing and analysis. The method is designed to be able to do batch processing so that it can easily be extended to a multichannel system. This program is a part of the SigMate software package and shortly will be made available to the community under the open source GNU-GPL [10]. II. SIGNAL ACQUISITION A. Animal preparation P30-P40 Wistar rats rats were anesthetized with an induction mixture of Tiletamine and Xylazine (2 mg and 1.4 mg/100 g weight, respectively). The rat’s eye, hind- limbs’ reflexes, respiration, and whiskers’ spontaneous movements were monitored throughout the experiment to check the level of anesthesia and whenever necessary additional doses of Tiletamine (0.5 mg / 100 g weight) and Xylazine (0.5 g / 100 g weight) were provided. Rats were positioned on a stereotaxic apparatus and fixed by teeth- and ear-bars. The body temperature was constantly monitored with a rectal probe and maintained at about 37°C using a homeotermic heating pad. Heart beat was monitored by standard ECG. Anterior-posterior opening in the skin was made in the center of the head, starting from the imaginary eye-line and ending at the neck. The connective tissue between skin and skull was removed by a bone scraper. The skull was drilled to open a window in the S1 (AP -1 ÷ -4, LM +4 ÷ +8) right cortex. In order to reduce brain edema, only a slit at coordinates AP -2.5, LM +6 was made [11]. Throughout surgical operations and recordings, the An Automated Method to Remove Artifacts Induced by Microstimulation in Local Field Potentials Recorded from Rat Somatosensory Cortex Mufti Mahmud, Graduate Member, IEEE, Stefano Girardi, Marta Maschietto, and Stefano Vassanelli I