Elamur Research

ERPLAB: an open-source toolbox for the analysis of event-related potentials

Paper · 2014 · Javier López‐Calderón and Steven J. Luck

Summary

An electroencephalogram records a stream of voltages. To study what happens when a person sees a stimulus or makes a response, researchers need to find the relevant moments in that stream, align the recordings around them, and decide which trials can be averaged together. Each decision can affect the resulting waveform and the conclusions drawn from it. López-Calderón and Luck introduce ERPLAB, an open-source MATLAB toolbox that extends EEGLAB with tools for processing and measuring event-related potentials, or ERPs. The paper describes how the toolbox works, how its design makes analysis choices visible, and how the authors checked its core routines.

The workflow begins with events. ERPLAB can assign trials to an averaging group according to what happened before or after the event of interest. In an oddball experiment, for example, the same letter can be common in one block and rare in another. A researcher can group trials by the role the letter played while accounting for nearby events, such as whether a correct response followed it. The toolbox can also flag trials that contain artifacts, express changes to the electrode reference as readable equations, and show how a filter responds over time. Operations performed through the graphical interface generate MATLAB commands in a history, which gives researchers a starting point for scripting the same analysis across participants.

After averaging, researchers can plot waveforms and scalp maps, subtract one experimental condition from another, and measure the resulting signals. The measurement choices include peaks, mean voltage within a time window, the area on one side of the baseline, and latency estimates based on a fraction of the waveform’s area or its peak. A viewer overlays the selected measurement on each waveform. This matters when individual waveforms differ enough that the same settings can capture the intended feature for one participant and an adjacent feature for another. ERPLAB can export the measurements for statistical analysis and prepare leave-one-out averages for jackknife procedures.

The authors report checking ERPLAB’s main processing routines against established commercial packages on real and simulated data. They give a qualitative account of that validation. Their most direct comparison shows that a sudden voltage change between simulated recording blocks can produce a filter artifact on both sides of the boundary, and that filtering the blocks separately eliminates it in the example. Other figures use individual waveforms to explain how measurement choices affect what gets counted. The paper’s contribution is a working analysis environment in which decisions about events, artifacts, filters, and measurements can be inspected alongside their effects on the data.

Deep dive: ERPLAB: an open-source toolbox for the analysis of event-related potentials

ERPLAB adds open-source tools to EEGLAB for turning recorded brain activity into event-related waveforms and measuring their size and timing. · about 34 minutes to read

The problem and its context

Finding an event in a continuous recording

Electroencephalography, abbreviated EEG, records electrical potentials through electrodes. An EEG trace shows how the measured voltage changes over time at a recording site. In an ERP experiment, researchers ask how part of that activity relates to a particular event. The event may be a stimulus, a response, or another occurrence with a known time. A presentation system can send a code to the recording system when the event happens. Later, the researcher uses the code to locate the corresponding point in the EEG.

The basic calculation is an average. The researcher extracts a segment around each occurrence of an event and aligns the segments so that the event is at the same relative time in all of them. This is called time-locking. At each electrode, the researcher averages the voltages at matching times across the selected segments. The resulting waveform describes how voltage varies around the event for that group of trials. If the experiment distinguishes rare stimuli from frequent ones, each class can yield its own waveform from the same recording.

There is a reason to take care over the preparation of such a simple calculation. The ERP technique is attractive because it can track changes on a millisecond timescale. In the authors’ account, this strength complements functional magnetic resonance imaging, which offers finer spatial information and coarser temporal information. EEG recording is also relatively inexpensive and can be tolerated by some participants who would have difficulty taking part in an imaging study. The value of precise timing depends on how well the processing preserves it. If a filter moves the apparent beginning of an effect, or creates a small deflection before a sharp change, an investigator can end up measuring a consequence of the analysis.

The events themselves also require interpretation. A marker may identify the letter on screen while the scientific question concerns whether that letter was expected. The same stimulus can belong in different averages across blocks. Alternatively, a researcher may want to separate occurrences of the very same event according to what preceded them. The acquisition system supplies a record of what happened and when. The analysis has to translate that record into groups that represent the experiment’s questions.

What the available software made difficult

The authors describe a period when recording systems had become more common and offered a broader range of costs and features. They saw software for analyzing the resulting data as a bottleneck. Commercial packages could carry out established procedures, but the paper describes them as costly and difficult to adapt when a study called for a different analysis. This was consequential for a field in which decisions about trial grouping and waveform measurement frequently depend on the design of an individual experiment.

The authors identify several points at which the available interfaces could obscure what was being done. A conventional mapping from an event code to an averaging group was adequate for some experiments. It was cumbersome when a group depended on a sequence of events or on the timing of a response. Electrode re-referencing could be implemented through options that hid the calculation, or through a large table of coefficients that made it laborious to see whether the intended electrodes had been used. Filtering interfaces frequently gave little information about the filter’s behavior in time, even though timing was central to the interpretation of an ERP.

