Signal Processing for Neural Engineering
BIOEN 460/560, ECE 460/560:
Part I
1
Pathology of racism in medicine
Praxis
History
Theory
Science
Medicine
Dr. Edwin Lindo
UW, School of Medicine
2
Neural data
EEG Functional MRI
Extracellular
recording
ECoG
Ca Imaging
Intracellular
recording
3
Typical Brain-Computer Interface
Classification
or Regression
4
Signal Processing
EEG
(scalp)
ECoG
(brain surface)
Spikes + LFP
Picture courtesy of Wadsworth Center
5
Example: ECoG Signal
Rest Period Hand movement
Slow oscillations
have disappeared
Faster fluctuations
are apparent
6
How can we quantify the various types of
oscillations and fluctuations in a signal?
7
Decomposing a signal into components:
Frequency domain analysis
Recorded
signal
+ Increasing
frequency
+
8
Decomposing a signal into components:
Frequency domain analysis
Step function that alternates sin(x)
between 0.8 and -0.8
9
Decomposing a signal into components:
Frequency domain analysis
Step function that alternates sin(x) + (1/3)sin(3x)
between 0.8 and -0.8
10
Decomposing a signal into components:
Frequency domain analysis
Step function that alternates sin(x) + (1/3)sin(3x) + (1/5)sin(5x) +
between 0.8 and -0.8 … + (1/11)*sin(11x) 11
Example of Frequency Domain Analysis
Signal as a Signal as a
function of function of
time frequency
12
Fourier Analysis
Joseph Fourier (1768-1830)
✦ Express any signal as an infinite sum of sines and cosines
a0
s (t ) = + a1 cos(wt ) + a2 cos(2wt ) + ! + b1 sin(wt ) + b2 sin(2wt ) + !
2
a0 ¥ ¥
2𝜋
= + å an cos(nwt ) + å bn sin(nwt ) 𝜔=
2 n =1 n =1
𝑇
s(t) defined, nonzero over [−T/2, T/2]
✦ Obtain each “Fourier coefficient” via correlation with signal:
2 T /2
an = ò s(t ) cos( nwt )dt
T - T / 2
Amount of nth frequency
2 T /2 cosine and sine
bn = ò s(t ) sin(nwt )dt
T - T / 2 13
The Fourier Transform
a0 ¥ ¥
s(t ) = + å an cos(nwt ) + å bn sin(nwt )
2 n =1 n =1
Can simplify this equation further if we use two tricks:
an - jbn
Define cn = n>0 j = -1 Use the identity:
2
a e jq = cosq + j sin q
= 0 n=0
2
a n + jb n
= n<0 Amount of nth frequency waves
2
Can rewrite:
¥
1 T /2
s (t ) = åc e
n = -¥
n
jnwt
cn = ò s(t )e - jnwt dt
T -T / 2
Inverse Fourier Transform Fourier Transform 14
Amplitude and Power Spectra
a0
s(t ) = + a1 cos(wt ) + a2 cos(2wt ) + ! + b1 sin(wt ) + b2 sin(2wt ) + !
2
✦ Amplitude Spectrum: At each frequency n, compute:
1 2 2
A( n ) = an + bn = Re( c( n )) 2 + Im(c( n )) 2
2
✦ Power Spectrum:
1 2 2
P( n ) = A( n ) = ( an + bn ) = Re( c( n )) 2 + Im(c( n )) 2
2
15
Discussion:
✦ Problems with Fourier analysis?
16
Problem with Fourier Analysis
✦ Continuous signal
✦ Sines and cosines occupy an
infinite temporal extent
✦ Fourier transform does a poor
job of representing finite and
non-periodic signals, and
signals with sharp peaks and
discontinuities
17
Discrete Fourier Transform (DFT)
-.
,) / 0
✦ 𝑥 𝑛 = ∑) 𝑐) 𝑒
-.
1 5,) / 0
✦ 𝑐) = ∑ 𝑥[𝑛] 𝑒
2 0
✦ Fast Fourier transform (FFT): Efficient way of computing
coefficients and power spectrum
18
ECoG Signal à Power Spectrum
Rest Hand movement
Low- and High-Frequency Band
(LFB/HFB) “features” can be used to
detect hand movement 19
Example: Using HFB ECoG to control a cursor
20
Cursor Control using Imagined Speech
21
Examples of Fourier analysis
22
https://ocw.mit.edu
Brain waves
23
Change in Brain State
Normal Stroke
24
Problem with Fourier Analysis
✦ Sines and cosines occupy an
infinite temporal extent
✦ Fourier transform does a poor
job of representing finite and
non-periodic signals, and
signals with sharp peaks and
discontinuities
✦ Fourier transform is not
suitable for non-stationary
signal (e.g. brain signal)
25
Wavelets
✦ Represent a signal as
a linear combination
of finite basis
functions called
wavelets
✦ Each wavelet in the
linear combination is
a scaled and
translated copy of a
single mother wavelet
26
Mother Wavelets
Mexican Hat Morlet Meyer
27
Example: Wavelet Decomposition of EEG
Scaled down
and
translated
copies of a
single mother
wavelet
(Hinterberger et al., 2003) 28
29
Sampling Frequency
We normally record a continuous signal y(t) by a set of
samples ys(t) at discrete intervals of time Dt.
y(t) yS(t)
t t
29
30
Sampling Frequency
Dt
yS(t)
The number of samples recorded each second is
defined as the sampling frequency, fS.
30
Nyquist-Shannon Signal Sampling Theorem
31
http://195.134.76.37/applets/AppletNyquist/Appl_Nyquist2.html
Five minute break
32
Signal Processing
EEG
(scalp)
ECoG
(brain surface)
Spikes + LFP
Picture courtesy of Wadsworth Center
33
Spike Sorting
34
Quiroga et al. , 2004, Current Biology
Spike Sorting
Extracellular
recording
(multiunit hash)
Sorting by
Amplitude
35
http://www.scholarpedia.org/article/Spike_sorting
Spike Sorting
What if spikes have similar amplitude but different shape?
Sorting using
Window
Discriminators
Alternate method:
• Cluster spikes automatically based
on shape
• Each cluster = spikes from one
neuron.
36
http://www.scholarpedia.org/article/Spike_sorting
Spike Sorting
Principle Component Analysis
(PCA)
37
Nadian et al. , 2018, bioRxiv
Spike Sorting
38
Nadian et al. , 2018, bioRxiv
Spike Sorting
39
Einevoll et al. , 2012, Current Opinion in Neurobiology
What to do with spikes?
Yazdan-Shahmorad et al., 2018, J Neuroscience Methods 40
Spike-Triggered Average (STA)
41
Can we use ECoG to record spikes?
42
Khodagholy et al., Nature Neuroscience, 2014
Can we use ECoG to record spikes?
43
Bouchard et al., Under review for eLife
Quiz: Which of the following statements is not
correct?
✦ A. The discrete Fourier transform converts a finite time
sequence to the frequency domain.
✦ B. In Wavelet transform, each wavelet in the linear
combination is a scaled and translated copy of a single
mother wavelet
✦ C. We can not record action potentials from the surface of
the brain
✦ D. Spike sorting can combine data recorded from multiple
electrodes to distinguish the activity of one or more neurons.
44
More signal processing
techniques next lecture!
45