You are on page 1of 35

BioE 460/560 EE 400D CSE 490N

Signal Processing for Neural Engineering:


Part II

1
Neural Computation &
Engineering lab (BIOEN/EE 466/566)

✦ Hands-on experience! Example labs


➭ Record / stimulate nervous Stimulate a
system cockroach
leg to make
➭ Neural “decoding” it dance to
➭ Control devices with music
neural activity

✦ 4 credits (1h lecture + 3h lab) Build and


test a
✦ Pre-reqs: same as bioen/ee 460 muscle
✦ Matlab programming
interface
to control
Winter 2021 tentative plan for hybrid a
(in person + virtual options) computer
cursor

2
Components of a Brain-Computer Interface

Classification
or Regression

3
Last Lecture: Frequency Domain and Wavelet
analysis of time-varying signals

Today:
Time-domain analysis and time-frequency
analysis of time-varying signals

4
Time domain analysis
✦ Signal matching

✦ Communication between different areas

✦ Connection between different areas

✦ Understand oscillatory activities across areas

✦ Pattern of oscillations

5
Signal matching: Cross Correlation
✦ Cross correlation is used to find where two signals match
'& ∗ '& ∗
✦ 𝑤 𝑡 = ∫%& 𝑢 𝑡 𝑣 𝜏 + 𝑡 𝑑𝜏 = ∫%& 𝑢 𝜏 − 𝑡 𝑣 𝜏 𝑑𝜏

6
Signal matching: Cross Correlation
✦ u(t) is the test waveform

Example 1: Example 2:
v(t) contains u(t) with an Example 3:
unknown delay and added noise y(t) is the same as v(t) with p(t) contains –u(t)
more noise

w(t) gives a peak at the time lag z(t) can still detect the q(t) has a negative peak
where u(t-t) best matches v(t) correct time delay
7
Signal matching: Cross Correlation
✦ Cross correlation is used to find where two signals match
'& ∗ '& ∗
✦ 𝑤 𝑡 = ∫%& 𝑢 𝑡 𝑣 𝜏 + 𝑡 𝑑𝜏 = ∫%& 𝑢 𝜏 − 𝑡 𝑣 𝜏 𝑑𝜏
✦ Normalized cross-correlation

0(2)
✦ 𝑧 𝑡 =
4546

✦ Autocorrelation: The correlation of a signal with itself

✦ Autocorrelation is used to find when a signal is similar to


itself delayed.

8
Signal matching: Coherence
Cross spectral density
=
𝐺89(<) Fourier transform of
𝐶89 𝑓 = the cross-
Coherence 𝐺88(<) 𝐺99(<) correlation function

Autospectral density of x and y

✦ Spectral equivalent of the cross-correlation function

✦ 0 ≤ Coh2(f) ≤ 1

✦ If x & y are independent → coherence=0

✦ If x & y are identical → coherence=1

9
Signal matching: Coherence

=
𝐺89(<)
𝐶89 𝑓 =
𝐺88(<) 𝐺99(<)

✦ measures the interdependence of x and y

✦ Example:

✦ x and y might be largely independent of each other

✦ synchronized at times within a narrow frequency range

✦ x and y are only interdependent in that frequency range

10
Coherence as a Measures of Connectivity

Connectivity measured in response to stimulation

Coherence: during spontaneous activity

11
Yazdan-Shahmorad and Silversmith et al., eLife, 2018
Current source density analysis
✦ Density of current entering or leaving the extracellular
medium
✦ The second derivative approximation of the field potential
between two adjacent electrodes

12
https://www.semanticscholar.org/
Current source density: LFP

13
Kajikawa & Schroeder, Neuron, 2011
Current source density: EEG

14
Tenke & Kayser, Clinical Neurophysiology, 2005
Five minute break

15
Time frequency analysis

16
Time-frequency analysis: Spectrogram

17
http://ssp-iiith.vlabs.ac.in/
Example: Spectrogram

18
Yazdan-Shahmorad et al, J Neur Eng, 2013
Wavelets versus Spectrograms

spectrogram: fixed window length,


Wavelet: windows that are longer for lower frequencies and
shorter for higher frequencies.

Deng et al, J Neur. Eng., 2010 19


Phase-Amplitude Coupling

20
Samiee & Baillet, NeuroImage, 2017
Example 1: Phase-Amplitude Coupling
Exaggerated phase–amplitude coupling in Parkinson disease:
Gamma in motor cortex coupled to Beta in thalamus

Hemptinne, et al, PNAS, 2013 21