Artifact detection raised a related problem. An artifact is an unwanted contribution to the recording. A blink, a sharp movement, or saturation of the recording hardware can produce recognizable changes in voltage. The authors describe commercial systems whose detection options relied heavily on general rules such as whether voltage exceeded a given level. A general threshold can detect an extreme fluctuation. An artifact with a defining shape, such as a sudden step or a stretch of nearly flat signal, invites a detector that looks for that shape.

The paper also traces the history of a common measurement practice. Originally, researchers could use a ruler on a paper waveform to find the height of a peak and its time. Peak measures remained common once computers made other calculations straightforward. The difficulty is that peaks belong to the observed waveform, which can include contributions from several components. A peak can shift when a neighboring contribution changes, and a window can capture the rising side of an adjacent component. The authors wanted researchers to be able to choose among measurements that answer different questions about the same waveform.

Building on EEG software already in use

EEGLAB already handled data import, visualization, and several kinds of EEG processing in MATLAB. It also offered independent component analysis, or ICA, which separates a recording into components and can support removal of some artifacts. Its graphical interface could accommodate plug-ins, and it already had routines for conventional ERP averaging. The authors saw room for a plug-in that would carry an analysis through more of the steps used in ERP research, including organizing trials, manipulating averages, and extracting measurements.

EEGLAB’s command history also offered a way around a practical tension. Menus make options visible while a researcher learns a procedure or explores a recording. A study can then require essentially the same operations across many recordings, with some exceptions for individual participants. Repeating the work through menus makes it harder to change an early step and run the rest again. By retaining the MATLAB command for a graphical operation, EEGLAB gave users a way to move from an interactive analysis to a script. ERPLAB uses the same approach and adds history for its operations invoked through scripts as well.

The paper situates the toolbox in an existing scientific programming environment. MATLAB offered matrix operations and a broad collection of functions that could be reused in data analysis. Its use in other parts of neuroscience made it a practical setting for laboratories already working there. The development decision was to use the environment and the EEGLAB plug-in interface to make ERP procedures accessible through menus while keeping them open to extension through code. The authors also credit the Event-Related Potential Software System as an influence on ERPLAB’s design.

The method, step by step

From an EEG recording to a measurement

An ERPLAB analysis starts with a recording and a description of the events that can be located within it. The researcher prepares the continuous EEG, defines which events belong together, and extracts segments aligned to those events. During averaging, the analysis decides how to handle trials marked as containing artifacts. It then produces waveforms grouped by experimental condition. The researcher can transform and inspect those averages before turning selected portions into amplitude or latency measurements.

The sequence below illustrates a route through the toolbox. The tools also operate at different stages where appropriate. A change of electrode reference, for instance, can be applied to the recording or to an averaged waveform. Artifact detection on segmented EEG and removal of unusually large disturbances from continuous EEG serve different purposes.

From recorded EEG to ERP measurements

The steps in order.

From recorded EEG to ERP measurementsStep 1: Import EEG recordings and their event markers1. Import EEG recordings and their event markersStep 2: Prepare channels and filter the continuous recording2. Prepare channels and filter the continuous recordingStep 3: Organize events with rules for experimental conditions3. Organize events with rules for experimental conditionsStep 4: Extract time-aligned segments and flag artifacts4. Extract time-aligned segments and flag artifactsStep 5: Average selected segments within each bin5. Average selected segments within each binStep 6: Combine and inspect averaged waveforms6. Combine and inspect averaged waveformsStep 7: Measure amplitudes and latencies for statistical analysis7. Measure amplitudes and latencies for statistical analysis

There is no training stage. The principal inputs are the voltage samples, the event record, and the rules or parameters the researcher supplies. Conditions come from the experimental design and from the chosen event definitions. Filtering parameters determine how the signal is transformed, and measurement parameters determine what is read from the resulting waveform. The procedures in the paper are best understood by following what the toolbox stores and what changes at each stage.

Keeping intermediate data available

EEGLAB calls a recording and its associated information a dataset. It generally corresponds to EEG from a participant. A dataset can reside in memory, on disk, or in both places. When a processing operation produces a new dataset, the result becomes the current dataset. Earlier versions can remain available through the graphical interface. A researcher who wants to revisit a filter choice can select the earlier state and repeat the operation from there.

ERPLAB uses a related structure for averaged waveforms, called an ERPset. An ERPset can hold the averages for the different stimuli and conditions of a participant in a common structure. An operation such as subtracting conditions, filtering the averages, or calculating a grand average creates a new ERPset. Working in memory makes it practical to look at intermediate versions without creating a separate disk file for every operation. The paper describes saving the initial and final datasets as a common way to work.

The command history records the operations that produced a given data structure. A researcher can process a participant through the graphical interface and use the resulting commands as the basis of a script for other participants. The same mechanism makes it possible to look back at how a file was processed. This is particularly relevant for steps that may run successfully with different settings but produce observably different waveforms. A record of the operations gives the researcher something more specific to inspect than the finished trace alone.

