Design of a novel photosensitive phantom for the accurate calibration of the temporal response of electroencephalography systems

This paper describes a novel method to measure the temporal latency of electroencephalography (EEG) systems using a customized photosensitive phantom. The system was evaluated with three different EEG devices, a medical grade (g.Tec), a consumer grade (Emotiv), and a low-cost device (Arduino SpikerShield). The temporal latencies of the three EEG devices were measured. The proposed method can be easily adapted to assess other EEG devices. The measurements obtained in this experiment provided concrete data for future experiments where accurate timing data are critical. BY) (http://creativecommons.org/licenses/by/4.0/).


I. INTRODUCTION
The human brain is a combination of a 100 × 10 9 neurons that are connected to each other to serve as a controlling system of the human body. Research of the human brain has been ongoing since the first century BC. 1 Most recently, this has led to the study of brain computer interfaces (BCI). 2 The BCI design requires analyzing the brain electrical activity recorded from the scalp as the electroencephalography (EEG) activity. The EEG signals vary depending on the EEG electrode locations and human actions. BCI use these variations as features or commands to control a device.
Traditional medical grade EEG systems such as NeuroScan TM , BioSemi TM , and g.Tec TM can be found in hospitals and medical clinics and are used for diagnosing a range of disorders such as epilepsy, sleep disorders, and other brain related diseases. 3,4 These EEG systems have been used for many years due to their high quality and reliability.
Recently, several inexpensive, consumer grade, wireless EEG systems have been brought into domestic use for meditation and simple EEG diagnosis (NeuroSky TM , Emobio TM , Muse TM , Emotiv TM , etc.). These wireless EEG systems, when compared to the traditional EEG systems, are not only cheaper but also much easier and faster to set up. Several researchers have also found that wireless EEG systems can provide some useful data in event-related potential (ERP) research. [5][6][7][8][9][10][11][12][13] ERPs are scalp-recorded voltage fluctuations that are timelocked to an event. 14 Measuring ERP waveforms requires accurate timing and verified synchronization of the data recorded from the sensor with the stimulus. For example, the common name convention of an ERP component is to begin with a P or N followed by a number indicating the peak latency of the waveform. P100 or P200 represents a positive peak waveform deflection around 100 ms or 200 ms, respectively, following the stimulus onset. An inaccurate temporal latency measurement can provide a misleading representation of the underlying components. 15 In addition, uncompensated variable delays can cause poor reconstruction of the ERPs from multiple trials.
Many research studies have evaluated wireless EEG systems for recording EEG spectra and detecting P300 ERP signal potentials and latencies. 8,9,12,13,16 Hairston 17 assessed the temporal drift from four EEG systems. In their study, the stimulus presentation and recording system ran on separate desktop computers. They used a common trigger signal to synchronize the two independent clocks. Hairston's paper showed that significant drift can occur between internal and external clocks. Wang et al. 18 designed an external trigger circuit to generate hardware trigger events synchronized with the stimulus generation code. This triggering strategy was compared with a software trigger signal. Their analysis demonstrated the presence of a jitter signal caused by the screen update process. This suggests the use of hardware synchronization when the timing is important with an image stimulus. Artoni et al. 19 used a spare EEG channel to record audio data as a synchronizing marker. Their system then used lab streaming layers (LSLs) to record both the EEG and audio data in separate streams. This allowed them to compare the ERPs reconstructed using software and hardware triggered audio markers. Both approaches produced comparable results.
Collier et al. 20 developed a complex brain phantom using carbon doped silicon and urethane resins. The phantom integrated eight antennas. Driver electronics allowed them to create simulated EEG surface potentials on the phantom. The use of synthetic resins produced a durable phantom that is compatible with an EEG cap. Mobashsher and Abbosh 21 reviewed the various tissue analogs used in a phantom design for MRI, including gelatin. They also discussed the use of 3D printed phantoms.
In addition, the use of human subjects in EEG analysis introduces a subject to subject variability. When the subject is in part of the experiment, it makes it difficult to make absolute timing measurements. 15,17,22,23 To our knowledge, there are very few research studies that investigate how much time the EEG signal spends in transmission, recording, and pre-processing within the EEG system itself. Traditional EEG systems use a wired connection, which has a very little delay on the transmission. Wireless systems are more likely to have a longer signal delay in transmission and generally are used in unshielded environments where the signal quality can be poorer.
This paper proposes a novel photosensitive phantom to accurately measure and compare the temporal response of a traditional wired EEG system, a consumer grade wireless EEG system, and a lower cost Arduino based EEG system. A customized gel phantom was created to simulate the human brain. The phantom created a measurable potential difference using a solar cell. The signal produced by the solar cell was generated by a test stimulus appearing on a computer monitor. The system developed will be used as part of the EEG data collection in the future. The approach used allows the phantom to be inserted into the experiment without changing any experiment parameters, except replacing the stimulus images. This gives confidence to the latency and variability measurements that can then be used to correct the EEG data reported in a human study. Importantly, it also allows variable time delays embedded in the system, such as jitter in the graphics card, and buffer in data communications to be detected. The synchronization in this approach is generated by the image on the screen and not by the software used to produce the image.

A. Fabrication of the gel phantom
A gel phantom head is cast from a mixture consisting of 1000 g of water, 2 g sodium chloride salt, and 108 g beef gelatin. The solution is heated until the gelatin is dissolved, and boiling is avoided so as to maintain a clear gel. The mixture is placed in a 12 cm diameter bowl shape plastic container and lined with plastic film. Electrodes consisting of 8 mm brass discs are cast in the gel. The brass disc used was an M5 RS Pro Brass washer, RS483-2615; typically these are made of a 65% copper 35% zinc alloy. The solder used was Multicore lead free solder. The leads to the electrodes are made by winding the insulated multistrand wire around a former to create a five turn spring; this reduces the chance of likelihood of the electrode being pulled out of the gel. The material is refrigerated and allowed to harden at 4 ○ C for about 8 h approximately, producing a final gel phantom model, as shown in Fig. 1. The electrodes are positioned in a straight line with 3 cm separations, as shown in Fig. 2. 2 cm wide pieces of the gel material are removed from both sides of the phantom to mount an EEG headset on the phantom firmly (see Sec. II E).

B. Measurement of the electric properties of the gel phantom
A block of gel is cut from a second phantom with a dimension of 4.5 × 6 × 2 cm 3 to measure the electric properties. Two copper plates (4.5 × 6 cm 2 ) are attached to the top and bottom sides of the block of gel. Two pieces of thin plastic sheet are placed in between the copper plates and the surface of gel to behave as an isolating layer. This block of gel is connected in series with a 100 kΩ resistor. The circuit is driven by a 1-V p-p sinusoid wave from a function generator. An oscilloscope is used to measure the potential across the resistor. The block of gel is driven with input frequencies from 1 Hz to 200 kHz.
Three measurements presented in Table I show that the higher the input frequency, the lower the impedance of the gel. The capacitance of the gel capacitor is calculated at 200 kHz input frequency and is 105.72 pF. This calculated capacitive response is similar to the measurement from the Atlas LCR meter (153.80 pF at 200 kHz). The higher frequency is investigated due to the fast rise time of the optical stimulus.
In addition, using gold or platinum electrodes to replace the brass disc would reduce redox reactions in the gel phantom.

C. Experiment design
A solar cell is used in the experiment to provide a means of generating the simulated brain signals with which to compare the timing of the event marker with the EEG signal (see Fig. 3). In hardware triggered ERP studies, 9 researchers have used a photodiode circuit to detect changes (e.g., switching black and white images) and output these changes as markers directly into the EEG amplifier. The aim of the approach used in this paper is not to change any aspect of the experiment between calibration and measurement; the same electrodes are used in both cases, first on the phantom and then on the subject. The procedure is repeated before each new experimental study so as to measure latencies. The positive terminal of the solar cell is connected to the central electrode of the phantom. The negative terminal is connected to the electrode, 3 cm on the right side of the central electrode shown in Fig. 1. The third electrode shown on the left of the central electrode was not used. A 100-Ω resistor is connected between the two terminals of the solar cell to improve  The stimulus presentation uses black and white image switching to produce a rising and falling voltage potential to be captured by the EEG systems. 505 black images with a size of 800 × 600 pixels 2 are used as non-target stimuli, and 127 black images (800 × 600 pixels 2 ) with a white rectangle with a size of 150 × 126 pixels 2 at the bottom right corner are used as target stimuli. All images are randomly shuffled and presented one by one in a frequency of 1 Hz. When a non-target image is displayed, there is no voltage potential difference created by the solar cell, and when a target image is displayed, there is a maximum 13.48 mV voltage potential generated by the solar cell. The luminance is measured at the bottom right corner of the monitor and is 176 lx when the target image is presented and 5 lx when a non-target is presented.
The approach used in this work allows the same protocol to be used in the experiment as that used on human subjects. The only change required is to replace the target images with white images and non-target images with black images.
The stimulus image is displayed using the PsychoPy 24 software (version 1.85.2). The software generated software triggers, which labeled the target and non-target images. These triggers and the simulated EEG signals are passed to EEG acquisition program "LabRecorder" that runs on the same computer as the two lab streaming layer streams. The LSL is open source software used to synchronize the EEG data recordings and the event onset markers.

ARTICLE scitation.org/journal/rsi
The LSL system is designed to measure time series in research experiments. LSL handles both the networking, time-synchronization, (near-) real-time access and the centralized collection, viewing, and disk recording of the data. 25 LSL is chosen because it is one of a few recording applications that are compatible with the majority of EEG systems on the market. The use of LSL simplifies the management of underlying hardware components, such as the amplifier and event trigger.

D. EEG systems
In the experiment, three EEG systems are used to evaluate the photosensitive phantom: (A) a medical grade, wired, g.Tec g.USBamp system; (B) a consumer grade, wireless, Emotiv EPOC+ system (2016 later edition); and (C) a low cost, Arduino TM based, Heart and Brain SpikerShield TM , as shown in Fig. 5. The g.Tec g.USBamp system has 16 biosignal channels with 24 bits resolution, and it uses a standard universal serial bus (USB) interface for data recording. The system has a wide range of sampling rates up to 38 400 Hz. In this experiment, the electrode impedance is measured and maintained under 20 kΩ. Signals are checked using the g.Tec Matlab Simulink TM impedance checker both before the experiment and after.
The Emotiv EPOC+ headset consists of 14 EEG channels and uses CMS/DRL (common mode sense/driven right leg) at P3/P4 locations, which can add a small current to compensate for the effect of external noise sources. The electrodes are held by a plastic arm containing a small cap with a saline soaked felt pad inside. The electrode locations are based on the international 10-20 system. 26 The device uses an inbuilt Bluetooth device to transmit data to a personal computer (PC). The signal is internally digitized at 2048 Hz (16-bit) and subsequently low pass filtered (43 Hz) and downsampled to either 128 Hz or 256 Hz. The impedance is checked using the "Emotiv contact quality map" available within the EmotivPRO application.
The Heart and Brain Arduino SpikerShield uses two electrodes embedded onto a headband and one reference electrode connected to an electrode patch. The device uses the USB 2.0 serial communication port to record data. The open source software used in the Arduino is downloaded from the Backyard Brains GitHub repository. The sampling rate can be configured from 250 Hz to 10 000 Hz, 10-bit resolution. An impedance check for the SpikerShield is not provided.

E. EEG recording
This experiment took place in a radio frequency (RF) shielded room (>100 dB 1-100 GHz) to further improve the signal acquisition quality. Lights are turned off to avoid optical interference. When recording the simulated input signal, the g.Tec system amplifier, the Emotiv Bluetooth dongle, and the SpikerShield are separately connected to a desktop computer running the LSL. The experimental protocol is run for each device consecutively. For the g.Tec system, it records the simulated input signal at 256 Hz, for the Emotiv system, it records at 128 Hz, and for the SpikerShield, it records at 250 Hz. The location for the reference electrode, ground electrode, and the channel electrode used is limited by the Emotiv headset. The Emotiv uses plastic arms, which hold electrodes at fixed locations following the 10-20 system. The electrodes cannot be relocated.
Therefore, in order to attach the reference electrode and ground electrode to the surface and fit the Emotiv headset firmly on the phantom, 2 cm wide pieces of the gel material are removed from both sides of the phantom (see Figs. 6 and 2). The same electrode locations are used for the g.Tec (channel 1), Emotiv (T7), and SpikerShield (single channel device) to maintain consistency.

F. EEG processing
The data recorded from the three EEG systems are processed offline using EEGLAB 27 (version 14.1.1). The data recorded from the g.Tec and the Emotiv can be loaded into EEGLAB directly for analysis, but the recorded 10-bit data from the SpikerShield needed an extra preprocessing step to reconstruct individual EEG values from the data encoded binary form.
EEGLAB is then used to process the data collected. The continuous g.Tec data are down-sampled from 256 Hz to 128 Hz, and the continuous SpikerShield data are down-sampled from 250 Hz to 128 Hz to match the sampling rate of the Emotiv system. All data are processed using an EEGLAB default finite impulse response (FIR) filter "Basic FIR filter (new)" at 0.16-30 Hz to remove DC and high frequency noise. The filter is Hamming windowed sinc FIR filter with filter order 424. The transition bandwidth is defined as 25% of the lower passband edge. The filtered data are then extracted for epochs from −0.2 s to 1.2 s with respect to the stimulus onset (0 s). The signals produced by non-target images that are preceded by a target image are excluded to avoid any crosstalk between events (around one-quarter non-target images are excluded).

FIG. 5.
Three EEG systems studied in this paper: g.Tec g.USBamp, Emotiv EPOC+, and Heart and Brain SpikerShield.  6. Electrode locations used in the experiment. The three setup figures correspond to the three EEG systems, the g.Tec, the Emotiv, and the Heart and Brain SpikerShield.
On the left side of the phantom, EEG measured on the top electrode and reference electrode at the bottom. On the right side of the phantom, a ground electrode was placed symmetrically to the reference electrode.

A. Property of the solar cell in the circuit
To measure the response of the solar cell circuit, a simple program is written to flash black and white images on the screen, as shown in Fig. 7(a). A square wave transient is recorded each time the stimulus is present. A digital storage oscilloscope is used to measure the voltage across the two terminals of the solar cell in parallel with the 100 Ω resistor. A single stimulus response from white image onset to removal is captured, as shown in Fig. 7(b). A rise time of approximately 38 μs is recorded.

B. Temporal response of computer monitor
Human peripheral version is most sensitive to the flicker at the edge of the scene, but not at the center of the gaze where it focuses attention. Therefore, the greater the field of vision occupied by a monitor, the higher the refresh rate needed to reduce flicker. 28 Traditional television has a standard refresh rate of 60 Hz. The computer monitor that is used in the experiment is set to a refresh rate of 75 Hz. The time taken from the onset of rendering an image to it appearing on the screen can be up to 13.33 ms on average 6.71 ms (SD = 3.87 ms).
There is a time delay between the image being passed to the graphics card and when it appears on the screen due, in part, to double buffering (page flipping).

C. Temporal analysis of EEG systems
The corresponding target stimulus epochs and non-target stimulus epochs are averaged, respectively, across all trials. This means that the electrode potential (signal) is effectively the derivative of the signal produced across the solar cell. Either the blue band or the red band is consistently captured by all EEG systems. A significant delay can be observed between the stimulus onset and time zero in Figs. 8(a) and 8(d). The delay between the onset of the stimulus and the stimulus appearance in the EEG recording in Fig. 8(d) is wider than the delay in Fig. 8(a). The time spent by the Emotiv system to record the simulated input signal is longer than that by the g.Tec system. In Fig. 8(g), both stimulus onset and stimulus removal had an increasing delay following each target trial. Between stimulus onset and stimulus removal in Figs. 8(a), 8(d), and 8(g), Fig. 8(d) contained more variation than Figs. 8(a) and 8(g), which suggests that the Emotiv wireless system produces more noise.
The single trial ERP image is also used for plotting the nontarget image stimulus using the same scales for all three EEG Oscilloscope measurement of stimuli onset; the raising edge has been zoomed in to measure the time taken by the solar cell to reach the peak voltage (x = 10 μs/div, y = 100 ms/div).  Figures 8(c), 8(f), and 8(i) are plotted by averaging the 127 target trials using the averaged ERP method available in EEGLAB. Each averaged plot is calculated by taking the mean across EEG samples recorded at the same time after the synchronization event across the 127 trials. The three plots compare the averaged target stimuli vs the averaged non-target stimuli. The averaged peak amplitudes and the peak latencies of three systems are calculated by averaging each individual target trial.

Review of Scientific Instruments
The delay from time zero to the averaged peak amplitude is approximately 51.22 ± 0.89 ms (SD = 9.27) for the g.Tec system and 162.69 ± 1.10 ms (SD = 11.40) for the Emotiv system. The absolute time lag between the g.Tec and the Emotiv is 111.47 ms. The first sample, which initiates the negative-going signal, is used as the time of image onset. The g.Tec system initiated recording at 23.44 ms. The Emotiv system initiates recording at 125.00 ms. The absolute time lag between the g.Tec and the Emotiv is 101.56 ms. For the SpikerShield system, an increasing delay is observed. The delay from the g.Tec system is small and, in some cases, would not need to be corrected for in some straightforward ERP studies (P300). The Emotiv system has a much longer delay; this must be considered in the future ERP studies since a 100 ms delay difference can lead to incorrect identification of ERP components. 15 The average peak amplitudes were calculated in two ways. The peak for every single trial was measured and then averaged across all trials; this gave a peak value of −13.45 ± 0.07 μV (SD = 0.77) for the g.Tec and −22.56 ± 0.50 μV (SD = 5.25) for the Emotiv system, and this is the value reported in Table II. The second approach was to create an average signal across all trials and

ARTICLE
scitation.org/journal/rsi then measure the single peak value; this gave a lower value of −8.32 μV for the g.Tec and −13.75 μV for the Emotiv. The reason the second value is lower is that peaks in each trial do not necessarily occur at the same time. Although the Emotiv signal is larger than the g.Tec, this is not a comment on the quality of the signal.

D. Noise analysis of EEG systems
In Figs. 8(c) and 8(f), it is observed that the averaged ERP waveform obtained from the Emotiv system contains more noise than that from the g.Tec. The signal-to-noise ratios (SNRs) of both waveforms are measured. In order to keep the measurement consistent, it

ARTICLE scitation.org/journal/rsi
is necessary to use the same number of samples. For g.Tec, the "signal" is calculated by taking the averaged absolute peak amplitude from the samples 31-41 and 155-165, and the "noise" is calculated using the averaged absolute peak amplitude from the samples 100-140. For Emotiv, the "signal" is considered as the averaged absolute peak amplitude from the samples 44-54 and 170-180, and the "noise" is considered as the averaged absolute peak amplitude from the samples 100-140. The SNR of the g.Tec system is 39.93 dB, and the SNR of the Emotiv system is 26.34 dB.

IV. DISCUSSION
A. Correction of the increasing delay obtained by the Heart and Brain SpikerShield An unexpected finding in this experiment is the increasing delay detected in the calibration of the photosensitive phantom with the Heart and Brain SpikerShield. In Fig. 8(g), it can be observed that the increasing delay is not random but increasing at a constant rate, which is manifested as non-vertical bands in the data. It is suggested that the delay may be due to serial communication buffering the data. To test this hypothesis, characters are sent from Arduino to the serial port directly on the Windows desktop machine. The characters are read in and correlated with a local timestamp on the desktop machine to see if an increasing delay can be observed. The sampling rate is kept the same at 250 Hz, and the experiment maintains the same time of 632 s. The result shows an increasing delay of approximately 0.5 ms/sample, insufficient to explain the effect observed. Hence, it is not possible to determine the exact cause of the delay. Here, we provide some potential reasons that may cause the increased delay, such as the potential drift or the temperature variation in the Arduino system. In general, drift in a system can have a number of causes including delays caused by processing and buffering and by variation in clock rates.
A solution to overcome this problem aims to find the slope of the blue band and compensate the delay for each sample and the image onset time (the event marker). This allows the ERP signal to be reconstructed, as shown in Fig. 9.
The negative peak amplitude is −17.57 ± 0.07 μV (SD = 0.70), and the peak latency is 57.94 ± 0.86 ms (SD = 8.94). We also use the first sample, which initiated the negative movement, as the initial recording time of the SpikerShield (31.25 ms). The SNR calculated for the SpikerShield is 39.23 dB. The results then can be used to compare with the other two EEG systems, as shown in Table II.
To conclude, the results of selected EEG devices are compared using accurate and absolute time measurement using the photosensitive phantom and LSL. The stimulus images use a maximum delay of 13.33 ms to present an image on a computer monitor. The solar cell uses 38 μs to generate a signal at the electrodes embedded in the phantom. The g.Tec system takes 23.44 ms to record EEG data, and the Emotiv system takes 125.00 ms to record EEG data. The results show that the wireless system has significant delays compared to the wired systems.

B. Simulation of photosensitive phantom
The negative-going and positive-going peaks, as shown in Fig. 8, suggest that capacitive coupling between the inner electrodes and the EEG electrodes dominates. A simulation of the phantom and solar cell circuit is conducted using a simple RC circuit, as shown in Fig. 10. The output of this circuit can produce a similar response to the phantom, as shown in Fig. 11. It is suggested that a series RC circuit explains the phantom's temporal response. The   11. The simulation result from Fig. 9. The simulation result demonstrated a similar response to the gel phantom. The green signal is the input signal (square wave), and the yellow signal is the output signal. The output signal has been capacitively coupled.

ARTICLE
scitation.org/journal/rsi equivalent circuit demonstrated that capacitive coupling dominates the coupling between the signal source and the EEG electrode.

V. CONCLUSION
This paper proposed a method to accurately measure the temporal response of three EEG systems using a novel photosensitive phantom. The three devices tested cover a wide range of EEG systems, from a low cost device to a medical grade device and from a wired device to a wireless device. Future experiments, which use a combination of the systems described in this paper, can now include a procedure that allows compensation for delays. This method can be easily adopted in other EEG systems to accurately calibrate the timing in the future.