Skip to content

05. LFP extraction

Xin Niu edited this page Oct 15, 2024 · 2 revisions

The detected spikes are removed from the raw signals with linear interpolation. Then, anti-aliasing (low-pass filtering on signals at 300 Hz) is run, and the signal is downsampled to 2000 Hz. Rejected spikes will also be removed if removeRejectedSpikes in extractLFP.m is set to true (by default).

Filling gaps between CSC within experiments:

As mentioned above, Neuralynx creates new recording files every two hours, or the recording is paused and restarted. This leads to gaps between continuous recordings. We fill the gaps with NaN values to both CSC signals and timestamps. The max gap duration will be 2 milliseconds (as suggested by Soraya).

After the CSC signals across the experiment and segments are combined, the timestamps of the combined signals are linearized (as suggested by Emily) with interp1 using linear interpolation. This will create large intervals of interpolated data if there are large gaps between experiments or segments. We write a function linearizeTimestamps to linearize timestamps for each segment/experiment when the gap is larger than a threshold (2 times the median of timestamp difference).

The downsampled timestamps are the same across channels for both micros and macros. So only one file will be saved.

Notes: Probably fine to do filtering separately (across experiments). linearize ts before downsampling the micro csc signals. downsampled Micro and macro will have the same timestamps (check if this is true).

Clone this wiki locally