The graphical dialogs also express some of the reasoning behind a choice. The filtering dialog, for instance, indicates that subtracting the mean before filtering is generally unsuitable when the data have already been baseline-corrected. The authors designed such cues to expose analysis options and their intended uses while the researcher is deciding which operation to run. They describe a user manual with help linked from major dialogs, a worked tutorial, video demonstrations, and a guide to scripting.

Turning event markers into experimental conditions

ERPLAB builds an EVENTLIST from the events in the EEGLAB data. Each entry carries a time, a numerical code, and a text label. It can also carry a flag indicating whether the event may be used, flags associated with artifacts, and flags the user defines. A trial with a known acquisition error can be marked so that it is left out. User-defined information can record a property of the event that was absent from the original marker.

An EVENTLIST can be exported to a text file, edited, and brought back into the data. This provides a route for adding information acquired separately from the EEG. The paper gives the example of saccades, which are rapid movements of the eyes. When an eye tracker runs alongside the EEG system, its record of saccade onsets can be incorporated as events. A stimulus program’s log can supply information about occurrences that were never sent as markers during acquisition. The toolbox can also create markers from features detected in the EEG, such as the onset of a blink or a burst of activity. In each case, a newly recorded event can serve as an alignment point for averaging.

To understand the grouping step, consider the counterbalanced oddball experiment used in the paper. Participants see letters that are frequent or rare within a trial block. The letter X can be rare in some blocks and frequent in others, with Y taking the complementary role. The investigator wants to compare rare with frequent events while allowing each physical letter to appear in either category. The grouping can also be narrower, such as rare events with a particular kind of preceding event.

ERPLAB calls the group being averaged a bin. The same list of qualifying events defines the bin across electrodes, and the average is computed separately for each site. BINLISTER locates events that match a description stored in a text file. Its rules allow a researcher to express a bin as a sequence with a designated central event. The paper gives this example.

{11;12}.{21;22}{t<200-1000>101}

The braces enclose alternatives or requirements at a position in the sequence. Within the first braces, the semicolon makes standard-event codes 11 and 12 alternatives. The period marks the anchor position, and the next braces identify oddball codes 21 and 22 as alternatives for that anchor. In the final braces, t introduces a time condition. The angle brackets delimit the interval, the hyphen separates its endpoints, and the interval runs from 200 to 1000 ms after the oddball. The final code, 101, denotes a correct response. An oddball qualifies when the surrounding event record meets both the preceding-standard and following-response requirements.

The event information can supply a behavioral measure as well. The paper uses a related descriptor to recover the reaction time to a qualifying stimulus.

{11;12}.{21;22}{101:rt<”RT_Correct_Response”>}

The initial braces, semicolons, and period have the same grouping and anchoring roles as in the previous descriptor. In the last braces, 101 identifies the response. The colon attaches an instruction to that code, and rt requests its reaction time. The angle brackets contain the quoted output name RT_Correct_Response, whose underscores separate the words in the label. The result can be associated with the ERP analysis drawn from those events. If the binning rules of a study exceed what BINLISTER can express, the paper describes assigning events through an external script or spreadsheet macro and importing the resulting assignments.

Detecting artifacts and deciding how to treat them

A voltage change near a stimulus may reflect activity related to the event, a disturbance in the recording, or both. The paper illustrates several common disturbances in single trials. Eye movements can look like abrupt steps because the eye has a strong electrical potential across it. Blinks are often large and have a relatively stable distribution over the electrodes. Muscle activity, shifts associated with movement, slow changes in skin potentials, and the electrical activity of the heart can also appear in the EEG. An amplifier or converter that saturates can leave a nearly flat stretch of trace. These patterns give the investigator clues about what happened and give a detection routine a feature to look for.

ERPLAB uses detectors suited to such features. To look for a saccade, it can compute the cross-covariance between the recorded data and a step function. This measures how well the signal’s changes match a step as the comparison moves through the data. A dedicated blocking detector looks for stretches in which voltage remains almost constant. The toolbox also provides several ways to detect blinks, with parameters the user can adjust. The standard ERPLAB detectors work on EEG segments. A detection places a mark on the segment, which remains available for later inspection and averaging choices. EEGLAB’s visual inspection facilities allow researchers to mark a segment or clear a mark and can be used alongside the automated procedures.

Correction is another available operation. Through EEGLAB, the researcher can use independent component analysis to decompose the EEG and reconstruct it after leaving out a component associated with an artifact. A blink is a favorable example because its spatial distribution can be consistent within a participant and its voltage contribution is often large. The paper also describes removing unusually large stretches of artifact from continuous recordings before ICA. An extreme movement during a break, for example, may interfere with the decomposition that would ordinarily help isolate blinks. Selectively deleting such stretches from continuous EEG serves that specific purpose. Marking a time-locked trial leaves the trial available for a later choice about averaging it.

