(A) Entire LFP recording sampled at 200 Hz (black) is used to identify the true period.
(B) An illustration of a five-sample snippet of the LFP recording divided into epochs by using the true period and overlaid with the high-resolution waveform (light blue). Black points indicate individual raw LFP samples.
(C) The epochs for all five samples are overlaid on the timescale of the true period.
(D) When all epochs in the recording are overlaid by using this procedure, all samples consolidate around the shape of the high-resolution artifact waveform on the timescale of the true period.
(E) The period suggested by the device sampling and stimulation rates is inexact and does not result in a consolidated waveform. Using a grid search centered around the stated period, a series of periods are evaluated to find the true period that produces the most consolidated samples.
(F) A sliding window is applied to the entire recording to estimate the contribution of the stimulation artifact at each sample.
(G) For each window, a rectangular kernel (length Nbins), ignoring the center (length Nskips) is used to estimate the value of the artifact at each sample of interest i (asterisk).
(H) Samples within a distance, Dperiod, on the timescale of the artifact period are averaged together to produce the estimate of the amplitude of the artifact (orange point) at sample i.
(I) The estimated value of the artifact is then subtracted at each sample over the entire recording to recover the signal of interest (dark blue).