Pre-processing
for EEG and MEG
Przemek Tomalski
&
Kathrin Cohen Kadosh
Recording EEG
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
Two crucial steps
Activity caused by your stimulus (ERP) is
‘hidden’ within continuous EEG stream
ERP is your ‘signal’, all else in EEG is ‘noise’
Event-related activity should not be random, we
assume all else is
Epoching – cutting the data into chunks referenced
to stimulus presentation
Averaging – calculating the mean value for each
time-point across all epochs
Extracting ERP from EEG
ERPs
emerge from
EEG as you
average
trials
together
Overview Pre-processing
Converting the data
Epoching/Segmentation
Filtering
Artifact Detection/Rejection
Averaging
Re-referencing
Convert the data
Overview Pre-processing
Converting the data
Epoching /Segmentation
Filtering
Artifact Detection/Rejection
Averaging
Re-referencing
Epoching
Segmenting (Epoching)
Segment length: at least 100 ms should precede the stimulus onset (see
baseline correction). The time - frequency analysis can distort the signal
at both ends of the segment, make sure you do not lose important
data and that the baseline segment is still long enough after cutting off the
affected portions. The affected segment length depends on the frequency
in an inverse manner (length ms ~ 2000/freq Hz)
The segment should not be too long nevertheless, the longer it is the
bigger the chance to include an artifact!
Epoching - SPM
Overview Pre-processing
Converting the data
Epoching/Segmentation
Filtering
Artifact Detection/Rejection
Averaging
Re-referencing
Filtering
Types of filters:
highpass
lowpass
notch (stopband filter)
Butterworth (bandpass filter, backward and forward)
! (require signal processing toolbox in Matlab)
Effects of filtering the raw data
L
o
w
p
a
s
s
3
0
H
z
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
R
a
w
d
a
t
a
h
i
g
h
p
a
s
s
0
.
3
H
z
Filtering in SPM
Overview Pre-processing
Converting the data
Epoching/Segmentation
Filtering
Artifact Detection/Rejection
Averaging
Re-referencing
Artifacts in EEG signal
Blinks
Eye-movements
Muscle activity
EKG
Skin potentials
Alpha waves
Eye blinks
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
Eye movements
QuickTime™ and a
TIFF (Uncompressed) decompressor
are needed to see this picture.
Sweat artifacts
Q
u
i
c
k
T
i
m
e
™
a
n
d
a
T
I
F
F
(
U
n
c
o
m
p
r
e
s
s
e
d
)
d
e
c
o
m
p
r
e
s
s
o
r
a
r
e
n
e
e
d
e
d
t
o
s
e
e
t
h
i
s
p
i
c
t
u
r
e
.
Artefact detection - SPM
Artifact correction
Rejecting ‘artifact’ epochs costs you data
Using a simple artefact detection method will lead
to a high level of false-positive artifact detection
Rejecting only trials in which artifact occurs might
bias your data
Alternative methods of ‘Artifact Correction’ exist
Artifact correction - SPM
SPM uses a robust
average procedure to
weight each value
according to how far
away it is from the
median value for that
timepoint
Weighting
Value
Outliers are
given less
weight
Points close
to median
weighted ‘1’
Artifact correction - SPM
Normal
average
Robust
Weighted
Average