A trial can remain unsuitable even if the electrical signature of an artifact can be reduced. If the participant blinked when a visual stimulus appeared, their eyes were closed at a moment when the experiment depended on what they could see. A saccade can likewise affect visibility. In these situations the event differed for the participant in a way the correction cannot reverse. The paper describes reporting the proportion of trials rejected so researchers can apply a rule set in advance for excluding recordings with excessive trial loss. The authors give their own laboratory’s practice for studies of healthy young adults as an example: they exclude participants when more than 25% of trials are rejected.

Making electrode calculations readable

An EEG channel represents a potential difference. With differential recording, the signal reflects the potentials at a recording electrode and a reference electrode. Some systems use a single-ended configuration in which the recorded voltage is measured relative to a ground electrode. The paper emphasizes that the choice of the comparison electrode matters to the recorded trace. Researchers sometimes change the reference afterward, for example by using the mean of the left and right mastoid sites. A bipolar channel formed from recordings near the eyes can make an ocular artifact easier to detect.

ERPLAB expresses the channel calculation as an equation. The researcher can see the source channels, the operation, and where its output will go. Here is the paper’s example for creating a channel called VEOG by subtracting one existing signal from another.

chan33 = chan27 − chan26 label VEOG

chan33 is the destination channel, and the equals sign assigns the expression on the right to it. chan27 and chan26 are existing channels, associated in the example with electrodes over the right and left eyes, respectively. The minus sign subtracts their corresponding samples in the displayed order. The label keyword assigns the name VEOG, short for vertical electrooculogram. The paper uses the example to illustrate the subtraction and naming operation.

The same interface accepts expressions beyond subtraction. The paper illustrates this by taking the norm of a pair of channels and adding a constant offset.

newchan1 = sqrt(chan1² + chan2²) + 5

newchan1 identifies the output channel. The equals sign assigns the calculated waveform to it. chan1 and chan2 refer to the input waveforms. The superscript indicates that each value is squared, and the plus sign inside the parentheses adds the squares at the same sample. sqrt takes the square root of that sum. The final plus sign adds the offset of 5 μV to the result.

For a reference based on many electrodes, ERPLAB supplies avgchan. The authors illustrate it with a selected pool that contains channels 1–32 and 38–50, and give separate expressions for the signals being re-referenced.

newchan1 = chan1 − avgchan(1:32, 38:50)

newchan1 receives the calculated waveform, and the equals sign specifies the assignment. chan1 is the original waveform for channel 1. The minus sign subtracts the output of avgchan, which computes the mean waveform across the specified channels. The colons specify inclusive channel ranges, and the comma joins the channel ranges in the function’s argument list.

newchan2 = chan2 − avgchan(1:32, 38:50)

Here newchan2 is the destination and chan2 is the source being re-referenced. The equals sign assigns the result. The minus sign subtracts the mean from that source, and avgchan uses the same pool. Each colon defines an inclusive range, with the comma separating the ranges supplied to the function.

newchan3 = chan3 − avgchan(1:32, 38:50)

newchan3 is assigned the result of subtracting the common reference from chan3. The equals sign assigns the output and the minus sign specifies the subtraction. avgchan again computes the mean of the specified channels. The colons indicate inclusive ranges, and the comma joins them as inputs to the reference calculation.

These expressions show how several outputs can use the same reference while retaining separate source waveforms. The reference assistant can generate a set of expressions for the user to inspect and edit. The calculation itself is still expressed in the resulting equations, so the user can check which channels contribute before applying them.

Another operation replaces the data for an electrode that recorded poorly with an estimate based on nearby electrodes. The paper demonstrates the replacement of channel 14 with an average across a specified set of neighbors.

chan14 = (chan10 + chan12 + chan16 + chan18) / 4

chan14 is the channel to be replaced. The equals sign assigns the newly calculated values to it. Inside the parentheses, the plus signs sum the corresponding samples from channels 10, 12, 16, and 18. The parentheses group that sum before the slash divides it by 4, the number of channels used in the estimate.

chan14 = avgchan(10, 12, 16, 18)

chan14 again denotes the destination and the equals sign assigns the result. avgchan computes the mean across the input channels, whose identifiers are separated by commas. The two forms describe the same replacement. Channel operations can also reorder channels and can be applied to EEG recordings or to averaged ERPs. A reader inspecting an analysis can therefore tell whether a channel comes directly from the recording or from a later calculation.

Checking what a filter does in time

A filter controls which variations in the electrical signal pass through and which are attenuated. A high-pass filter attenuates slower variation, a low-pass filter attenuates faster variation, and a bandpass filter combines the two. The paper describes ERPLAB’s non-causal finite impulse response and Butterworth infinite impulse response filters. Non-causal processing can affect the waveform on either side of a sudden change in the recorded data. ERPLAB uses the filtering routine in MATLAB’s Signal Processing Toolbox.

The interface lets the user specify the roll-off, which describes the steepest part of the change in attenuation, and the half-amplitude cutoff. At the latter frequency the amplitude has been attenuated by 50%, corresponding to 6 dB. The interface also displays the half-power cutoff, which corresponds to 3 dB of attenuation. Both terms locate a point on the same filter response, using different criteria. A report that gives a cutoff frequency alone can leave it unclear which point the stated frequency represents.

