Signal & Data Analysis in Neuroscience
2024
Part 1: Introduction
Izhar Bar-Gad
Room: 408 Phone: 7141 Email: izhar.bar-gad@biu.ac.il
Overview
Course logistics
Signals & data in neuroscience
Signal & data analysis
Digital signals
Course basics
Lectures: Mon. 8:15, Wed. 8:15
Izhar Bar-Gad
Email: izhar.bar-gad@biu.ac.il
Exercises: Wed. 14:00
Extra time: Sun. 14:00
Yarden Nativ
Email: biu.sigproc@gmail.com
Building 901, Room 101
1
Course Web Site
https://www.ibglab.org/sda-2024 (password: SDA2024)
Contains: contact info, presentations, recitations,
exercises, syllabus & additional links.
Jupyter notebooks of the course:
https://github.com/ibglab/BIU27505
The presentations will (hopefully) be available on the
web site at least one day before the lectures.
Send contact info to biu.sigproc@gmail.com:
Name, Email, Phone, Background
Appoint two contact persons, Erasmus and Local
Course target & non-target
Target: Provide some of the knowledge and
tools required for analyzing different
neuroscience related signals & data.
Result: The course covers a very wide range
of topics stemming from statistics, mathematics,
engineering & computer science.
Non-target: Replace the wide range of
general courses available elsewhere which are
covered briefly and specifically in this course.
Course – additional target
Link
Neuro-science
and
Data-science
2
Disclaimer
Many of the topics presented during the course
will be (over-?) simplified for our special case
and thus, in some cases may not be exact.
Some topics will even go through different
definitions as we progress through the course.
This means that in the future you might find out
that some of the things you learnt are not
exactly “the ultimate truth”.
Course requirements
Prerequisites
Python programming
Packages: jupyter, numpy, scipy, matplotlib
Probability theory, statistics
Basic calculus, algebra
Basic neurophysiology
Notes
This course is not open to external/independent
“listeners”. Every student must do the home
exercises & quizzes.
This course will require around six hours weekly for
exercises and in many cases a couple of more
hours for handling reading materials.
Syllabus
1. Signals & Data in Neuroscience
2. Stochastic processes
3. Point processes and the Poisson model (-)
4. Single process assessment (-)
5. Multiple processes assessment (-)
6. Neural encoding
7. Neural discrimination
8. Neural decoding
9. Optimization (X)
10. Information theory
11. Dimensionality reduction (-)
12. ICA (X)
13. Clustering (-)
14. Frequency domain
15. Filters
16. Spectral analysis
17. Wavelets
The order of the lessons may vary due to unforeseen reasons.
3
Course grades
Quizzes (4*10%) – 40%
2 * Computer based - Computational questions
2 * Paper based - Analytical questions
Home projects (4*10%) – 40%
4 individual home assignments, all must be submitted
Includes reading an article
Date of submissions will be sent by Yarden
No approval for late submission
Recitation quizzes – 10%
10 short questionnaires at the end of each recitation
Active participation - 10%
The final grade in the course is dependent on passing
(i.e., grade 60) each of the sections.
10
Rules
The (very) small rule
Not coming to class is fine.
Being late for class is unacceptable.
The (very) big rule
A low grade in an exercise is fine.
Cheating/copying is unacceptable.
Academic dishonesty will result in
extremely severe consequences.
11
Overview
Course logistics
Signal & data analysis
Signals & data in neuroscience
Digital signals
12
4
Definitions I
Signal is a a detectable physical quantity by
which information can be transmitted.
Information is the state of a system of interest.
Signal processing is the processing,
amplification and interpretation of signals
Signal analysis is the extraction of information
from a signal.
13
Definitions II
Data is factual information used as a basis
for reasoning, discussion, or calculation
which typically includes useful and irrelevant
or redundant information and must be
processed to be meaningful.
Data analysis is the act of transforming data
with the aim of extracting useful information
and facilitating conclusions.
(Adapted from: Merriam-Webster www.m-w.com & Wikipedia www.wikipedia.com)
14
Data analysis example I
Identifying sleep stages from EEG signal
Data: EEG (electroencephalogram)
Data processing: Amplification,
filtration, sampling & quantification.
15
5
Data analysis example II
16
Data analysis example III
Information: The state (sleep-wise) of
the patient in one of the known stages.
Data analysis: Based on assessing the
power, pattern and frequency of the
EEG and fitting to known sleep stages
the state of the patient is found.
This is not ALL the information in the
data but it is the relevant data.
17
Overview
Course logistics
Signal & data analysis
Signals & data in neuroscience
Digital signals
18
6
Signals & data in Neuroscience
Neuroscience is a wide field of research
encompassing diverse signal and data
encoding different type of information
Sources of signals & data
(Neuro-) Physiology
(Neuro-) Anatomy
(Neuro-) Biochemistry
Psychophysics
Psychology
Ethology
…
19
Signals & data - examples
Psychophysical signal of the two-choice
response of patients information regarding
mental state (schizophrenic vs. normal)
Electrical signal recorded in a deep brain
structure information regarding the
Parkinsonian state of the patient
Signal of breathing and heart pulses
information regarding mother-baby interaction
20
Signals & data in Neuroscience II
We will focus on neuronal based signals and
data (mainly neurophysiological) relating to
the function of the brain.
However, the methods are fully applicable for
anatomical, psychophysical, biochemical, etc.
and in many cases we will show examples
from other domains.
21
7
Neurophysiological signals
0
Brain
MEG, EEG
-1
PET, SPECT
-2
Map Optical Lesions
signals
(Intrinsic, fMRI
-3
dyes)
Column
-4
Neuron -5 Single cell recording
Dendrite -6 Patch Clamp
Synapse
-7
-3 -2 -1 0 1 2 3 4 5 6 7
msecond second minute hour day
Log time (sec)
22
Overview
Course logistics
Signal & data analysis
Signals & data in neuroscience
Digital signals
Recommended reading:
W. Van Drongelen, Signal processing for Neuroscientists, Chapter 2
23
Analog signals
A continuous signal in both time and
amplitude of the variable whose value
represents an analogous time varying signal.
The original signal may constitute of any
physical quantity such as electrical,
mechanical, chemical, etc.
Examples:
Audio signal representing the pressure of the
sound waves.
Dopamine signal representing the dopamine
concentration in a neural tissue.
24
8
Quantization
Quantization is the process of approximating
a continuous range of values (or a very large
set of possible discrete values) by a relatively-
small set of discrete symbols or integer values.
Quantization leads to an unavoidable error.
An analog signal is continuous, with ideally
infinite accuracy, while the digital signal's
accuracy is dependent on the resolution.
25
Quantization example
Analog signal 1 bit quantization
1 1
0 0
2 bit quantization 4 bit quantization
1 1
0 0
26
Quantization resolution
The quantization process utilizes a
range of values with specific resolution
of the original values.
The combination of range and
resolution determines the number of
bits required for the representation.
𝑟𝑎𝑛𝑔𝑒 𝑟𝑎𝑛𝑔𝑒
𝑛 = log ( ) 𝑟𝑒𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛 =
𝑟𝑒𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛 2
27
9
Quantization resolution example
Example: Recording the amplified EEG
values in the range of ±5V with 1µV
resolution requires 24 bits for the
representation.
5 (5)
n log 2 ( ) log 2 (107 ) 23.25
106
28
Quantization – variable intervals
In most cases the range is broken down to equal
intervals (typically 2X).
In some cases, variable intervals may be defined
to increase precision in part of the range.
1
29
Bad quantization
A system is set to quantize the neuronal
recording in the range of ±5V using 12 bits.
However, the spikes are not amplified but are
rather in the range of ±5mV. What happens?
A system is set to quantize the neuronal
recording in the range of ±5mV using 12 bits.
However, the spikes are amplified and are
thus in the range of ±5V. What happens?
30
10
Discrete signal
A discrete signal is a signal that has been
sampled from a continuous signal. Unlike a
continuous signal, a discrete signal is not a
continuous function but a sequence. Each
value in the sequence is called a sample.
31
Dirac’s delta function I
Dirac’s delta function (also
termed “unit impulse”), is a
generalized function which may
be viewed as a limit to a family
of functions, for example:
𝛿(𝑥) = lim 𝛿 (𝑥)
→
1
𝛿 (𝑥) = 𝑒
𝜎⋅ 𝜋
(Oleg Alexandrov, www.wikipedia.org)
32
Dirac’s delta function II
Dirac’s delta function is actually not a function.
𝛿 𝑥 =0 𝑥≠0
𝛿(𝑥)𝑑𝑥 = 1
Note: The value at x=0 is not defined.
𝛿 𝑥−𝜏 =0 𝑥≠𝜏
𝛿(𝑥 − 𝜏)𝑑𝑥 = 1
33
11
Dirac’s delta function
The sifting property
𝑓 𝑥 ⋅ 𝛿 𝑥 𝑑𝑥 = 𝑙𝑖𝑚 → 𝑓 𝑥 ⋅ 𝛿 𝑥 𝑑𝑥
0≤𝑥≤𝜎
We will use the square function family 𝛿 𝑥 =
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
𝑓 𝑥
𝑙𝑖𝑚 → 𝑓 𝑥 ⋅ 𝛿 𝑥 𝑑𝑥 = 𝑙𝑖𝑚 → 𝑑𝑥
𝜎
For 𝜎 → 0 f(x) is constant → 𝑓 0
𝑙𝑖𝑚 → ∫ 𝑑𝑥 = 𝑙𝑖𝑚 → 𝑓(0) ∫ 𝑑𝑥 = 𝑓(0)
𝑓 𝑥 ⋅ 𝛿 𝑥 𝑑𝑥 = 𝑓 0 and similarly 𝑓 𝑥 ⋅ 𝛿 𝑥 − 𝜏 𝑑𝑥 = 𝑓 𝜏
34
Kronecker’s delta
The discrete equivalent in many ways to
Dirac’s delta function.
1 𝑛=0
𝛿(𝑛) = 𝛿 =1
0 𝑛≠0
Dirac’s delta analytic calculations.
Kronecker’s delta numeric calculations.
1𝑛 =𝑘
𝛿(𝑛 − 𝑘) =
0𝑛 ≠𝑘
35
Sampling
Sampling at a single point
𝑥 (𝜏) = 𝑥(𝑡) ⋅ 𝛿(𝑡 − 𝜏) 𝑑𝑡
Sampling at a fixed interval Ts
𝑥 (𝑛𝑇 ) = 𝑥(𝑛𝑇 ) ⋅ 𝛿(𝑡 − 𝑛𝑇 ) = 𝑥(𝑡) ⋅ 𝛿(𝑡 − 𝑛𝑇 )
This group of equally spaced
delta functions is typically
called a Dirac comb
(or Shah Function)
𝐼𝐼𝐼 (𝑡) ≜ ∑ 𝛿(𝑡 − 𝑛𝑇 )
(www.wikipedia.org)
36
12
Sampling example
Original signal (10Hz sine) 50 samples/sec
1 1
0.8 0.8
0.6 0.6
0.4 0.4
0.2 0.2
0 0
-0.2 -0.2
-0.4 -0.4
-0.6 -0.6
-0.8 -0.8
-1 -1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
24 samples/sec 15 samples/sec
1 1
0.8 0.8
0.6 0.6
0.4 0.4
0.2 0.2
0 0
-0.2 -0.2
-0.4 -0.4
-0.6 -0.6
-0.8 -0.8
-1 -1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (sec) Time (sec)
37
Sampling ambiguity
Sampling the signal may lead to ambiguities of
the resulting sequence.
38
Sampling magic
39
13
For the near future
As long as we sample “fast enough”
everything will be fine.
How fast is “fast enough” ?
The “Whittaker–Nyquist–Kotelnikov–Shannon
theorem” (a.k.a. Nyquist) holds the key.
We will get to it much later in the course…
40
Digital signals
A digital signal is a signal that is both discrete
and quantized.
Incorporation of any signal into a computer or
other digital electronic equipment requires the
digitization of that signal.
41
Digitization in other domains
Common digitization domains are amplitude
and time of the signal.
Digitization may occur across additional
domain such as spatial (including multiple
dimensions), spectral, etc.
42
14
Appendix A
Neurophysiology - Methods
43
Patch clamp
Glass pipette with a ~1 micron tip.
Record the activity of ion channels, dendrites
or whole cells.
Records the changes in potential.
Temporal resolution: sub ms
Spatial resolution: sub neuron
44
Intracellular recording
Single cell recording using a penetrating or
patch clamped electrodes.
Records the subthreshold and
suprathreshold potential of the cell.
Temporal resolution: sub ms
Spatial resolution: single neuron
45
15
Extracellular recording – unit
activity
Record neuronal activity from an electrode
outside a neuron.
May record a single neuron, multiple single
neurons, or multi-neuron activity.
The potential reflect only the suprathreshold
activity (spikes) 300
200
Temporal resolution: sub ms 100
Voltage (V)
Spatial resolution: single neurons 0
-100
-200
-300
0 20 40 60 80 100
Time (ms)
46
Extracellular recording – LFP
LFP (local field potential) is recorded with
electrodes outside the neurons.
Reflects synaptic input occurring in synchrony
in a population of neurons.
Records changes in a larger volume and
typically performed through larger tip
electrodes.
Temporal resolution: milliseconds
Spatial resolution: hundreds of microns
In its extreme case LFP is EEG…
47
Electroencephalography (EEG)
Electroencephalography (EEG) is the
measurement of the electric fields produced by
neuronal activity.
Electrical fields are distorted by different
tissues decreasing spatial location.
Localization is performed y comparison of the
relative signal in multiple electrode.
Temporal resolution: sub-millisecond
Spatial resolution: >1cm
48
16
Magnetoencephalography (MEG)
Magnetoencephalography (MEG) is the
measurement of the magnetic fields produced
by electrical activity in the brain
Unlike the electrical field, the magnetic field is
not distorted by different tissues and thus
enable better spatial localization.
Temporal resolution: sub-millisecond
Spatial resolution: 1mm
49
Positron emission tomography (PET)
A positron emitting radionuclide is
injected (e.g., 2-deoxyglucose).
Positrons interact with electrons
which produce photons (gamma
rays) traveling in opposite
directions.
PET scanner detects the pairs of
photons.
Temporal resolution: minutes
Spatial resolution: 5mm
50
Functional magnetic resonance
imaging (fMRI)
Hemoglobin has different magnetic
properties based on its oxygenation.
Changes in blood oxygenation are
linked to neuronal activity.
A strong magnetic field aligns the
molecules, and a specific
electromagnetic frequency perturbs
the atoms leading to emission of
electromagnetic energy.
The resulting signal – BOLD:
Blood Oxygenation Level Dependent
Temporal resolution: seconds
Spatial resolution: 2-3 mm
51
17