Despiking Neural Data using Linear Interpolation
Excessive spiking in a neural signal can affect the interpretation of lower frequency analyses like those investigating the local field potential (LFP). One method to mitigate the influence of spikes on these low frequency components is to remove them from the original signal using linear interpolation. This technique has been characterized by others and is written into the Fieldtrip toolbox.
Below is a simple function despike.m for MATLAB to remove spikes using linear interpolation.
My primary complaint about this method is that it does not make any “smart” or adaptive decisions concerning the time interval of the spike being replaced. However, if spikes were sorted, each set of spike timestamps from an individual unit could be associated with a spike width (see the spikeWidth variable in my example) and be replaced using a spike-specific time window.
One very simple alternative used when spike contamination is of very high frequency is to simply apply a median filter, like medfilt1. This is less applicable to neural data being sampled at rates greater than ~2kHz where the spike waveform is represented by multiple data points.
Recent Comments
Archives
- April 2023
- January 2023
- November 2022
- May 2022
- March 2022
- January 2022
- December 2021
- April 2021
- December 2020
- October 2020
- August 2020
- July 2020
- March 2020
- February 2020
- January 2020
- December 2019
- November 2019
- October 2019
- January 2019
- December 2018
- November 2018
- August 2018
- July 2018
- April 2018
- March 2018
- November 2017
- October 2017
- February 2017
- October 2016
- August 2016
- July 2016
- November 2015
- October 2013
- February 2013
- January 2013
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- February 2012
- December 2011