The default display shows the frequency response, which describes attenuation across frequencies. The other view shows the impulse response, the output associated with a brief impulse. It lets the observer see how a sharply localized event can spread or oscillate after filtering. This matters when the study measures the beginning or end of a waveform change, or interprets a small deflection as a nearby component. A frequency response can describe suppression of unwanted fluctuations while the impulse response reveals consequences for the timing or shape of the signal that remains.

The paper also discusses the edges of a recording and the seams between blocks. A large constant voltage offset can create an abrupt effective transition at the endpoint of the data. The authors use 200 μV as an illustrative offset for a direct-current recording. The underlying filter routine already takes steps to reduce edge effects. ERPLAB additionally allows mean subtraction before filtering, and it can filter separate blocks independently. The latter option addresses the case where the recording resumes at a different voltage after a pause. Processing across that joined boundary can spread the influence of the discontinuity into the data on both sides.

Averaging the selected trials

After the event rules have been applied, the relevant EEG segments can be averaged by bin. At each electrode, the toolbox combines matching times from the segments selected for the bin. A single ERPset can hold the resulting waveforms across conditions. If the EEG for different recording blocks is stored in separate files, ERPLAB can average across those files in one operation. The resulting waveforms can also be exchanged with other packages through a common text format.

Marks made during artifact detection affect averaging according to the option selected. The researcher can leave marked segments out, take all segments, or take only those that were marked. The last choice produces an average of the rejected trials, which can reveal whether the disturbances have a consistent effect when aligned to the event. Since all the segments remain available, the researcher can make these averages from the same segmented recording.

The toolbox can also average a subset of trials. For a split-half reliability analysis, the paper suggests making averages from odd-numbered and even-numbered trials and then correlating the resulting component measurements. The goal is to see whether the measure is stable across different trials from the recording. Random selection can serve another purpose. When conditions contribute different numbers of epochs, the researcher may want to select a subset so that the averages under comparison draw on the same number of trials. These examples concern how the averaging tools can be used.

Comparing conditions and inspecting the averages

A difference wave is obtained by subtracting one averaged waveform from another. For an oddball experiment the paper shows a contrast between standards and oddballs made through the bin operations interface.

bin3 = bin2 − bin1 label Oddball-Minus-Standard Difference wave

bin1 contains the averages for the standards, and bin2 contains the averages for the oddballs. The minus sign subtracts corresponding values for the same channel and time. The equals sign assigns the difference to bin3. The label keyword gives the output the name that follows it. A derived bin can then be plotted or measured using the same tools as the original averages.

The bin operations tool accepts other pointwise calculations. This example shows how to take the magnitude of a sum of waveforms.

bin5 = abs(bin1 + bin2 + bin3 + bin4)

bin1, bin2, bin3, and bin4 are existing bins. The plus signs add their values at corresponding electrodes and times, and the parentheses enclose the sum passed to abs, which takes its absolute value. The equals sign assigns the result to bin5. The example illustrates what can be expressed through the interface. The scientific meaning of a calculation depends on what the input bins contain and why they are being combined.

For some contrasts, which physical electrodes are used depends on whether the stimulus or response of interest is on the left or right. An electrode on the same side is called ipsilateral, and one on the opposite side is called contralateral. A participant’s left-side electrodes can thus play opposite roles across groups of trials. To let an expression reflect that dependency, ERPLAB supports named groups of electrodes in bin operations.

bin1@LeftElectrodes + bin2@RightElectrodes

bin1 and bin2 are the input averages. The @ symbol restricts each term to the named group. LeftElectrodes and RightElectrodes represent user-defined groups for the left and right sides. The plus sign combines the selected values from the two bins. The expression demonstrates the group-selection syntax. The researcher chooses the grouping and the full calculation appropriate to a particular lateralized comparison.

For visual inspection, ERPLAB can superimpose selected bins in waveform plots and display either chosen channels or scalp maps. A scalp map represents the spatial pattern of voltage at a selected moment or the mean voltage over an interval. Maps can be displayed in 2D or 3D, and a series of maps can show how the distribution changes over time. Waveform plotting controls include the displayed channels, bin overlays, and axis ranges. The toolbox exports graphics, including PDF files, for further preparation outside the analysis environment.

Measuring size and timing

The measurement interface asks the researcher to select the ERPsets, bins, channels, time window, and algorithm. It can then write values into a text file. One layout places a participant’s measurements across a row and can be convenient for statistical software. Another puts each measured value on a row with its bin and channel, giving the reader a direct way to identify what was measured. The viewer draws the measurement on top of the waveform. The same settings can thereby be inspected across participants whose traces differ in shape or timing.

