Simply EEGLAB
Time-frequency: ERSP & ITC
Station 6 · Lesson 4 · EEGLAB 2026.1
In the GUI
- Plot channel time frequency -- pop_newtimef()Channel number...
14 - Sub epoch time limits [min max] (msec)
- Frequency limits [min max] (Hz) or sequence
3 30 - Baseline limits [min max] (msec) (0->pre-stim.)
0 - Wavelet cycles [min max/fact] or sequence
3 0.8 - Optional newtimef() arguments (see Help)
'winsize', 128 - 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?
| Setting | Value |
|---|---|
| Number of cycles | 3 0.8 (the default) |
| Window length | 'winsize', 128 (1 second at 128 Hz) |
| Frequency range | 3 to 30 Hz |
| Baseline | 0 (everything before the stimulus) |
| Channel | Cz 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).