Example 2: Phase-Amplitude Coupling

Exaggerated phase–amplitude coupling in Stroke:


High gamma in motor cortex coupled to theta in hippocampus

22
He et al, 2019, J Cerebral Blood Flow and Metabolism
Quiz: Which of the following statements is
correct?
✦ A. Coherence can be used as a measure of connectivity.

✦ B. Cross correlation is used to find where two signals match

✦ C. Current-source density calculates the


density of current entering or leaving the extracellular
medium
✦ D. All of the above

23
Inducing Oscillations using optogenetics

High Gamma (60-200 Hz) Gamma (30-60 Hz) Beta (12-30 Hz)
10Hz
20Hz
30Hz
35Hz
40Hz
50Hz
70Hz
100Hz
150Hz

24
Yazdan-Shahmorad et al., IEEE EMBC, 2018
Inducing Phase-Amplitude Coupling
A B
A A 1 B B Stim Location 1 Stim Location 2
1 1 StimStim
Location 1 1
Location StimStim
Location 2 2
Location
2 High Gamma
2 2 High Gamma
(60-200
High Hz)
Gamma
(60-200 Hz)
(60-200 Hz)
Beta
M1 S1 Beta Beta
(12-30 Hz)
M1 M1S1 S1 (12-30(12-30
Hz) Hz)

Laser 1 3-200 Hz
Laser
LaserLaser
1 2 3-2003-200
Hz Hz
1 100 μV
LaserLaser
2 2 100 μV100 μV50 ms
50 ms50 ms

C Before Stim After


C C Before
Before StimStim After
After

Index
1200
/ Hz

/ Hz

/ Hz
150 150 150

Modulation Index
1200 1200

Index
Amp freq / Hz

Amp freq / Hz

Amp freq / Hz
/ Hz

/ Hz

/ Hz
150 150 150 150 150 150
freq

freq

freq

Modulation
freq

freq

freq
100 100 100

Modulation
Amp

Amp

Amp
100 100 100 100 100 100
Amp

Amp

Amp
50 50 50
50 50 50 0
50 50 50
0 0
50 100 150 50 100 150 50 100 150
50 50 100 100 150
Phase freq150
/ Hz 50 100 100
50Phase 150 / 150
freq Hz 50 50 100
Phase 150 150
100freq / Hz
Phase freq freq
Phase / Hz / Hz Phase freq freq
Phase / Hz / Hz Phase freq freq
Phase / Hz / Hz 25
Yazdan-Shahmorad et al., IEEE EMBC, 2018
Feature extraction
✦ Frequency analysis (e.g. Power spectrum)

✦ Time domain analysis (e.g. cross correlation)

✦ Time-frequency analysis (e.g. Spectrogram)

✦ Spike sorting (e.g. Firing rate)

26
Hand kinematics from neural recording

27
Discussion: Hand kinematics from neural
recording
✦ How to implement brain control?

✦ What type of analysis?

https://news.brown.edu 28
Decoding movement
✦ population vector algorithm

✦ linear filtering

✦ artificial neural networks

✦ probabilistic methods

29
Kalman filter
✦ Optimal estimation algorithm

✦ Estimate a system’s state when it can not be measured


directly
✦ Extracting information from what you can’t measure from
what you can
✦ Measurements are available from various sensors but might
be subject to noise

30
Kalman filter
✦ Named after Rudolf Kalman (1930-2016)

✦ Common applications:
➭ Guidance and navigation systems
➭ Computer vision
➭ Signal processing

✦ First application?

Estimate the
trajectories of the
spacecraft

31
Apollo Project
Kalman filter

Brain Neural activity


(firing rate)
(zk)

Hand kinematics
(xk) +
-

Mathematical 𝑧>?
model
𝑥>?

Kalmen
filter

32
Kalman filter
✦ Estimate the state of the hand at the current time: xk

✦ xk: position, velocity and acceleration in 3D

✦ Assume the state is linearly related to the observations: zk

Noise: N(0,Qk) Noise: N(0,Wk)

Matrix that
linearly relates the
hand state to the
neural data Coefficient matrix

Kalman filter model from training data using least squares estimation

33
Wu et al, NIPS, 2003
Kalman filter

Noise: N(0,Qk) Noise: N(0,Wk)

Matrix that
linearly relates the
hand state to the
neural data Coefficient matrix

Two-step decoding:
1- prediction of the a priori state estimate
2- updating this estimate with new measurement data to produce a posteriori state estimate

34
Wu et al, NIPS, 2003
Kalman filter implementation

35

You might also like