A peak amplitude reports the voltage of a selected extremum, and a peak latency reports when it occurs. The local peak option is intended to avoid picking the edge of a window merely because it catches the rising slope of a neighboring component. Mean amplitude summarizes the voltage across the window. Area gives a measure of the region between the waveform and its baseline over time. The user can specify the positive region, the negative region, their sum, or the integral. The choice determines whether a deflection of the opposite sign can cancel part of the effect of interest.

The paper’s example uses the negative N2 in an oddball-minus-standard difference wave. Adjacent positive P2 and P3 deflections can overlap a broad window. The negative-area measure counts the region below the 0 μV baseline within the selected interval. In the demonstrated waveform, this permits a wider interval around the negative deflection without subtractions from nearby positive voltages. A wider interval can be useful when the N2 occurs at different times across participants. The defining condition is the sign of the waveform within the window.

Latency can also be defined by the shape of a deflection over time. Fractional area latency first measures an area within the window. It then finds the time at which the accumulated area reaches a selected fraction. With a fraction of 50%, the returned time divides the chosen area into equal portions. The paper also describes a fraction of 20% as a way of characterizing when an effect begins, leaving 80% of the area after the measured point. The polarity and bounds of the area matter because they determine what accumulates on either side of that point.

Fractional peak latency begins with a peak and searches backward to where the waveform reaches a specified fraction of the peak voltage. The authors describe finding the 50% point on the rising part of a P3 difference waveform as an example of an onset measure. A trial average can begin to rise before the typical onset of an individual trial when the trials vary in timing. A point farther up the averaged deflection can therefore provide a better estimate of the average onset across trials under the conditions discussed in the paper. The method’s target is a time defined relative to the observed peak.

Samples can fall on either side of a desired crossing without landing exactly on it. The measurement tool can use spline interpolation to estimate intermediate values before calculating latency. The user controls the amount of interpolation. The authors connect this option to jackknife analyses, for which reducing other sources of measurement error can make the limits imposed by discrete sampling more important.

Preparing waveforms and values for inference

The toolbox supports operations that feed statistical analysis. It can export measurements for use in statistical software and can permute data in several ways. A permutation rearranges the data according to a rule so that an external analysis can use the rearrangements for inference. Averaged ERPs can also be read by the Mass Univariate Toolbox described in the paper. That package can test many channel and time combinations while applying procedures to control the chance of false positives.

ERPLAB’s grand averaging tool can also produce the data structures used for a jackknife. A grand average combines the averaged waveforms across participants. With the leave-one-out option, it prepares a series of grand averages, each omitting a different participant. The researcher measures the resulting waveforms and uses those values to compute a statistic elsewhere. The paper describes calculating a t, F, or r value and applying the appropriate jackknife adjustment. It identifies nonlinear measurements such as onset latency as a particular use for this procedure. ERPLAB supplies the averages and measurements on which that analysis depends.

Experiments and results

Checks against other packages

The authors and their beta testers used real and simulated EEG and ERP data to check routines that compute, transform, plot, and measure waveforms. They compared ERPLAB output with output from Neuroscan, Brain Electrical Source Analysis, and BrainVision Analyzer. These comparisons addressed whether the main processing routines gave the expected results in relation to established software. The authors report that the checks validated the core routines.

This validation is reported at the level of the software and the kinds of operations tested. The paper names neither the recordings nor their sample sizes, and it gives no scores or numerical tolerances for agreement. It also leaves the procedure-by-procedure mapping to other packages unspecified. The comparison therefore provides the authors’ account of an accuracy check, without numerical results from which a reader could assess small discrepancies, compare speed, or rank the packages. The named systems served as comparators for processing output.

The figures answer more focused questions. They show what particular analysis operations look like on example data and, in the case of the block boundary, compare alternative treatments of the same simulated trace. The measures shown in the figures are properties of the signal or analysis settings. They have different purposes from an aggregate measure of software accuracy.

Filter response and the boundary between recording blocks

The filter interface puts the half-amplitude and half-power cutoff conventions on the same response. The chart gives the attenuation at the respective cutoff points. It compares filter settings on a defined metric, using the attenuation values reported in the paper. The half-amplitude convention is starred because it is the cutoff specified in the interface. Higher in the chart means more attenuation at the designated frequency. Filter suitability depends on the analysis.

Attenuation at the two cutoff settings on ERPLAB’s filter response

The half-amplitude cutoff designates greater attenuation than the half-power cutoff.

Attenuation at the two cutoff settings on ERPLAB’s filter responseDisplayed half-power cutoff: 3Displayed half-power cutoff3User-specified half-amplitude cutoff (this paper): 6User-specified half-amplitude cutoff(this paper)6
The numbers
System or settingdB attenuation
Displayed half-power cutoff3
User-specified half-amplitude cutoff (this paper)6

The simulated block-boundary example concerns a different question. A gap between the end of one block and the beginning of the next gives rise to a sudden voltage shift when the recording resumes. The figure displays the underlying trace, the result of filtering through the boundary, and the result when filtering is performed separately within the blocks. Filtering across the join produces a large disturbance extending in both time directions. The main text of the report says the effect lasts almost 30 seconds on either side of the gap. Filtering the blocks separately eliminates that boundary artifact in the illustrated trace.

