Simply EEGLAB
ICA, simply explained
Station 4 · Lesson 1 · EEGLAB 2026.1
Script
eeglab nogui; % puts runica on the MATLAB path
srate = 128;
t = (0:10*srate-1) / srate;
brain = sin(2*pi*10*t); % steady 10 Hz rhythm
n = round(0.3*srate);
win = 0.5 - 0.5*cos(2*pi*(0:n-1)/(n-1)); % smooth bump for one blink
blink = zeros(size(t));
blink(round([1.5 4 6.5 9]*srate)) = 1;
blink = 5 * conv(blink, win, 'same'); % four large, slow blinks
muscle = 0.5 * randn(size(t)); % fast, irregular activity
S = [brain; blink; muscle];
A = [1.0 0.8 0.3; % frontal channel: strong blink
0.9 0.2 0.4; % central channel
0.7 0.1 1.0]; % temporal channel: strong muscle
X = A * S;
[weights, sphere] = runica(X, 'extended', 1);
act = weights * sphere * X;
figure;
for k = 1:3
subplot(3, 2, 2*k-1); plot(t, X(k, :)); title(sprintf('Channel %d (mixture)', k));
subplot(3, 2, 2*k); plot(t, act(k, :)); title(sprintf('ICA component %d', k));
endWhich value should I choose?
| In the idea | In EEGLAB | What it means |
|---|---|---|
| The way to recombine the channels | EEG.icaweights and EEG.icasphere | What ICA learns. Multiplying them by the data gives the components. |
| The shape of a component in time | EEG.icaact | The time course of each ICA component. |
| Where a component is on the head | EEG.icawinv | Each column is the scalp map of an ICA component: how much it contributes to each channel. |
| Number of components | Equal to the data rank, which is never more than the number of channels | In D1 after average reference and with no interpolated channel: 31 components from 32 channels. Each interpolated channel removes one (see Running ICA). |
Check
- You can explain the party
- You know the two parts of an ICA component
- If you ran the script