In this tutorial, we will use an established paradigm in psycho-physiological research that targets both visual and emotional processing. Several of the dependent metrics used here are also utilized in different experimental contexts, and the "how-to's" apply and generalize to various research directions.

In particular, the paradigm consists of the presentation of visual scenes under three different conditions: neutral, pleasant, and unpleasant images. The images are sourced from the International Affective Picture System (IAPS) developed and maintained at the Center for the Study of Emotion and Attention. Each image is presented for 2 seconds, followed by an inter-image baseline interval of 3 seconds (±1 second). During this baseline interval, participants are instructed to maintain their gaze direction on a fixation cross. Apart from this, they are asked to passively view the images, with no other tasks included.

This paradigm is well-suited for analyzing and evaluating both early and late evoked potentials, as well as oscillatory brain activity at both scalp and source levels. Each of these analytical approaches is illustrated and discussed in the present tutorial.

The EEG has been recorded with a 128 electrode system (ANT neuro).

Event-related potential

The data have been already read in and preprocessed to remove artifacts due to cardiac and oculomotor activity. If you are interested in how to read-in different file formats or various options in dealing with artifacts such as visual inspection or by means of ICA you could explore the various options on the FieldTrip website or contact the mailing list.

First, we load the data and evaluated its content.

%% load data
load data

This is the data structure with its subfields:

   fsample: 500
      time: {1×298 cell}
     trial: {1×298 cell}
     label: {125×1 cell}
      elec: [1×1 struct]
sampleinfo: [298×2 double]
 trialinfo: [298×1 double]
       cfg: [1×1 struct]

There are several sub fields containing relevant information about the data such as the sampling rate data.fsample, the time stamps for each trial data.time and data.trial respectively. The electrode labels are stored within the field data.label. The 3D position of the actual electrodes is however stored in the sub field data.elec. Here we use standard digitized positions. Note that individually digitized electrode positions are preferable option.

The field data.trialinfo contains information about the association of the individual trials with the three conditions. In this case vaue of 1 corresponds to the pleasant, 2 unplesant and 3 neutral conditions. The indices of these conditions are identified first.


The data has been acquired using the CPz electrode as a recording reference. We transform the data into an average reference montage and apply a low pass filter using ft_preprocessing and baseline correction using ft_timelockbaseline.

%% re-ref
cfg =[];
cfg.reref         = 'yes';
cfg.refchannel= 'all';
cfg.demean = 'yes';
data = ft_preprocessing(cfg,data);
%% apply low pass filter
cfg = [];
cfg.lpfilter = 'yes';
cfg.lpfreq = [45];
cfg.lpfilttype = 'firws';
datafilt = ft_preprocessing(cfg,data)

Now we are ready to split the data into the three experimental conditions. We use ft_timelockanalysis by specifying the length of the data we want to include with the configuration option cfg.latency, the trials we want to assign to a given condition cfg.trials, and preserve the individual trials in the output using cfg.keeptrials.