The body gives a half-amplitude bandpass of 0.01–20 Hz for the demonstration, while the figure caption gives a bandpass of 0.01–2.0 Hz. Both report a slope of 12 dB/octave. The reported cutoff values therefore leave the upper setting uncertain. The visible comparison still establishes the point of the demonstration: with the simulated discontinuity, processing the recording as one stretch produces a disturbance near the join, and processing the blocks independently removes the illustrated disturbance. The paper gives no numerical amplitude or variance estimate for each trace.

This example is particularly relevant to a workflow that uses non-causal filters. If filtering spreads the effect of a jump to times before and after it, nearby epochs can carry a voltage disturbance even when they do not include the transition itself. The affected part of the signal can be substantial relative to the brief windows a researcher later measures. The paper makes the consequence visible by keeping the underlying example the same and varying whether the filter processes the adjacent blocks together.

Examples of measuring individual waveforms

The measurement viewer is illustrated with a positive fractional area latency. The fraction chosen is 50%, and the algorithm measures the positive region from 300 to 798 ms. The measurement indicates the time that divides the positive area equally within that window. The figure demonstrates which region is used and how the calculation is displayed. The reported numbers identify the bounds and the fraction, while the example provides no aggregate estimate of accuracy or reliability.

A second demonstration shows the negative region of a difference waveform from a single participant in an oddball experiment. The selected interval is 200–500 ms, and the measure counts the portion below 0 μV. The neighboring P2 and P3 deflections illustrate why that definition matters for an estimate intended to represent the negative N2. The integration can use a relatively broad window while avoiding cancellation by positive voltage. The authors describe the choice of window as having little impact on the illustrated measurement, without presenting a comparison across multiple windows or participants.

The report relates the fractional area and fractional peak procedures to earlier simulation studies that had evaluated ERP latency estimates. That evidence supports the rationale for implementing the procedures. It is distinct from the demonstrations using the toolbox’s interface. The figures explain how to read the operation and recognize what it includes. The earlier studies address how well those kinds of measurements estimate latency under the conditions they examined.

Availability and use at the time of the report

The authors identify 4.0 as the version current at the time of writing. They report over 7000 downloads and point to uses of the toolbox in published research on different topics. That figure counts downloads. It gives an indication of distribution alongside the examples of research use, which cover separate applications of ERP analysis. The release, documentation, support arrangements, and validation checks together explain how ERPLAB was offered as software for researchers to use and extend.

What the ablations show

The paper has no formal ablation study. It offers a controlled comparison of filtering at a recording boundary, waveform examples that expose the properties of selected measurements and artifacts, and a qualitative account of checks against commercial packages.

The boundary example comes closest to isolating the effect of a single processing choice. The raw trace shows the discontinuity. Filtering across the join shows what happens when information from both sides of the boundary enters the operation. Processing each block independently shows the consequence of withholding that cross-boundary influence while still filtering the recording. The comparison supports the explanation that the long disturbance comes from the interaction of the filter with the abrupt shift. Its force comes from changing the treatment of the same boundary on the same simulated signal.

The negative-area illustration answers a different kind of question. If a time window contains negative and positive activity, a signed measure can combine the two. Restricting the measure to the negative region changes which parts of the trace enter the result. The single-participant figure shows how this choice protects the N2 measurement from positive voltage in that example. It provides a concrete explanation for selecting a polarity-specific measure when the desired effect and surrounding deflections have different signs. There is no comparison of measurement reliability across a group.

The fractional area illustration makes the dependence on the selected window visible. The reported timing point divides the included positive area in a specified way, so the calculated latency depends on which waveform segments contribute that area. The viewer makes it possible to see whether a participant’s selected region has the intended shape. The paper’s rationale for inspecting each case follows from the variation it describes across individuals. A fixed window and algorithm express a common measurement rule, while the overlay shows how that rule applies to an individual trace.

The single-trial artifact figures explain why different detectors can be appropriate. A step, a nearly flat interval, and a blink each present a different property to a detection routine. The paper connects these visible shapes to the design of the detectors. It supplies no common performance metric across algorithms. The figures establish what features the methods are intended to detect, while the account of comparison with commercial packages addresses the correctness of the main processing outputs more broadly. Together these analyses support specific design choices without assigning an overall contribution to each feature.

Limitations

Limits described by the authors

The authors identify MATLAB’s cost, performance on some operations, and occasional memory inefficiency as disadvantages of the environment. ERPLAB is distributed without charge, and its execution relies on that environment. The paper also notes that MATLAB works well for matrix operations. The choice of platform brings capabilities that the toolbox uses and practical requirements that a laboratory has to account for.

For artifact correction, the paper gives several reasons to be careful with independent component analysis. An artifact whose scalp distribution changes within a participant is difficult to isolate in a fixed component. The amount of data needed for effective separation grows with the square of the number of electrodes, which can leave recordings with many electrodes short of the required samples. The paper also notes the mismatch between the number of components available from the decomposition and the number of underlying sources. In some practical circumstances the resulting error may be small. Evidence for correction is stronger for blinks than for several other artifact types discussed in the report.

