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));
end

Which value should I choose?

In the ideaIn EEGLABWhat it means
The way to recombine the channelsEEG.icaweights and EEG.icasphereWhat ICA learns. Multiplying them by the data gives the components.
The shape of a component in timeEEG.icaactThe time course of each ICA component.
Where a component is on the headEEG.icawinvEach column is the scalp map of an ICA component: how much it contributes to each channel.
Number of componentsEqual to the data rank, which is never more than the number of channelsIn 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

Full lesson: https://simplyeeglab.pages.dev/en/lesson/ica-concept/

Content license: CC BY-NC-SA 4.0 · MIT (code)

An independent learning site, not affiliated with EEGLAB or SCCN.