Neural - Data - Science - 1 Spike Detection
Neural - Data - Science - 1 Spike Detection
3 | Philipp Berens
Hong & Lieber, 2019
Methods for recording brain activity
https://www.biorxiv.org/content/10.1101/2020.10.27.358291v1
10 | Philipp Berens
The Problem
Buszaki, 2004
Triangulation
Channel 1
Channel 2
Channel 3
Tetrode
Channel 4
Neuron 1 Neuron 2
Amp. Channel 4
Amp. Channel 3
Neuron 2
Neuron 1
16 | Philipp Berens
A quick detour on time series filtering
https://bookdown.org/rdpeng/timeseriesbook/filtering-time-series.html
17 | Philipp Berens
Butterworth bandpass filter
http://scipy-cookbook.readthedocs.io/items/idx_signal_processing.html
Spike detection
Threshold at 𝑵𝝈
Low threshold
High threshold
Robust estimation of 𝝈:
𝒙−𝒙 ഥ
𝝈
ෝ = 𝒎𝒆𝒅𝒊𝒂𝒏
𝟎. 𝟔𝟕𝟒𝟓
Quian-Quiroga 2004
Why is this an estimate of the standard deviation?
• 𝑀𝐴𝐷 = 𝑚𝑒𝑑𝑖𝑎𝑛 |𝑥 − 𝑥|ҧ
𝑀𝐴𝐷 𝑀𝐴𝐷 1
•Φ −Φ − =
𝜎 𝜎 2
𝑀𝐴𝐷 𝑀𝐴𝐷 1
•Φ −1+ Φ =
𝜎 𝜎 2
𝑀𝐴𝐷 3
•Φ =4
𝜎
1 1
•𝜎= 3 𝑀𝐴𝐷 = 𝑀𝐴𝐷 = 0.675 𝑀𝐴𝐷
Φ−1 1.4826
4
20 | Philipp Berens
Detect spikes and extract waveforms
Energy
Peak-to-peak
amplitude
Peak-to-trough
ratio
Width Etc…
Problems
• Sometimes undefined (no trough)
• Non gaussian distributions
• Correlated
Feature 2
Energy
Peak-to-
Feature 1
peak
amplitude
Peak-to-
trough ratio
See also
Quian-Quiroga, 2004
Width
PCA
1. Find direction capturing maximum variance
2
𝑤 = arg max 𝑤 𝑇 𝑥𝑖 , 𝑠. 𝑡. 𝑤 = 1
w
𝑖
2. Minimal reconstruction error
2
𝑇
𝑤 = arg min 𝑋 − 𝑤𝑤 𝑋
w
https://stats.stackexchange.com/questions/2691/
making-sense-of-principal-component-analysis-eigenvectors-eigenvalues
Principal component analysis (PCA)
• Finds an orthogonal basis for the data
• First PC is the direction of largest variance
Larger variance