A separate limitation concerns what happened during the trial. If eye closure or movement changed the visual input, reconstructing cleaner voltages leaves a trial with altered stimulus visibility. This is one reason the authors give for marking and excluding trials in some studies even where artifact correction is available. The choice depends both on the electrical contamination and on whether the event remained comparable across trials.

The authors emphasize that filtering can reduce temporal precision, distort apparent beginnings and endings, and introduce extra peaks or oscillations. Inspecting an impulse response gives the investigator information about these risks. The options for mean subtraction and independent block filtering address particular situations. The software still requires the user to choose a filter and decide how its effects bear on the measure being taken. The paper also identifies sampling as a limit on latency precision and describes interpolation as a way to refine measurements made between discrete recorded samples.

The paper places statistical inference outside the toolbox’s main role. ERPLAB creates measurements, permutations, and averages that can be used by other software, with an adjustment required for the jackknife procedure described. In plotting, the authors describe export for subsequent graphics work because the built-in plotting facilities are designed for analysis and inspection. These are boundaries of the package as presented in the report.

Limits of the evidence in the report

A software validation can address whether an operation is implemented as intended, whether it agrees with another implementation, or whether the resulting quantity is a good measure for a scientific question. Those questions require different evidence. The commercial-package comparison speaks to the first two from the authors’ account, but the paper gives too little detail to determine the extent of agreement across individual routines, input formats, and settings. The comparison supplies no basis for ranking computational performance or determining which software is easiest for a new user to learn.

The filtering demonstration isolates a mechanism on simulated data with a particular discontinuity. It leaves the frequency and severity of such artifacts across real recordings unquantified. The disagreement between the caption and the body also leaves the exact upper cutoff unresolved. A reader can understand why respecting a block boundary made a difference in the example, while reconstructing the precise setting would require resolving the discrepancy.

The individual-waveform measurement figures likewise leave open how the same rule performs across different recordings and components. A polarity-specific area counts whatever voltage meets that polarity criterion within the window. If several deflections of the same polarity fall inside it, the area could reflect all of them. A fraction of peak depends on the peak being identified in the first place. A fraction of area depends on which parts of the waveform enter the calculation. The measurement algorithms make these choices explicit and repeatable, while the interpretation of the resulting value depends on the experimental contrast and the waveform being measured.

The event tools introduce similar dependencies. A flexible binning rule can express the intended design, and it can also faithfully apply an incorrect assumption about an event’s meaning or timing. Importing events from an additional recording creates the possibility of time-locking to them. The validity of that timing depends on how the event record has been matched to the EEG. The paper explains the mechanism for editing and importing events. Its demonstrations leave the accuracy of alignment in different recording arrangements open.

A history can preserve a useful account of how particular data were processed. The report describes how users can turn that account into a script and recover operations when revisiting an analysis. It presents no study that measures the reduction in effort, the accuracy with which different users transfer an analysis to scripts, or the completeness of reproduction across laboratories. Those outcomes depend on the data and event definitions available alongside the recorded operations, as well as on the choices embodied in the analysis.

Finally, the paper’s report of distribution and use establishes that researchers could obtain the software and were applying it to different topics at the time of writing. The download figure alone leaves unanswered how many laboratories used it repeatedly or which features they relied on. The examples of application establish breadth of subject matter. Their scientific findings remain evidence about the experiments in which the toolbox was used.

What came after

The 2015 paper Ideophones in Japanese modulate the P2 and late positive complex responses cites the ERPLAB report in a study of how Japanese ideophones are associated with changes in ERP responses. Its focus is a question in psycholinguistics. The P2 and late positive complex named in the title are the responses it examines. That focus illustrates the kind of application for which an ERP workflow can connect event definitions to measurements of distinct parts of a waveform. Ideophones in Japanese modulate the P2 and late positive complex responses

The citation establishes a connection between the application and the toolbox report. The specific ERPLAB operations used in the later study and the details of its measurements are unspecified here. Its title identifies a finding about the language stimuli and ERP responses, while the technology report addresses the procedures available for producing and measuring such responses.

Cite

Cite as Javier López‐Calderón and Steven J. Luck. 2014. ERPLAB: an open-source toolbox for the analysis of event-related potentials. Frontiers in Human Neuroscience.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.3389/fnhum.2014.00213

@inproceedings{lopezcalderon2014erplab,
  title = {{ERPLAB: an open-source toolbox for the analysis of event-related potentials}},
  author = {Javier López‐Calderón and Steven J. Luck},
  booktitle = {Frontiers in Human Neuroscience},
  year = {2014},
  doi = {10.3389/fnhum.2014.00213},
  url = {https://doi.org/10.3389/fnhum.2014.00213}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/calderon-2014-erplab-open-source-toolbox-analysis/