Simply EEGLAB

Time-frequency: ERSP & ITC

Station 6 · Lesson 4 · EEGLAB 2026.1

In the GUI

  1. Plot channel time frequency -- pop_newtimef()Channel number... 14
  2. Sub epoch time limits [min max] (msec)
  3. Frequency limits [min max] (Hz) or sequence 3 30
  4. Baseline limits [min max] (msec) (0->pre-stim.) 0
  5. Wavelet cycles [min max/fact] or sequence 3 0.8
  6. Optional newtimef() arguments (see Help) 'winsize', 128
  7. Plot Event Related Spectral PowerPlot Inter Trial CoherenceOk

Script

cz = find(strcmp({EEG.chanlocs.labels}, 'Cz'));
figure;
[ersp, itc, powbase, times, freqs] = pop_newtimef(EEG, 1, cz, ...
    [EEG.xmin EEG.xmax]*1000, [3 0.8], 'freqs', [3 30], 'winsize', 128, ...
    'baseline', 0, 'padratio', 1, 'plotphase', 'off');
itcMag = abs(itc);
fprintf('Frequencies %.1f to %.1f Hz, times %.0f to %.0f ms\n', ...
    freqs(1), freqs(end), times(1), times(end));
[maxItc, idx] = max(itcMag(:));
[fi, ti] = ind2sub(size(itcMag), idx);
fprintf('Max ITC %.2f at %.1f Hz, %.0f ms\n', maxItc, freqs(fi), times(ti));

Which value should I choose?

SettingValue
Number of cycles3 0.8 (the default)
Window length'winsize', 128 (1 second at 128 Hz)
Frequency range3 to 30 Hz
Baseline0 (everything before the stimulus)
ChannelCz here

For your Methods

Event-related spectral perturbation and inter-trial coherence were computed at Cz with newtimef using Morlet wavelets whose number of cycles increased linearly from 3 at 3 Hz to 6 at 30 Hz, relative to a −500 to 0 ms prestimulus baseline (EEGLAB 2026.1).

Full lesson: https://simplyeeglab.pages.dev/en/lesson/ersp-itc/

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

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