Pipeline
EEG: cleaning, ERPs, scalp maps, statistics and time–frequency
The EEG Analysis window takes one file per participant, raw or already cleaned. Raw recordings are cleaned in the window (bad channels, filters, re-reference), cut into trials at named events and the noisy trials rejected; then the trials of each condition are averaged into ERPs, a component is measured in a time window and drawn on the head (scalp maps), the conditions are compared across participants and the time–frequency of each condition shows how the oscillations change (ERSP, phase locking, band power). EEG already cleaned in EEGLAB, FieldTrip or MATLAB is read as it is. It works for scalp EEG and for rodent skull-screw recordings.
The eight steps
- Load EEG: click Load EEG files… and choose one file per participant (select several at once for a group), or Try demo data (8 cleaned participants) / Try raw demo (continuous, not cleaned) (3 raw recordings). EEGLAB .set, FieldTrip .mat, BrainVision .vhdr (keep the .vmrk and .eeg files in the same folder), EDF / BDF, XDF and EEG-BIDS files are read as they are (export other systems' recordings to one of these, for example EDF, from their own software); for a plain .mat file a short form asks which variable holds the numbers, the sampling rate and the order of channels, samples and trials.
- Read the Overview tab: for every participant it lists the channels, trials per condition, reference, electrode positions and what was already done to the data (filters, re-referencing, ICA, rejected trials, interpolated channels), read from the file, and then every step done here. Nothing in the file is run.
- Electrode layout… (step 1, under the file information): the line under it says how many channels have a position (for example 32 of 32 channels placed: 32 from the file.) and whether you confirmed the layout. Click it, look at the drawing and the Status column, change the Source, load a Positions file… or type a name in As if something is wrong, and click Use this layout (details). Positions are needed only for scalp maps; everything else works without them.
- Clean recordings (raw data; skip it for data already cleaned): choose a Participant and type its Bad channels (or click Suggest: flat or very noisy channels), set the High-pass (for example 0.1 Hz, 0 = off) and Low-pass (for example 30 Hz) filters, a Notch for line noise if needed (50 or 60 Hz and harmonics), the Reference (As recorded, Average of the good channels, Linked mastoids or chosen Channels) and click Apply.
- Trials: for a continuous recording type the Events and names (for example
S 1 = Standard, S 2 = Target; empty = every event, named as in the file), the Trial from / to (ms), tick Reject trials with a Peak-to-peak threshold (for example 100 µV) and/or an Absolute one, and click Cut into trials. For files already cut into trials the button is Apply rejection. The info line gives the trials left and rejected per condition, and the channels that caused most rejections; the Checks tab lists what was checked in the trials (click a row for why it matters and what to try; Show ERPs and Measure update it; details). New files start steps 2 and 3 from their defaults (0.1–30 Hz for continuous recordings, no filter for trials already cut, reference as recorded, no events typed, Reject trials off). - ERPs: keep Subtract a baseline (−200 to 0 ms by default) unless the data are already baseline-corrected, type the Channels to plot (for example
Pz, orCz, FCzto average them) and click Show ERPs. Above the plot, choose a participant or the grand average and the view: Conditions, All channels (butterfly) or Difference wave. - Measure: Mean amplitude (recommended) or Peak amplitude with its direction, in a time window at the chosen channels. The Measures tab has one row per participant and condition. A peak on the edge of the window is flagged, because it may not be a real peak.
- Scalp maps (step 5, next to Measure): the mean voltage of every electrode in the same window, drawn on the head (or on the skull for rodents): one map per condition and one of A minus B (the conditions in the bar above the plot), for the participant shown or the grand average, all on one colour scale (red positive, blue negative). Show → Conditions brings the ERPs back. Maps use the electrode layout of step 1: confirm it first (Electrode layout… → Use this layout; details).
- Statistics (two or more participants): Parametric or Nonparametric, then Compare conditions. Participants are matched across conditions: a paired t-test (or Wilcoxon) for two conditions, a repeated-measures ANOVA with post hoc tests (or Friedman) for three or more. The Checks tab adds the checks of the test (sample size, normality, sphericity).
- Time–frequency (optional): type the Frequencies (for example 4 to 40 Hz), the Wavelet cycles (3 for trials of about 1 s), the Baseline (for example −200 to 0 ms), the Channels (for example
Oz; empty = those of step 4) and the Band, and click Time–frequency. The plot shows Time–frequency (ERSP): one image per condition and one of A minus B (the conditions in the bar above the plot), the power in dB against the baseline (red: more power, blue: less). Show → Phase locking (ITPC) and Band power give the others. Grey means no value: there the wavelet would reach beyond the trial; the line under the button says which frequencies and times these trials allow (details). - Save: Export results… writes a .csv with one row per participant and condition, or a .mat with everything. Save session… (it replays every cleaning step from the files), Report (PDF)… and Methods text… keep the analysis.
Electrode layout
Electrode layout… in step 1 opens the Electrode layout window for the first participant (every participant has the same channels): every electrode drawn on the head seen from above (nose up, right ear on the right) or, for rodents, on a skull outline with bregma; a table with one row per channel (Channel, Placed from, As, Status; on a skull also AP and ML in mm); the summary and notes; Cancel and Use this layout. New files start with From the files, others by name, not confirmed; the line under the button says Not checked yet until you click Use this layout.
Where the positions come from (Source)
- From the files, others by name (the default): positions stored in the file come first (EEGLAB
chanlocs, FieldTripelec, BrainVision coordinates, BIDSelectrodes.tsv); channels without one are placed by name on the 10-5 system. - By name (10-5 system): every channel by its name; the file's positions are ignored.
- From a positions file: click Positions file… and choose the file of your cap or digitizer (positions file formats); its positions are matched to the channels by name and used instead of the file's.
The 10-5 template
The 345 positions of the 10-5 system[37], which holds every 10-20 and 10-10 position, computed on an idealized spherical head with the equator through Nz, T9, Iz and T10[38]. These are idealized directions, not the head of your participant: for source analysis, measure the positions.
Names
Names match in any case (FP1 = Fp1); the old names T3 / T4 / T5 / T6 are read as T7 / T8 / P7 / P8; a leading EEG and a reference suffix (-REF, -LE, -AR, -AVG, -A1, -A2, -M1, -M2) are dropped, so EEG Fp1-REF is Fp1. Bipolar names (Fp1-F7), A1, A2, M1, M2 (ear lobes, mastoids), EOG, ECG, EMG and other non-scalp channels get no position.
One orientation
Every position is turned to x = right ear, y = nose, z = up (the frame of BrainVision, BESA, MNE-Python and MNI) from the frame its file states (EEGLAB, FieldTrip, BrainVision, BIDS) and whatever the unit; on the scalp the direction from the centre of the head is used. So the same electrode from different files lands in the same place. Orientation check: when 3 or more channels with positions in the file also have 10-5 names, their positions are compared with the template; if they look turned by 90° (a file that does not say its axes), the other orientation is used and a note says so; if neither fits, a note asks you to check the drawing.
Rodent (skull) layouts
Positions that all lie at one height are a skull layout in mm from bregma: AP anterior +, ML right +. The drawing shows them on a skull outline with bregma and the midline, and the table has the columns AP (mm) and ML (mm) to edit. For a recording without positions (EDF, BDF, XDF, plain .mat), load a positions file: a .csv with the columns name, ap, ml.
The check (Status column) and editing
- placed; renamed (T3 → T7) (found under its 10-20 name or after cleaning the name); no position; same place as another channel (the same 10-5 name, or less than 2° apart; 0.2 mm on a skull); outside the head (more than 120° from the vertex, that is far below the ears; on a skull more than 15 mm from bregma). The notes below the table say what was assumed (axes, units) and what was turned.
- In the scalp table type a 10-5 name in As to place a channel there (for example
Izfor a channel calledX1); empty it to leave the channel without a position. In the skull table type AP (mm) and ML (mm). The drawing and the check update at once. - Use this layout confirms the layout, closes the window and updates the line under the button and the Overview; Cancel keeps the layout as it was. A session keeps the source, the positions file and your edits, and the methods text says where the positions came from (only once confirmed).
Without positions
Everything except scalp maps works without positions: cleaning, trials, ERPs, measures, statistics and time–frequency use the channel names. Scalp maps use the layout shown in the line under Electrode layout… (step 1); until you confirm it with Use this layout, the maps say so. BioSemi (A1–D32) and EGI HydroCel templates are not built in yet (their licences are being checked): load the manufacturer's coordinate file as a positions file (the BioSemi Site Theta Phi list, the EGI .sfp).
Walkthrough: the demo layouts
Cleaning and trials
A fixed order
Every button rebuilds from the files in a fixed order: bad channels → filters → reference → cut into trials → reject trials, so changing an earlier setting and clicking again never filters twice, and a session replays the same steps.
Bad channels
Bad channels are left out of the average reference, the trial rejection, the ERPs and the measures (their lines are missing in the butterfly view; the grand average of a channel uses the participants where it is good). They are not re-referenced: their data stay as recorded. Suggest flags channels whose typical spread (the median over 1-s pieces of the standard deviation) lies more than 5 robust z-scores from the other channels, or below 0.5 µV (flat); check them on the butterfly view before accepting. In EEG-BIDS files, channels with status bad in channels.tsv are marked bad.
Filters
Zero-phase FIR filters (Hamming-windowed sinc) designed following the recommendations of Widmann, Schröger and Maess (2015)[36]. The value typed is the passband edge; the transition below a high-pass is min(max(0.25 × f, 2 Hz), f) and above a low-pass min(max(0.25 × f, 2 Hz), Nyquist − f), so the −6 dB cutoff lies in the middle of the transition, half a transition beyond (0.1 Hz high-pass: −6 dB at 0.05 Hz; 30 Hz low-pass: −6 dB at 33.75 Hz). The order of each filter is 3.3 × sampling rate / transition, rounded up to an even number (0.1 Hz at 500 Hz: 16 501 taps, 33 s); a band-pass is the high-pass and the low-pass combined into one filter. The filter delays nothing (its taps are symmetric). So filter the continuous recording, not short trials; at each end the recording is extended by its mirror image turned upside down (so level and slope continue smoothly) for half the filter length. A high-pass of 0.1 Hz keeps slow ERP components such as the P300; higher values (1 Hz) distort them. The notch removes 50 or 60 Hz and its harmonics, each from 0.5 Hz below to 0.5 Hz above (wide enough for the small drift of the mains frequency), with 1 Hz transitions (−6 dB at ± 1 Hz, everything outside ± 1.5 Hz kept); a low-pass below the line frequency already does. The methods text gives the edges, transitions, −6 dB cutoffs and order of every filter.
Reference
Average subtracts the mean of the good channels from every good channel; Linked mastoids the mean of TP9 and TP10 (or M1 / M2, A1 / A2); Channels the mean of the channels typed (a single channel becomes 0). The online reference (for example FCz) is not in the data and cannot come back. The Overview and the methods text give the reference used.
ICA, interpolation and advanced cleaning
Eye movements, muscle and bridged channels are not cleaned here: do it in EEGLAB (pop_runica, ICLabel, pop_interp) or FieldTrip (ft_componentanalysis, ft_channelrepair) and load the cleaned file (.set or FieldTrip .mat); its history is read into the Overview and the methods text. Load it as it is and skip step 2, or use step 3 only to reject trials.
Trials
- Events and names: event types match ignoring case and repeated spaces (
S 1finds the BrainVision markerS 1); the name given becomes the trial's condition. Trials across a gap in the recording (EEGLABboundaryevents) are left out, as are events too close to the start or end (the Overview says how many). - Reject trials: a trial is rejected when, on any good channel, its peak-to-peak amplitude (largest minus smallest value in the trial) or its absolute amplitude (largest distance from 0 µV) exceeds the threshold. 100 µV peak-to-peak after a 0.1–30 Hz band-pass is a common start for adults; if many trials go, look at the channels named in the info line (mark them bad) rather than raising the threshold. The methods text gives the event names and the trials rejected per condition.
Walkthrough on the raw demo
Checks
After Cut into trials / Apply rejection (step 3), Show ERPs (step 4) and Measure (step 5), the Checks tab gives one row per check over every participant: the worst participant sets the result and the text names the participants (worst first). Click a row for why it matters and what to try. The same checks run in Batch processing (the Checks column). They never change a number.
- Trials per condition: the fewest trials left in any condition: Check below 20 (enough for a large component such as the P300, noisy for small ones such as the N1 or an N400 difference), Warning below 10 (an ERP from fewer than 10 trials is mostly noise).
- Rejection balance (when the trials were rejected here): the share of each condition the rejection left out: Check when two conditions differ by more than 20 percentage points (and the more rejected one lost at least 3 trials), Warning above 40 points. Artefacts that come with one condition (for example blinks after targets) leave trials that are no longer comparable. A Note when the trials were rejected before loading (the history says so): the share of each condition is then not known.
- Condition balance: one condition with more than 2 times as many trials as another is a Check with the peak amplitude (the average of fewer trials keeps more noise, so its peaks come out larger) and OK with the mean amplitude, which the number of trials does not bias (rare conditions are the point of an oddball design).
- Bad channels: Check above 10% of the channels, Warning above 20%. Bad channels are left out of the ERPs, the measures and the average reference, so the reference and the scalp maps rest on fewer channels; so many bad channels often mean a poor recording (cap fit, gel, impedances).
- Interpolated channels (read from the history: EEGLAB
pop_interp, FieldTripft_channelrepair): Warning when every measured channel (step 5, else the channels of step 4) was interpolated in a participant: the value is an estimate from the neighbours, not a recording (peaks are smoothed and the neighbours' signals count twice); Check when some of them were, or when the history does not say which channels; OK otherwise. - Checks of the test (after Compare conditions, step 6; listed after the rows above, gone with a new measure): the same checks as Signal Characterization's statistics, for participants. Sample size: Check below 8 participants (one participant can change the verdict), Warning below 3 or when the rank-based test reported cannot give p below 0.05 with this n (exact Wilcoxon: 2 / 2ⁿ, e.g. 0.0625 for 5 participants). Normality: Shapiro–Wilk on the paired differences (2 conditions) or on the residuals (3 or more: each value minus its participant's and its condition's mean): Check at p < 0.05, Warning when the rank-based test also gives another verdict; OK with a rank-based result; the most extreme participant is named. Sphericity (repeated-measures ANOVA, 3+ conditions): Check when Mauchly's test rejects it (the Greenhouse–Geisser corrected p is reported), Warning when the correction changes the verdict at 5%. Robustness check: a Check when the parametric and the rank-based tests disagree. Missing values: a Check when participants were left out because they have no value in a condition (no trials left in it). The Statistics tab sums them up.
OK is green, Check amber, Warning red, Note grey. The checks are saved in the session, listed on the PDF report (warnings first) and summed up in the methods text.
Scalp maps
Scalp maps in step 5 (or Scalp maps in the Show list above the plot) takes, for every electrode, the mean voltage of the ERP from Window from to Window to (the same window as Measure; type the same time twice for a single moment, for example 100 to 100 ms) and spreads it over the head. One map per condition and one of A minus B; the bar above the plot chooses the participant (or the grand average) and A and B. Measure with the maps shown draws them again for the new window. A session keeps the maps (window, participant, conditions), and the methods text and the report describe them.
Colours
All maps share one colour scale, symmetric about 0 µV: red positive, blue negative, white 0, with contour lines.
Scalp and skull layouts
A scalp layout gives a map of the head seen from above (nose up), out to the outermost electrode; values outside the electrodes are extrapolated and less certain. A skull layout (mm from bregma) gives a flat map drawn only inside the outline of the electrodes, because nothing is known outside them: a few skull screws give a coarse map, so read it as a smooth guess between the screws. How the values between the electrodes are computed is under Methods.
Electrodes used and left out
Electrodes used are black dots; channels left out (bad channels, channels without a position or without a value) are grey rings or are not drawn, and the line above the maps lists them. At least 3 electrodes are needed (on a skull, not all on one line).
The reference
Maps show voltages against the reference of the data: an average reference makes the map sum to about zero over the electrodes, so a positive focus comes with negative values elsewhere; a mastoid reference gives other maps of the same data.
Walkthrough: scalp maps on the demo
Time–frequency
Time–frequency (step 7, optional) shows how the power and phase of each frequency change around the event, for every condition, at the Channels chosen, per participant and across participants. Show above the plot chooses Time–frequency (ERSP) (one image per condition and one of A minus B), Phase locking (ITPC) (one image per condition) or Band power (one line per condition). It does not change the ERPs, measures or statistics; a session keeps its settings and the view, the .mat export holds every result and the methods text describes it.
Wavelet cycles
Wavelet cycles set the trade-off: a wavelet of n cycles at f Hz lasts about n / f s (3 cycles at 10 Hz: 0.3 s, cut at ±0.14 s). Fewer cycles give finer timing and coarser frequencies; more cycles the opposite. 3 cycles suit trials of about 1 s; 5 to 7 cycles longer trials.
Grey means no value
A value is kept only where the whole wavelet lies inside the trial, so it is exactly what a longer recording would give (nothing is padded or mirrored). Low frequencies have long wavelets, so they lose more of the trial edges, and a frequency whose wavelet never fits inside the Baseline has no ERSP. The line under the button gives the lowest frequency with values and with a baseline. For time–frequency, cut longer trials (step 3, for example −600 to 1000 ms; trials may overlap) or export longer trials from EEGLAB / FieldTrip.
Bands
Band power uses the frequencies of the Band: Delta 1–4, Theta 4–8, Alpha 8–13, Beta 13–30, Gamma 30–80 Hz. These limits are conventions that differ between labs and species. The baseline is shaded; the shade around each line is the SEM across trials (one participant) or across participants (grand average).
Walkthrough: time–frequency on the demo
Methods
ERPs
- The ERP of a condition is the mean of its trials, per channel. With Subtract a baseline, the mean of the baseline window is first subtracted from every trial and channel.
- The grand average is the mean of the participants' ERPs, so every participant counts once whatever their number of trials. Its shade is the SEM across participants; for one participant the shade is the SEM across trials.
- Several channels typed together are averaged into one waveform (a region of interest).
Measures
- Mean amplitude: the average voltage in the window. It is robust to noise and does not depend on the number of trials, so it is the usual choice.
- Peak amplitude: the largest positive or negative value in the window and its latency. Peaks grow with noise, so compare them only between conditions with similar numbers of trials.
- Choose the window before looking at condition differences, from the grand average of all conditions or from the literature. Choosing it where the conditions differ most, and then testing that difference, inflates the effect ("double dipping").
Scalp maps
- Scalp layouts: spherical splines[39], order m = 4 with 50 Legendre terms and no smoothing, so the map passes exactly through every electrode's value. Perrin et al. write the map as a constant plus one term per electrode and solve for them so that the map equals each electrode's value. With 7 terms instead of 50 the map changes by at most a few percent, beyond the outer electrodes.
- Skull layouts (mm from bregma): a thin-plate spline in the plane[40] with a linear term, drawn only inside the outline of the electrodes, because nothing is known outside them.
- The maps are computed in
core/ScalpMap.m.
Statistics
- One value per participant and condition, compared within participants. Three or more conditions: repeated-measures ANOVA with Mauchly's test and the Greenhouse–Geisser correction when needed, then Holm-corrected paired t-tests. The other test family runs as a robustness check. The computations are in
core/EEGAnalysis.mandcore/GroupStats.m(base MATLAB, no toolboxes).
Time–frequency
- Each trial is convolved with complex Morlet wavelets (a sine wave inside a Gaussian; the same as in LFP Analysis), one per frequency in 1 Hz steps, normalised to unit energy and cut at ±3 standard deviations of the Gaussian. The mean of each trial is removed first. The power (squared magnitude) is averaged over the trials of each condition and over the Channels (empty = those of step 4; bad channels are left out).
- ERSP (event-related spectral perturbation)[41]: 10 × log10 of the power over its mean in the Baseline, per condition and frequency, in dB (+3 dB: power doubled; −3 dB: halved; −6 dB: a quarter). It shows power changes whether or not they are phase-locked to the event. A minus B is the difference of the two ERSPs, in dB.
- Phase locking (ITPC, inter-trial phase coherence)[42]: the length of the mean of the trials' unit phase vectors, from 0 (random phases) to 1 (the same phase in every trial). Evoked potentials are phase-locked; an alpha decrease is not. By chance ITPC is about 0.9 / √trials (0.14 for 40 trials, 0.23 for 15), so compare conditions with similar numbers of trials; the line above the images gives the chance level of each.
- Band power: the mean wavelet power over the frequencies of the Band, as % change of each trial from the condition's mean band power in the baseline[43]. Values only where every frequency of the band fits.
- The grand average is the mean of the participants' ERSP (in dB), ITPC and band power, every participant once. The computations are in
core/EEGAnalysis.mandcore/TimeFrequency.m.
Inputs and outputs
In (one file per participant)
- EEGLAB .set (numbers inside, or in a .fdt file next to it): trials or a continuous recording with events, channel names and positions, and the EEGLAB history
- FieldTrip .mat (raw or timelock data): trials with trialinfo, channel names, electrode positions and the cfg history
- BrainVision .vhdr from Brain Products Recorder or Analyzer (and exports from EEGLAB or MNE), read with its .vmrk and .eeg files from the same folder: continuous recordings with their markers, or segments exported from Analyzer, with units and the amplifier filters
- EDF / EDF+ / BDF (
.edf,.bdf; clinical systems, BioSemi, many amplifiers): continuous recordings; the channels in V / mV / µV at the common rate are the EEG (theEEGprefix of EDF+ names is dropped), EDF+ annotations and BioSemi Status trigger codes (Code 1, …) are the events, and the recording filters are noted - XDF (
.xdf, LabRecorder / Lab Streaming Layer): the stream of type EEG (channels in µV, mV or V), with marker streams as events at their time stamps; clock offsets are applied - EEG-BIDS (OpenNeuro and other shared datasets): choose the
sub-…_eeg.edf/.bdf/.vhdr/.setfile; itschannels.tsv(only EEG channels are kept, channels with status bad are marked bad),events.tsv(trial_type or value as the event name),electrodes.tsvwithcoordsystem.json, andeeg.json(reference, line frequency) are read with it - A plain .mat with the numbers and a sampling rate; a form asks what each variable is. Values in volts are converted to µV
- Electrode positions files (Electrode layout… → Positions file…): see positions file formats
- All participants need the same channels and trial times
Out
- .csv: Participant, Condition, Value_uV, Latency_ms (peak only), Trials, PeakAtEdge
- .mat: struct
resultswith the ERPs of every participant and the grand average, the settings, the measures, the statistics and the time–frequency of step 7 (timeFrequencyper participant,grandTimeFrequency); a .mat file can be written with the time–frequency alone - Session, one-page PDF report and a draft methods text (see Sessions and reports)
For many participants with the same settings, Batch processing runs these steps (up to the measure of step 5) on every file of a folder and gives one row per participant and condition, with the checks of each file in the Checks column: the same numbers as this window.
Walkthrough on the demo data
Demo expectations
The demo data are made by core/demo/demoEEG.m, with known answers (how they are made).
- Data (Try demo data): an oddball study, 8 participants, 32 channels at 250 Hz, trials from −200 to 800 ms, already cleaned (band-pass 0.1–30 Hz, average reference, ICA components 1 and 3 removed, 5 trials rejected, T7 interpolated: the Overview tab lists these steps). Conditions Standard (40 trials), Target (15) and Novel (15) before rejection.
- Electrode layout (step 1): the positions come from the file (a spherical head): 32 of 32 channels placed: 32 from the file. Every Status is placed; none is renamed or without a position (the raw demo's files hold the same positions). With By name (10-5 system) the same names are placed from the template (32 of 32 channels placed: 32 by name (10-5 system).) and move a little towards the centre of the drawing: the demo file puts the outer ring (Fp1 … F7, T7, P7 … O1) on the head line, the 10-5 system one ring (10%) above it.
- Simulated: P1 +2 µV at 60 ms (Oz), N1 −5 µV at 100 ms (Cz), P300 at 350 ms (Pz): Target 10 > Novel 6 > Standard 2 µV, 10 Hz alpha over O1 / Oz / O2 in random phase (it averages out of the ERPs), and after Target the alpha amplitude halves from 350 to 650 ms (power −75%, −6 dB: the alpha decrease, or desynchronization, of step 7), noise. Participants differ by about ±10% in amplitude and ±10 ms in latency.
- ERPs at Pz (grand average): the three lines split after about 250 ms, Target highest, peaking near 350 ms (about 7 µV).
- Mean amplitude, 300–400 ms, Pz: about 6 µV Target, 3.5 µV Novel, 1 µV Standard in every participant. These are lower than the simulated peaks because the window also takes the flanks of the wave, and the average reference takes a little away from every channel.
- Scalp maps (grand average, 300 to 400 ms): the Target map is red around Pz (about +6 µV there), Novel weaker (about +3.5 µV) and Standard almost flat (about +1 µV); Target minus Standard is largest at Pz (about +5 µV). Frontal sites are slightly blue (about −2 µV for Target): with an average reference, a positive focus comes with negative values elsewhere. At 100 ms (type 100 to 100) every map is blue around Cz (the N1, about −3 µV).
- Compare conditions, parametric: repeated-measures ANOVA, p < 0.0001, every pair differs (Target − Standard about +5 µV). Nonparametric: Friedman χ²(2) = 16, p = 0.0003.
- N1: peak amplitude, negative, 50–150 ms at Cz: about −4.5 µV near 100 ms in every condition.
- Checks (after Show ERPs and Measure): no warnings. Trials per condition is a Check: Target and Novel keep about 12 to 15 trials each (15 before the 5 trials rejected in EEGLAB), fewer than 20: enough for the large P300, not for small components. Rejection balance is a Note (the trials were rejected in EEGLAB, so the share of each condition is not known here); Condition balance is OK with the mean amplitude (Standard has about 3 times as many trials as Target or Novel, as an oddball design intends) and a Check with the N1 peak amplitude; Bad channels OK (none); Interpolated channels OK: T7 was interpolated (in EEGLAB) in 8 participants; not among the measured channels (Pz).
- Compare conditions then adds the checks of the test below those rows (all OK on the demo): Sample size (n = 8 participants with a value in every condition), Normality (Shapiro–Wilk on the residuals, p = 0.134), Sphericity (Mauchly's W = 0.998, p = 0.994; the Greenhouse–Geisser p is reported when it is rejected) and the Robustness check (the ANOVA, p < 0.0001, and the Friedman test, p = 0.0003, agree). A new measure removes them with the old test.
- Faults demo (
demo_eeg_faults.matin the demo folder, oreeg/faults/sub-01_faults.set, written with the other EEG demo files: load it with Load EEG files…; one participant, Standard 40, Target 15 and Novel 15 trials): Suggest (step 2) gives 8 bad channels (FC6, T7, T8, TP9 and TP10 noisy, F8, PO9 and PO10 flat); tick Reject trials with 100 µV and click Apply rejection: the 12 trials with a blink go, 9 of them Target. The Checks tab gives 4 warnings: Trials per condition (Target 6), Rejection balance (60% of Target trials but 5% of Standard), Bad channels (8 of 32, 25%) and, measuring at Pz, Interpolated channels (Pz, the measured channel, was interpolated (in EEGLAB): the file's history says so). Condition balance is OK with the mean amplitude (Standard 38 vs Target 6). Without the bad channels marked, every trial exceeds 100 µV (a message says so). - Time–frequency (step 7; 4 to 40 Hz, 3 cycles, baseline −200 to 0 ms, Channels Oz, grand average): Target turns blue at 10 Hz from about 350 to 650 ms (about −4.5 dB from 400 to 600 ms: the simulated −6 dB, diluted by the noise); Standard and Novel stay near 0 dB (within ±0.2 dB); Target minus Standard is about −4.6 dB there. Below 8 Hz the images are grey: in trials that start 200 ms before the event, no 3-cycle wavelet below 8 Hz fits inside the baseline (the line under the button says so); the trial edges are grey too.
- Phase locking (ITPC) at Cz: about 0.65 to 0.75 at 10 Hz near 100 ms in every condition (the N1 has the same phase in every trial), near chance from 400 to 600 ms (about 0.16 for Standard, 0.25 for Target and Novel; the line above the images gives the chance level: 0.15 and 0.24, higher with fewer trials).
- Band power (Alpha, Oz): Target about −60% from 400 to 600 ms; Standard and Novel near 0 (within about 10%). With these 1 s trials the alpha band has only −20 to 0 ms of baseline (where the 8 Hz wavelet fits), so it is noisy; the line under the button says so.
- Raw demo (Try raw demo (continuous, not cleaned)): the same oddball design as 3 raw recordings (BrainVision Recorder files, 500 Hz, about 100 s each), recorded against FCz (not in the data), markers S 1 / S 2 / S 3 = Standard (40) / Target (15) / Novel (15). The demo fills in the settings below; nothing runs until you click.
- Raw demo, step 2: Suggest gives T7 for every participant (white noise of 150 µV). The files also hold electrode offsets (up to ±400 µV) and slow drift (the 0.1 Hz high-pass removes them), 50 Hz line noise of 5–15 µV (the 30 Hz low-pass, or the 50 Hz notch, removes it) and blinks of about 150 µV at Fp1 / Fp2. With Reference: Average, the N1 at Cz grows from about −2 µV against FCz (Cz is close to FCz) to about −4 to −5 µV.
- Raw demo, step 3: S 1 = Standard, S 2 = Target, S 3 = Novel, −200 to 800 ms, Peak-to-peak 100 µV: exactly the 8 trials with a blink are rejected in each participant (62 trials left); the 6 blinks between trials do not matter. Without marking T7 bad, every trial exceeds 100 µV (a message says so). Then steps 4 and 5 as for the cleaned demo: P300 at Pz, Target > Novel > Standard.
- Raw demo, longer trials for step 7 (cleaned as above, cut from −600 to 1000 ms with the same 100 µV rejection: 52 or 53 of 70 trials are kept, because blinks between trials now fall inside the longer trials): with the baseline −500 to −100 ms every frequency from 4 Hz has values and a baseline; at Oz the alpha band power falls by about 60% after Target from 400 to 600 ms (about −4.3 dB at 10 Hz), Standard and Novel stay near 0 (within about 15%).
- Rodent (continuous, 4 skull screws at 1000 Hz, 60 s, 30 light flashes): cut from −100 to 400 ms gives 30 trials; at V1 a negative peak of about −40 µV at 50 ms and a positive one of about +25 µV at 100 ms, about 30% of that over M1.
- Rodent layout: the EEGLAB, FieldTrip and EEG-BIDS files of
eeg/rodenthold the 4 skull screws in mm from bregma: 4 of 4 channels placed: 4 from the file, drawn on the skull: M1-L and M1-R at AP +1 mm, ML −1.5 and +1.5 mm; V1-L and V1-R at AP −3.5 mm, ML −2.5 and +2.5 mm. The EDF, BDF, XDF, BrainVision and plain .mat versions have no positions (0 of 4 channels placed: the screw names are not 10-5 names); a.csvwith name, ap, ml loaded with Positions file… places them. - Rodent scalp map at 50 to 50 ms: a flat map between the four screws, about −40 µV over V1 and −12 µV over M1 (30% of it), changing smoothly from front to back; nothing is drawn outside the screws.
Troubleshooting
| Problem or message | What to do |
|---|---|
| The plain .mat form opens | A plain .mat file does not say which variable is the EEG or how it is ordered. Choose the variable with the numbers, the sampling rate and the order of the numbers (for example trials × channels × samples). |
| "Unknown channel" | The names must match the file's channel names (any case), separated by commas. The Overview tab and the butterfly view show the names. |
| "other channels / other trial times than participant 1" | Every participant needs the same channels in the same order and the same trial times. Interpolate or remove channels and cut the trials the same way before loading them together. |
| Peaks flagged "on the window edge" | The window cuts through a slope instead of around a peak. Widen it, check the direction, or use the mean amplitude. |
| A condition is missing from the grand average | Only conditions present in every participant are averaged and compared. The Overview lists the trials per condition of each participant. |
| Statistics button greyed out | Load two or more participants, Show ERPs, then Measure. |
| "Every trial exceeds the threshold" | One noisy channel can fail every trial: the message names the channels that caused most rejections. Mark them bad in step 2 (or click Suggest), check the filters (no high-pass leaves drift and offsets in), then cut again. |
| "The filter (…) is longer than each trial" | A 0.1 Hz high-pass needs about 33 s of data. Filter the continuous recording before cutting it into trials, or use the trials as they are. |
| Time–frequency images mostly grey | The trials are short for the frequencies chosen: a 3-cycle wavelet at 4 Hz lasts about 0.75 s. Cut longer trials (step 3), raise the lowest frequency or use fewer Wavelet cycles; the line under the button says which frequencies have values and a baseline. |
| "The … band goes beyond the frequencies" | Band power uses the frequencies computed: widen Frequencies to cover the band (for example 4 to 40 Hz for Alpha and Beta; up to 80 Hz for Gamma, below half the sampling rate). |
| "No scalp maps: the channels have no positions" | The files hold no electrode positions and the channel names are not 10-5 names (or Source is From a positions file without one). Open Electrode layout… and choose By name (10-5 system), load the cap's positions file, or type the 10-5 name of each channel in As. |
| Positions look rotated (the nose points to an ear) | The file does not state its axes, or states them wrongly. When 3 or more channels have 10-5 names the layout is turned by 90° on its own (a note says so); otherwise choose By name (10-5 system), or load the cap's positions file with Positions file… (EEGLAB files use x = nose, y = left ear; most others x = right ear, y = nose). |
| No position for some channels | Their names are not 10-5 names (for example Ch1, E23, bipolar Fp1-F7) and the file holds no position for them. Type the 10-5 name in As, or load the cap's or net's positions file (EGI: the .sfp of the net) with Positions file…. EOG, ECG and reference channels (A1, A2, M1, M2) need none: only scalp maps use positions. |
| "same place as" or "outside the head" | Two channels have the same 10-5 name or lie less than 2° apart (0.2 mm on a skull), or one lies far below the ears (on a skull: more than 15 mm from bregma). Usually a typo in a name or a positions file in another unit: correct As (or AP (mm) / ML (mm)), or load the right positions file. |
| Checks: Rejection balance or Trials per condition | Blinks or movements come with one condition. Look at the channels the rejection names in step 3 (Fp1 / Fp2: blinks); correct blinks with ICA in EEGLAB and load the cleaned file instead of rejecting the trials, check that the effect stays the same with a stricter and a looser threshold, and leave out a participant with fewer than 10 trials in a condition. |
| Checks: Interpolated channels | The measured channel was not recorded but estimated from its neighbours (the history read from the file says so). Measure at recorded channels next to it (for Pz: P3, P4, CP1, CP2), or leave the participant out of this measure. |