Abstract
Electroencephalography (EEG) offers a unique opportunity to study human neural activity non-invasively with millisecond resolution using minimal equipment in or outside of a lab setting. EEG can be combined with a number of techniques for closed-loop experiments, where external devices are driven by specific neural signals. For example, EEG signals have been used to regulate anesthetic delivery, to control brain-computer interfaces, and to drive transcranial alternating current stimulation for the treatment of psychiatric illness. However, reliable, commercially available EEG systems are expensive, often making them impractical for individual use and research development. Moreover, by design, a majority of these systems cannot be easily altered to the specification needed by the end user. This rigidity makes it extremely difficult or infeasible to adapt EEG to novel closed-loop experiments. For instance, many current systems are not able to communicate with software and hardware from other vendors, nor are they able to achieve low-latency timescales (100 ms) necessary to operate on the fast patterns of neural activities. Recently, open-source alternatives to commercial systems have been developed that can eliminate these problems, driving down research costs and promoting collaborations and innovations. Here, we present methods to expand the use of a commercially available, open-source electrophysiology system, Open Ephys (www.openephys.org), to include human EEG recordings providing a novel technique for low-cost, easily-adaptable EEG recording. We describe the equipment and protocol necessary to interface various EEG caps with the Open Ephys acquisition board, and detail methods for processing data. We present applications of Open Ephys + EEG as a research tool and discuss how this innovative EEG technology lays a framework for improved closed-loop paradigms and novel brain-computer interface experiments.
Keywords: open source, EEG, electrophysiology, Open Ephys, low-cost
Introduction
Since its inception in the 1920’s by Hans Berger, electroencephalography (EEG) has been an integral tool in the study of human neural activity (Berger, 1935). Electrodes placed on the scalp monitor small changes in electric potential (microvolt scale) created by the synchronous activation of 10–20 cm2 of cortical tissue (Nunez & Srinivasan, 2006). While its spatial resolution is limited, EEG can register oscillations that occur at frequencies as high as 500 Hz, known as fast ripples, (Baker, Gabriel, & Lemon, 2003) or as slow as sub-1 Hz, known as slow wave oscillations, (Marshall, Helgadottir, Molle, & Born, 2006; Nunez & Srinivasan, 2006). EEG has a wide variety of applications from its role as a diagnostic tool in clinical conditions such as Parkinson’s Disease (Soikkeli, Partanen, Soininen, Pääkkonen, & Riekkinen, 1991) and epilepsy (Gotman, 1982), to studying cognitive processes such as memory (Klimesch, 1999) and attention (Worden, Foxe, Wang, & Simpson, 2000), to unraveling the mechanisms of transcranial electric stimulation for neural modulation (Helfrich et al., 2014), to being used in brain-computer interface (Farwell & Donchin, 1988) (BCI) technologies for the operation of prosthetics (Guger, Harkam, Hertnaes, & Pfurtscheller, 1999) and computers (Wolpaw, McFarland, Neat, & Forneris, 1991).
The utility of EEG, however, is masked by the tools provided by most commercial EEG manufacturers. Current commercial EEG systems can cost upwards of $60,000 dollars or more; for example, the BioSemi system (http://www.biosemi.com/faq/prices.htm) costs €21,000 ($22,662.15) for a 32 channel system and €44,000 for a 128 channel system ($47,482.60), while the Brainvision actiCHamp system (http://www.brainvision.com/actichamp.html) costs $28,460 for a 32 channel system and $64,000 for a 128 channel system. These high-cost systems are problematic for small-scale academic and teaching settings where limited resources often dictate the freedom of purchasing and work-flow. More often than not these systems only allow for passive data acquisition; meaning signals are collected and analyzed off-line. It is possible, however, to implement software packages to utilize these commercial systems in closed-loop BCI control as well as neurofeedback applications. For example, the BCI2000 system is an integrative software package used for BCI research that interfaces with data acquisition systems to collect and process data on-line, and allow for control of external devices (Schalk, McFarland, Hinterberger, Birbaumer, & Wolpaw, 2004). Despite this, proprietary hardware and software still create a large barrier for researchers to tailor EEG systems to fit their research. However, in the past decade, open-source information sharing has galvanized the production of low-cost, easily accessible human-based neurotechnologies that include EEG. For example, the OpenBCI system (http://www.openbci.com/) is a popular, modular, open source tool for recording human EEG. OpenBCI have several, wireless systems from 4-channels ($199), to 8-channels ($499), to 16-channels ($949.99). Additionally, the system can be linked, so a 32-channel system would be the price of two 16-channel systems ($1,899.98). They have also developed an open source EEG headset, the Ultracortex ($249.99-$349.99). To add to their low-cost tech, they also have extensive documentation to help users learn more about the equipment they are using. In the event that the documentation is not enough, there is a large user community where individuals can ask questions, post messages about their research, and even take part or create scientific challenges for users to take part. Backyard brains, an open-source company geared towards making neuroscience research accessible to everyone, has a one channel EEG system ($149.99) along with a host of other EMG and neural recording tools. As with OpenBCI, Backyard brains also has quite a bit of documentation that ranges from general user support to experimental instructions on how to control a robotic arm through EMG. They even have a page dedicated to the ethics of their work, as well as a blog for posting updates. OpenViBE is another company that develops software for real-time data analysis as well as BCI development (Renard, Lotte, Gibert, & Congedo, 2010), and BCI2000, alluded to earlier, is also an open community that provides their software and documentation for free (http://www.schalklab.org/research/bci2000). These projects have not only pioneered human EEG research, but they continue to develop new and unique tools for moving neuroscience forward.
To continue the growth of the open-source technologies we have developed a new EEG system built on the Open Ephys platform (www.open-ephys.org). To date, Open Ephys has been developed and used for extracellular recordings with tetrodes (Gray, Maldonado, Wilson, & McNaughton, 1995) in rodents (Siegle & Wilson, 2014) and Pogona dragons (Shein-Idelson, Ondracek, Liaw, Reiter, & Laurent, 2016). In using this system, we build on the versatility of Open Ephys so that a single system can not only record extracellular potentials in animals, but also scalp potentials in humans. Here, we present detailed methods to expand Open Ephys’s utility to include these human EEG recordings, show several examples of its use and comparison to a standard EEG system. Lastly, we discuss future research directions, including application to closed-loop experiments.
1. Adapting Open Ephys to EEG: Components and Assembly
All EEG systems are composed of an electrode cap, digital amplifiers, a data acquisition system, and a computer. The electrode cap is used to pick up small electric potentials on the scalp, the digital amplifiers amplify the incoming small signals to be read out by the computer, the data acquisition system registers the incoming neural data and tags it with a time stamp, and the computer allows for visualization, data storage, and data analysis. Our Open Ephys + EEG system includes each of these components. In this section we describe the exact components used and associated current day costs (Section 1.1, Table 1), and methods for assembly with estimated assembly time (Section 1.2).
Table 1.
Component | Company | Vendor Site | Cost |
---|---|---|---|
EEG electrode cap | |||
EasyCap, ActiCap | EasyCap, BrainVision | www.easycap.com, www.brainvision.com | $1,900.00–$16,040.00 |
EEG breakout board | |||
Breakout board | Open Ephys | www.seeedstudio.com | $20.00 |
Nano strip connector NPD-36-VV-GS | Omnetics Connector Corporation | www.omnetics.com | $62.16–$248.64 (× 4) |
Headers (3-pin) | Harwin Inc. | www.digikey.com | $1.36 (× 8) |
Headers (8-pin) | Harwin Inc. | www.digikey.com | $0.90 (× 2) |
Pak-50 connectors | 3M | www.digikey.com | $6.55–$26.20 (× 4) |
Amplifier | |||
32 channel Headstage | Intan Technologies | www.intantech.com | $995.00–$3,980 (× 4) |
SPI Cable | Intan Technologies | www.intantech.com | $295.00–$1,180 (× 4) |
Data Acquisition | |||
Acquisition Board | Open Ephys | www.labmaker.org | $2,350.00 |
Computer (Ideacenter AIO) | Lenovo | www.lenovo.com | $1,400.00 |
$7,060.97–$25,247.10 |
1.1. Open Ephys + EEG Components and Costs
The first piece of our system is an electrode cap (Fig 1a). Electrode caps are available commercially and can have a range of characteristics. Electrode caps can consist of just a ground, a reference, and a signal electrode, or they can be made of higher density arrays with upwards of 500 electrodes. They can also record through different mediums; wet caps consist of a metal electrode that conducts ohmic current from the scalp via a conductive gel, whereas dry caps pick up scalp currents from a capacitive link. Additionally, caps can be passive, meaning signals picked up from electrodes are sent directly to neural recording amplifiers, or they can be active, meaning there is a pre-amplification step for eliminated environmental noise before the signal is recorded. These different electrode cap features change the price drastically and have different channel mappings. Fortunately, any commercially available electrode cap can be used for the Open Ephys +EEG system provided an appropriate connector for the cap can be acquired and the pin layout is known. Table 1 includes the price range for a lower end cap; the passive, wet, 32-channel EasyCap, to a higher end cap; the active, wet, 64-channel BrainVision ActiCap.
In order to transfer neural signals from the electrode cap to a computer, the EEG cap must first be connected directly into an Open Ephys + EEG breakout board (Fig 1b). This breakout board is the intermediate piece that enables us to interface the EEG cap to the Open Ephys amplifiers (Fig 1c), so that EEG signals can be amplified and sent to the Open Ephys acquisition board (Fig 1d), which converts the signals to a format that can be read by a PC (Fig 1e). Specifically, a fully assembled Open Ephys +EEG breakout board, as shown in Fig 1b and 2, has four male Pak-50 connectors for connecting up to four 32-channel EEG inputs (128-channels of EEG data in total). These connectors are relatively inexpensive, currently costing under $10 each (Table 1). The four Pak-50 connectors are linked via conductive traces to four female Omnetics NPD-36-VV-GS connectors (see Fig 2b) that can be directly connected to four separate Open Ephys amplifiers (Fig 1c). Currently, the Omnetics connectors can only be purchased in orders of four or more (Table 1).
To help with data quality and analysis in EEG, it is often necessary to change the reference point or to include an additional recording to track sources of biological noise such as electrooculography (EOG) or electromyography (EMG). The Open Ephys +EEG breakout board shown in Figure 1b and 2 includes twelve series of headers, or pins, to allow for re-sourcing amplifier inputs from EEG to an additional electrophysiological signal such as an EMG or EOG, and for re-referencing signals on the fly. This can be done using a series of jumper connectors to create an electrical connection between two header pins.
The reference pin of each Omnetics connector is connected to a header pin on the EEG breakout board (Fig 2a, orange, far right). Figure 2b depicts the “default” mode of recording, which maintains the reference connection as the EEG cap reference electrode. To use the default scheme, simply place a jumper in the highlighted orange positions depicted in Figure 2b (bottom), this will connect the Pak-50 reference position with the Omnetics reference position. To re-route any of the reference connections to an external electrode, place a jumper in the highlighted green positions depicted in Figure 2c (bottom), and connect an external electrode to the corresponding header pin (2c, bottom), this will connect the Omnetics reference pin to an open header pin on the breakout board. Additionally, the Omnetics connector on the far right of the breakout board has up to four inputs that can be re-routed from the EEG Pak-50 connector to header pins allowing the recording of EMG and EOG, for example. To re-route these inputs, place a jumper in the blue positions depicted in figure 2c (bottom) and an external electrode to the corresponding header pin (2c, bottom). Headers can be purchased at any electronic store for under $3.00 in total.
Signals sent through the Open Ephys +EEG breakout board are received and amplified by an Open Ephys compatible Intan headstage (Fig 1c; one example shown here but up to 4 could be used). The headstage is a small, thumb-sized (2.2 × 1.3 cm) printed circuit board that houses the amplifier chip used to amplify incoming EEG signals. Open Ephys implements low-power Intan Technologies amplifier chips (RHD2000) that can amplify 32 or 64 channels of neural data by 192 V/V with an output range of +/− 5mV. Analog signals are multiplexed, which allows a large number of channels to share a single 16-bit ADC. These chips have low input-referred noise (2.4 μVRMS upper bound) and large range upper (100 Hz – 20 kHz) and lower (0.1 Hz – 500 Hz) bandwidth settings, making them ideal for a variety of neural recordings. Some EEG systems use DC amplifiers, which allow for recording signals with little to no frequency content. While the Intan chip is not a DC amplifier, the bandwidth settings can be adjusted using off-chip resistors to be 10 Hz −30 kHz, and 0.02 Hz – 1.0 kHz for upper and lower bandwidths, respectively (Technologies, 2012). This allows for recording slower oscillatory events such as infraslow oscillations (Vanhatalo et al., 2004). The headstage has two connective ports, one to interface recording electrodes to amplifier input (male 36 channel Omnetics connector), and the other (Omnetics PZN-12-AA) to interface via serial-peripheral interface (SPI) with the data acquisition board. From here an SPI cable transfers data through to the data acquisition system (Fig 1d). Compatible Open Ephys headstages can be purchased directly through Intan Technologies (Table 1) along with SPI cables.
The Open Ephys acquisition board (Fig 1d) allows for recording between 32 and 256 channels with USB 2.0, or up to 512 channels using USB 3.0. While such a high recording count is excessive for most EEG experiments, which typically record between 32 – 128 channels, the ability to record high channel counts comes at no extra cost to the user as their recording capacity is dictated only by the number of headstages and SPI cables they purchase. This means that to move from a 32-channel system to a 128 channel system, the user will need to purchase three more headstages and SPI cables. Amplifier outputs are sent to the headstage connectors (Fig 3e) of the acquisition board. The heart of the acquisition board is an Opal Kelly XEM6010 field programmable gate array (FPGA), which receives input from peripheral devices (e.g. the EEG cap) to process and sort incoming data. The data is then sent via USB or PCI express serial bus to transfer data from the acquisition board to the PC. Additionally, there are 8 analog input/output (IO) ports (Fig 3a & b) to register event data sent from external devices, and 8 digital IO ports (Fig 3c & d) for registering analog signals. The Open Ephys acquisition system can be purchased through the Open Ephys webstore (http://www.open-ephys.org/store/).
Finally, the PC (Fig 1e) accepts incoming data packaged from the acquisition board. Here, streaming data can be visualized through the Open Ephys graphic user interface (GUI). The Open Ephys GUI can be downloaded for free as an executable (http://www.open-ephys.org/gui/) or can be compiled from source code (https://github.com/open-ephys/GUI). The Open Ephys GUI is multi-platform, working on Linux, Windows, and Mac OS. Essentially, any computer would be compatible for running the Open Ephys GUI and recording data, so long as it has a USB interface. Depending on the intentions of use a powerful computer might be required to also run data analysis. However, for the purposes of running the Open Ephys GUI and recording data, any standard laptop or desktop will work.
In total, with current pricing, a brand new Open Ephys +EEG system, including a new EEG cap and computer, will cost approximately $7,060.97 on the low-end, which consists of a 32 channel system with a passive cap, and $25,247.10 on the high end, which consist of a 128 channel system with an active cap. However, if the user can utilize a previously purchased EEG cap and computer, the total cost of the system will be between only $5,130.97 (32-channels) - $9,207.10 (128-channels).
1.2. Open Ephys + EEG Assembly and Timeline
Open Ephys + EEG requires minimal work once the proper components have been purchased (Table 1). At this time, the Open Ephys +EEG breakout board schematics and design files as shown can be freely downloaded (www.github.com/open-ephys) and sent to a company for manufacturing. Many companies offer printed circuit board (PCB) manufacturing. For breakout board shown in Fig 1b and 2, we employed seeed studio (www.seeedstudio.com) for printing. In order to submit a print request, you upload the design files to the vendor website, and then select specifics about the design that will be necessary for printing. For seeed studio, the only necessary options are a PCB dimension of 10cm × 10cm, and two printing layers. The other options, such as PCB quantity, PCB color, surface finish, etc., can be set to their default values or changed for preference.
The PCB will come separate from the Omnetics connectors, Pak-50 connectors, and the headers; however, setting up the complete EEG breakout board requires minimal self-assembly consisting of soldering together a few key components (Fig 2, Table 1). Assembly is quite straightforward and listed in 3 easy steps here:
Solder one Pak-50 connector to each of the four positions in Fig 2a (green). The Pak-50 connectors are through-hole mounted, and contain a mixture of mounting pins, signal pins, and a ground and reference pin.
Solder one Omnetics connector to each of the four positions in Fig 2a (blue). The Omentics connectors are surface-mount devices (SMDs), which means the solder connections all occur on the surface of the PCB, as opposed to a through hole mount, where soldering connections occur on the opposite side of the PCB. Soldering SMDs can be difficult, especially when dealing with such small connectors. One method to solder these pieces is to carefully deposit a small amount of solder to the surface pads of the connector on the PCB. Then, line up the Omentics connector so all the feet are on top of the corresponding pad; you may want to hold the connector in position using a small clamp or carefully using your hands. Once secure, place the soldering iron onto the connector feet, individually, and press them into the deposited solder. After soldering the Omnetics connectors, apply epoxy around the base of the connector where it meets the printed circuit board. This will ensure stability of the connectors, as the connections formed by the solder will break under too much mechanical stress.
Solder the header pins into each of the positions shown in Fig 2a (orange).
Timeline: Altogether this process should take anywhere from 2 – 4 hours, the bulk of this time being the soldering of the Omnetics connectors as the contacts are quite small. Once the epoxy has set, the adaptor will be ready for use.
1.3. Electrical Safety
Electrical safety is a source of concern when dealing with EEG as the electrodes provide a low-resistance path for electrical current to flow. If there are any faults in wiring or a power surge occurs, it is possible that current will flow through the electrodes, to the person, and out through the ground. Inducing currents into a person can lead to excitation, heating, and burning of tissue, which can result in pain, injury, or in extreme cases, death. At high enough currents (0.1–100 A), a few seconds of exposure to the mains voltage is enough to produce these effects (Webster, 2009). A solution for this problem is to electrically decouple the subject from the mains supply (Ebner, Sciarretta, Epstein, & Nuwer, 1999).
One method of isolation, which is currently with Open Ephys + EEG, is implementing a battery pack. This is the preferred method of most commercially available systems. The battery pack is intended to run the entire system from a power source that is electrically isolated from the mains voltage. A downside to this method is the fact that the length of recording will be based off of the load imposed on your battery pack and its internal powering capacity. Another method is to create a power isolation circuit that decouples the subject completely from the isolation power (Tallgren, 2006; Tyner, Knott, & Myer, 1983). This is currently being developed for Open Ephys (https://github.com/open- ephys/headstage-isolation-board) in accordance with IEC 60601–1 standards for medical electrical equipment. The isolation circuit will create an interface between the amplifiers and the acquisition board. Data from the amplifiers will be transferred via Analog Devices’ digital isolators (ADuM240 series), which have previously been implemented for meeting above IEC standards, power will be provided to the amplifier by a DC-DC transformer, while ground planes will be separated into an isolated participant ground (amplifier side) and the true ground (acquisition board side) (Abtahi, Aslamy, Boujabir, Seoane, & Lindecrantz, 2015). These methods serve to electrically decouple the amplifier from the mains supply so that potentially dangerous currents cannot reach the participant (Lee et al., 2012; Piipponen, Sepponen, & Eskelinen, 2007). This isolation circuit, however, is currently still in development. We advise those interested in using the Open Ephys + EEG system for human recordings consult their Institutional Review Board (IRB), and determine the appropriate safety standards and practices as they apply to their institution.
2. Using the Open Ephys GUI
Once all components are purchased and assembled, you will only need to configure the Open Ephys GUI to begin recording. After downloading the GUI from (http://www.open-ephys.org/gui/), start by clicking on the Open Ephys executable, which will open a new window (Fig 4). On the left hand side of the window you will see a list of Processors (Fig 4a) consisting of Filters, Sinks, and Utilities. For the purposes here we will only describe the minimal setup you will need for running a basic EEG recording; however, many of the processors in the GUI may be useful for more advanced EEG experiments. The GUI works by dragging and dropping modules into the signal chain (Fig 4b), which sets the path for incoming data. First, drag and drop the “Rhythm FPGA” module to the signal chain (Fig 4c). The “Rhythm FPGA” module is what initiates communication with the FPGA in the acquisition board. Here you have control over the acquisition board; you can change the sampling rate, toggle the recording of all digital and analog channels, control processes of the amplifiers, and even change the operation of LEDs on the board. Next, it will likely be useful to incorporate a filter; as most EEG signals are recording within the 0.1–100 Hz range. Drag and drop the “Bandpass Filter” module to the right of the “Rhythm FPGA” module in the signal chain (Fig 4d), and set the lowcut to 0.1 and the high cut to 100, for example. This will then take the incoming raw data from the FPGA and filter it within the prescribed band. Finally, to visualize the data in real-time, drag and drop the “LFP Viewer” module to the right of the “Bandpass Filter” module in the signal chain (Fig 4e). If you click on the top hat on the “LFP Viewer” in the signal chain, it will open a new viewing window where you can look at incoming data, toggle the view, and change the scaling.
To save the data, simply click on the drop down arrow on the top right of the Open Ephys GUI window. In the prompt, select the desired file format (discussed in section 3.1), file path, and file name to save (Fig 4f).
3. Data Analysis
Streamlining and simplifying data processing is an important hallmark that new recording methods must have in order to be desirable for consumer use. To this end, in an attempt to make the processing of Open Ephys data an easy transition for EEG users, here we describe how Open Ephys data can be handled a variety of ways. Our flexible open-source methods allow individual users the freedom to create their own analysis tools for their system and needs. Below we highlight two main considerations in handling Open Ephys + EEG data: (1) data types and conversion (Section 3.1), and (2) noise reduction (Section 3.2).
3.1. Data Types and Conversions
Open Ephys data can be saved directly to four file types: Open Ephys, Flat binary, NWB, and KWIK. Switching which data format you save to is simply done through the Open Ephys GUI by selecting one of the previously listed formats from a drop down box at the above toolbar. For the purpose of description below, we chose the Matlab compatible Open Ephys format and describe how to convert to a Matlab readable file. The Open Ephys files types are ‘.continuous’, which saves continuous electrophysiology data, ‘.events’, which saves digital events, and ‘.spikes’, which saves spike sorting events. Each data type can be converted to Matlab, but for EEG purposes we focus on the ‘.continuous’ data type, as it will provide us the EEG traces for each recorded channel. In order to convert ‘.continuous’ files to use in Matlab, an Open Ephys analysis toolbox, available for free online (https://github.com/open-ephys/analysis-tools), must be used. Once downloaded, Matlab can be used to easily convert the ‘.continuous’ data type to the ‘.mat’ format, as shown by the code below:
% Converting 32 channels of data from ‘.continuous’ to ‘.mat’ for for ch=1:32 [data, timestamps, info] = load_open_ephys_data([‘100_CH’,num2str(ch),’.continuous’]); save([‘ch’,num2str(ch),’.mat’],’data’,’timestamps’, ‘info’); end
The function ‘load_open_ephys_data’, from the Open Ephys analysis toolbox, essentially parses and translates the custom ‘.continuous’ file type. The input of the function is the filename in a string, and it will return double-precision floating-point values of the data for that channel, stored in micro volts, and the timestamps, stored in ms. Information regarding events, such as timing and the digital channel that the event occurred on during the recording, is also obtained. This is stored in the form of a Matlab structure that contains information such as the data format used, the sampling rate of the recording, the channel number, the buffer size, and the event channels along with their corresponding timestamps.
This conversion is useful when analysing data with custom Matlab scripts. However, in the data analysis described in the next section, we have also used the open-source Matlab toolbox EEGLAB (Delorme & Makeig, 2004), available for download at http://sccn.ucsd.edu/eeglab/. In order to import data into EEGLAB, it is necessary to first concatenate all of the data into a single matrix:
% Concatenating data into a single ‘.mat’ file for use with EEGLAB all_channels = []; for ch=1:32 load([‘ch’,num2str(ch),’.mat’], ‘data’); all_channels(:,ch) = data; end save(‘all_eeg.mat’, ‘all_channels’);
Loading data into EEGLAB then requires knowledge of the sampling rate and the number of channels loaded. While this is one example, the flexibility of Open Ephys data enables use for any number of analysis software or toolboxes. There are many other open-source software packages that can be used to analyse EEG data, see also MNE at http://martinos.org/mne/stable/index.html, but for simplicity we have focused on EEGLAB here.
3.2. Noise Reduction
Environmental noise is always an issue with electrical recording methods, and human EEG is no exception. Variations or errors in improper grounding, capacitive coupling of participants to the mains supply, and AC devices all contribute to overall noise registered in human EEG (Ferree, Luu, Russell, & Tucker, 2001). As the Open Ephys + EEG system is not immune to noise, here, we describe observed noise and means of reduction applied to the data collection in Section 4.
Many electrophysiological recordings, including EEG, contain what is referred to as line noise, which is noise generated from the power lines and depending on the country, is either 50 or 60 Hz. While line noise is outside of the frequency bands of interest for many EEG applications, it is best to reduce line noise as much as possible (Ferree et al., 2001). Electronically, noise can be reduced by appropriate implementation of recording amplifiers. Intan amplifier chips make use of unipolar differential recording, meaning that the incoming signal from each electrode is compared against a common reference. This common-reference has a much lower impedance than the input impedance for each signal electrode (Technologies, 2012), and therefore produces a large noise signal (Winter & Webster, 1983). By tying the true common-reference, i.e. the ground, to the current reference, the noise in the signal path was compared to the ground signal, which was also contaminated with the same noise (Light et al., 2010), and hence removed. Additionally, impedance measurements were taken throughout EEG application to assure there was no impedance mismatch across electrode channels, as this can introduce noise.
Ground loops can also provide a source of noise to the recording system. Electrical devices generate a leak current to the ground that causes small differences between the ground at different points (Tyner et al., 1983). Removing any devices connected to ground will drive down leakage currents that produce noise within the ground.
Finally, all of our recordings were conducted inside a shielded room. A shielded room serves as a measure to absorb external electromagnetic interference, prohibiting our system from picking up the noise outside the room. As with all EEG systems, even with proper referencing, grounding, and shielding, 60-Hz noise from the mains supply may still persist. This is because capacitive coupling between the participant and any nearby power lines still exists (Ebner et al., 1999). Therefore, raw data traces will still exhibit a 60-Hz interference (i.e, line noise), albeit reduced in magnitude. To remedy this, it is standard practice is to apply a digital 60-Hz notch filter after data acquisition (Ferree et al., 2001), to suppress the remaining 60-Hz noise can be suppressed.
4. Examples
In this section, we present three examples of commonly recorded EEG signals (low frequency rhythms, sensory evoked responses, and EMG activity) obtained with the Open Ephys + EEG system. EEG was recorded with a commercially available electrode cap from Brainvision, using the standard 10–20 system (Fig 5). In each example, data analysis was conducted with Matlab using either custom scripts or the open source Matlab toolbox, EEGLab (Delorme & Makeig, 2004). Raw data was down sampled to 250 S/s, to reduce computational burden, and then visually inspected to remove any large magnitude noise. Data was then band-pass filtered from 0.1 to 100 Hz and notch filtered at 60 Hz to remove line noise. Plotted ERP’s received an additional low-pass 40 Hz filter for the sole purpose of visualization of lower frequency content of the ERP, such as the P300 (Ai & Ro, 2014). Depending on the data in question, one may not desire to use a 40 Hz low-pass filter, in the event that there is meaningful activity at higher frequencies. After filtering, we removed uncharacteristic large amplitude (>100 μ,V) signals. All EEG data underwent independent component analysis (ICA)-based artifact rejection using the FastICA algorithm (Vigario, Sarela, Jousmaki, Hamalainen, & Oja, 2000). As each EEG electrode recording is the mixed signal of a sum of neural sources, ICA separates the mixed signals into their individual components (sources) along with their respective weights. The components attributed to muscle, cardiac, and eye blink artifacts were visually identified and were weighted to zero. More information about the FastICA algorithm, along with a free downloadable MATLAB software package can be found at Aalto University’s Deparment of Computer Science (https://research.ics.aalto.fi/ica/fastica/).
4.1. Example of Stable Spontaneous Low Frequency Rhythms: Eyes-Closed Alpha (7–14 Hz)
Monitoring changes in EEG from a relaxed eyes-closed state to a focused eyes-open state generated robust changes in alpha band (7–14 Hz) activity over occipital cortex (Fig 6), consistent with many prior EEG studies (Berger, 1935). The data shown in Fig 5 was collected while participants sat comfortably in a chair and stared at a fixation point. An auditory cue was given every 10 seconds instructing the participant to either open, or close their eyes. During this time, EEG was recorded using the EEG Breakout Board and a standard, commercially available electrode cap from Brainvision. Raw (Fig 6a) and filtered (Fig 6b) traces from electrode Pz (Fig 5) showed increased magnitude in oscillatory alpha band activity during eyes closed epochs as compared to eyes open epochs. Additionally, power spectral density (PSD) calculation of one epoch (10 seconds) of eyes closed (Fig 6c, solid black traces) and eyes open (Fig 6c, dotted grey traces) from the Pz electrode shows an increase in power in the alpha band for the eyes closed state.
We compared recordings from the Open Ephys + EEG system to a standard Brainvision actiCHamp EEG system, during the eyes-open eyes-closed task described above using the same Brainvision actiCap (Fig 7). First, the participant, whose data is shown in Figure 7, performed the task with the Open Ephys + EEG system and was then switched to the Brainvision actiCHamp system. During the entirety of the recordings, the EEG cap was not removed and the participant remained seated in the same room. Both data sets were analyzed as data from Figure 6; they were downsampled to 250 S/s, bandpass filtered from 0.1 – 100 Hz and notch filtered at 60 Hz to remove the residual line noise. Following this, ICA was performed to remove eye blinks from each data set. Representative traces from the transition of an eyes closed to an eyes open state is shown in Figure 7a for both systems (top Figure: Brainvision, bottom Figure: Open Ephys + EEG). Additionally, a PSD was calculated over the 2–8 second (6 seconds) mark for each eyes closed epoch of both systems. The PSDs for each epoch were averaged for each system (Fig 7b). Qualitatively, both average PSDs provide similar results, with a peak at 11 Hz for this subject. The only difference between the two systems is the low frequency region component of the pink, or 1/f, noise at 0–1 Hz. This was anticipated since the Open Ephys + EEG system uses an AC amplifier, while the Brainvision system uses a DC amplifier (see section 1.1). Quantitatively, the average alpha band power for the Brainvision system was 14.84 +/− 1.44 (μV2/Hz) and the average power for the Open Ephys + EEG system was 14.93 +/− 0.94 (μV2/Hz). We also calculated the signal-to-noise (SNR) ratio of each system by defining the signal to be power in the 8–14 Hz band during eyes closed, and the noise to be power in the 8–14 Hz band during eyes open. This gave an SNR of 12.7 dB for the Brainvision system, and 13.6 dB for the Open Ephys + EEG system.
4.2. Example of Sensory Evoked Responses: Tactile Evoked Potentials
Sensory evoked potentials (SEPs) shown in Fig. 8 were generated by delivering brief taps to a subject’s finger-tip during a tactile detection task, as described in prior studies (Jones, Pritchett, Stufflebeam, Hamalainen, & Moore, 2007). More specifically, volunteers placed the third digit of their right hand over a custom made tactile stimulator, which delivered brief taps to the fingertip via a plastic screw that was driven by a piezoelectric bender. Stimuli were given as 100 Hz, 10 ms sine waves of varying amplitude dynamically titrated to maintain stimulus strength at perceptual threshold (50% detection). During this time, 32 channels of EEG were recorded using the EEG Breakout Board and a BrainVision electrode cap.
Fig 8 shows grand averaged SEP data from suprathreshold (i.e. detected) tactile stimuli from electrode C3 (Fig 5), averaged over 3 subjects (n=78 stimuli per subject). SEPs from perceived stimuli produced generic waveforms, consistent with previously reported EEG tactile evoked responses (Ai & Ro, 2014; Jones et al., 2007). A large positive deflection begins at ~330 – 500 ms post-stimulus; a two-tailed t-test (p < 0.05) was performed to highlight the region of significance of the ‘P300’ from zero (green box Fig 8). The RMS noise, taken to be the pre-stimulus time period (−200 to 0 ms), was calculated to be 6.0117 ± 2.069 μVrms.
4.3. Example Use of EEG Breakout Board: EMG Recordings
The EEG breakout board also allows recording of additional electrophysiology signals (see Fig 2c for example connectivity). Here, we show an example recording EMG data (Fig 9). EMG electrodes were placed on the subject’s right forearm, over the flexors, with a reference electrode placed on the wrist.
Recordings were carried out with the Open Ephys EEG Breakout Board, using the method described in Section 1.1, and disposable EMG electrodes. EMG data was monitored during periods of rest and periods of flexion movement of the hand and fingers. Periods of rest were marked by stagnant, low amplitude activity, while movement was marked by large amplitude (>0.3 mV) activity (Fig 9).
5. Discussion
We have described the parts and methods necessary to assemble a new low-cost, flexible and open source human EEG system using the Open Ephys platform. We have also provided details of how to analyze data from the system and evidence that this system can produce reliable recordings of the most commonly measured EEG signals; low frequency rhythms and sensory evoked responses, as well as EMGs. Additionally, we have shown recording efficacy in the Open Ephys + EEG system by running a side-by-side comparison with a commercial EEG system. Building on Open Ephys technology, this system can help transform the applicability of EEG to a wider user base by providing a stable and easily assembled system at an affordable price.
5.2. Expanding the Utility of Open Ephys + EEG
Due to the modular style of the Open Ephys +EEG system, the research applications are almost endless. One promising use of EEG is for closed-loop technologies; technologies that receive feedback from an EEG signal to drive an external device, such as a computer cursor, a wheelchair, a robotic arm, or an electric stimulator. In order for closed-loop technologies to work properly, they have two basic requirements; control and speed. With Open Ephys + EEG, signals such as ERPs or neural oscillations can be tied to a digital output on the acquisition board to allow for interfacing with an external device. For example, transcranial alternating current stimulation (tACS) has been used to selectively modulating working memory (Jausovec & Jausovec, 2014). Our system could enable a closed-loop design to selectively apply tACS during working memory by, for example, recording an EEG biomarker of working memory, such as the power of theta oscillations (Jausovec & Jausovec, 2014), and sending a digital signal or communicating over USB to an external tACS device that instructs it to stimulate only during theta activity. Signals from the tACS device can also be sent to the Open Ephys +EEG system to allow for syncing of external tACS events, such as the precise time of initiation of a tACS pulse. A demonstration of closed-loop capabilities with the Open Ephys system has already been published in the context of triggering optogenetic stimulation in mice (Siegle & Wilson, 2014). Here, the Open Ephys system was used in a closed-loop manner to trigger optogenetic stimulation by detecting peak theta power through the Open Ephys GUI and in turn driving a pulse generator to activate an LED. This setup boasted a ~20 ms loop time for signal detection and subsequent optogenetic stimulation (Siegle & Wilson, 2014). Additionally, the Intan amplifier chips used in this system have a “fast settle” function that blanks the electric history of the recording amplifiers within a few hundred microseconds (Technologies, 2012). This is highly applicable in closed-loop devices since quickly turning on and off the amplifiers can eliminate high voltage transients stemming from environmental noise, accompanying devices, or direct electrical excitation of electrodes, enabling immediate, reliable neural recordings.
The use of EEG as a clinical tool is invaluable. EEG is used not only as a diagnostic measure (e.g. monitoring epileptic activity) but it is also utilized as a therapeutic tool (e.g. managing ADHD with neurofeedback). Unfortunately, the high-cost of commercially available EEG systems, as well as the technical bar for self-use, makes it impractical for individuals to have EEG in their home. However, the low price and high customizability of Open Ephys +EEG advances the possible application to affordable home use. As such, patients would not need to commute to a hospital for a neurological checkup, and near-future therapeutics could easily be setup at a person’s bedside.
5.2. Current Limitations and Solutions
Even though there are proven benefits to open-source technology and information sharing, there are also some limitations. They do not provide staffed customer support for open-source projects, service technicians who can come look at your device if something is wrong, or paid engineers to bring you new tools and products. With open-source technologies, the burdens of development, ingenuity, and troubleshooting all fall upon the user. This can be a daunting proposition, especially for those who are inexperienced when it comes to electronics or coding. Therefore, open-source technologies require a strong user base to thrive. The users are what provide stability to the project and assurance to those who are seeking help when developing new ideas and tools within an open-source project space. That being said there are many successful open-source projects in the field of human electrophysiology complete with a large user base that openly share information, reduced production cost of technology, and a wide range of tools for generating new experimental techniques and testing novel hypothesis; and Open Ephys strives to these ideals. Currently, Open Ephys is being used in over 70 labs throughout the world. The community shares a variety of tools, both hardware and software, across multiple platforms; provides comprehensive user documentation on a dedicated wiki, and design documents and code on github; and posts discussions on a google groups based forum. There is even have a small webstore where hardware tools can be purchased. The Open Ephys system is heavily designed with expansion in mind, and comes ready to use with other open-source products such as RTXI, a software interface for real-time data acquisition and control, and Pulse Pal, a hardware precision tool for controlling stimuli, to record novel experimental designs (Lin, Bettencourt, White, Christini, & Butera, 2010; Sanders & Kepecs, 2014; Siegle, Hale, Newman, & Voigts, 2015).
While the system described has proven to be efficacious in recording common human neural signals, there are some limitations. First, our system is completely tethered; meaning, the electrode cap attached to the patient is connected directly to the acquisition board and the computer. This makes the use for the system impractical in recording EEG during more complex behaviors involving movement, or longer-term recordings. To address this issue, our system could be easily adapted to wireless recording, which would provide an ideal method of data transfer in running untethered experiments. Schematics and documentation are provided for all hardware and software of this system, therefore creating a wireless connection for EEG use on Open Ephys would simple to develop, troubleshoot, and implement. Fortunately, the data requirements necessary for EEG recordings are relatively low if you keep at a reasonable sampling rate. Since the Intan amplifier chips have 16-bit ADC resolution, recording 32 channels of EEG at 1 kS/s requires a data transfer rate of 512 kbps. While such a data rate could be handled with a wi-fi or even a Bluetooth link, adding more channels or making wireless connectivity compatible for different modes of recordings will inevitably lead to larger data rates that might be difficult to maintain.
Second, while our Open Ephys + EEG design (Fig 1) fosters the ability to freely connect with an Open Ephys compatible headstage allowing versatility to move between recording from humans to animals, it also leaves the headstages, and therefore the amplifiers, exposed with little protection and Open Ephys compatible headstage allowing versatility to move between recording from humans to the EEG breakout board. This would get rid of the need for a headstage, increase the stability of the amplifiers, and reduce the chances of damage. This would be a straightforward modification and could be done easily in-house, and if the number of Open Ephys +EEG users increases it could become commercially available.
Third, our system currently only supports certain commercially available electrode caps due to the fact that it uses specific connector types that are not universally used by all EEG electrode caps. However, our methods can be easily expanded to use other electrode caps. Developing a custom EEG adaptor for a cap type that is not currently supported only requires knowledge of the electrode cap pinout, i.e. what electrodes correspond to what pin in the connector. Once that information is obtained, a PCB can be fabricated that receives signals from the electrode cap and sends them to necessary connectors for the Open Ephys system.
6. Funding
National Institutes of Mental Health (R01MH106174); Brown Brain Sciences Institute and Norman Prince Neuroscience Institute at RIH. This material is based upon work supported in part by the Department of Veterans Affairs, Veterans Health Administration, Office of Research and Development, Rehabilitation Research and Development Service, Project N9228-C. The views expressed in this article are those of the authors and do not necessarily reflect the position or policy of the Department of Veterans Affairs or the United States government.
7. Acknowledgments
We would like to thank Open Ephys community for not only developing high-quality, open-source tools, but also for fostering discussion and aiding in trouble-shooting. Reid Harrison and Intan technologies.
8. References
- Abtahi F, Aslamy B, Boujabir I, Seoane F, & Lindecrantz K (2015). An affordable ECG and respiration monitoring system based on raspberry PI and ADAS1000: First step towards homecare applications In IFMBEProceedings (Vol. 48, pp. 5–8). Springer International Publishing. [Google Scholar]
- Ai L, & Ro T (2014). The phase of prestimulus alpha oscillations affects tactile perception. Journal of Neurophysiology, 777(6), 1300–7. [DOI] [PubMed] [Google Scholar]
- Baker SN, Gabriel C, & Lemon RN (2003). EEG oscillations at 600 Hz are macroscopic markers for cortical spike bursts. The Journal of Physiology, 550(2), 529–534. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Berger H (1935). Das Elektrenkephalogramm des Menschen. Die Naturwissenschaften, 23(8), 121–124. [Google Scholar]
- Delorme A, & Makeig S (2004). EEGLAB: an open source toolbox for analysis of single-trial EEG dynamics including independent component analysis. Journal of Neuroscience Methods, 734(1), 9–21. [DOI] [PubMed] [Google Scholar]
- Ebner A, Sciarretta G, Epstein C, & Nuwer M (1999). EEG instrumentation. The International Federation of Clinical Neurophysiology. Electroencephalography and Clinical Neurophysiology. Supplement, 52, 7–10. [PubMed] [Google Scholar]
- Farwell LA, & Donchin E (1988). Talking off the top of your head: toward a mental prosthesis utilizing event-related brain potentials. Electroencephalography and Clinical Neurophysiology, 70(6), 510–523. [DOI] [PubMed] [Google Scholar]
- Ferree TC, Luu P, Russell GS, & Tucker DM (2001). Scalp electrode impedance, infection risk, and EEG data quality. Clinical Neurophysiology, 772(3), 536–544. [DOI] [PubMed] [Google Scholar]
- Gotman J (1982). Automatic recognition of epileptic seizures in the EEG. Electroencephalography and Clinical Neurophysiology, 54(5), 530–540. [DOI] [PubMed] [Google Scholar]
- Gray CM, Maldonado PE, Wilson M, & McNaughton B (1995). Tetrodes markedly improve the reliability and yield of multiple single-unit isolation from multi-unit recordings in cat striate cortex. Journal of Neuroscience Methods, 63(1), 43–54. [DOI] [PubMed] [Google Scholar]
- Guger C, Harkam W, Hertnaes C, & Pfurtscheller G (1999). Prosthetic Control by an EEG-based Brain- Computer Interface (BCI). European Conference for the Advancement of Assistive Technology, (March 2016), 1–6. [Google Scholar]
- Helfrich RF, Schneider TR, Rach S, Trautmann-Lengsfeld SA, Engel AK, & Herrmann CS (2014). Entrainment of Brain Oscillations by Transcranial Alternating Current Stimulation. Current Biology (Vol. 24). [DOI] [PubMed] [Google Scholar]
- Jausovec N, & Jausovec K (2014). Increasing working memory capacity with theta transcranial alternating current stimulation (tACS). Biological Psychology, 96(1), 42–47. [DOI] [PubMed] [Google Scholar]
- Jones SR, Pritchett DL, Stufflebeam SM, Hamalainen M, & Moore CI (2007). Neural Correlates of Tactile Detection: A Combined Magnetoencephalography and Biophysically Based Computational Modeling Study. Journal of Neuroscience, 27(40), 10751–10764. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Klimesch W (1999). EEG alpha and theta oscillations reflect cognitive and memory performance: a review and analysis. Brain Research Reviews, 29(2), 169–195. [DOI] [PubMed] [Google Scholar]
- Lee V, Monski J, Williams W, Muthuswamy B, Swiontek T, Maharbiz M, … Kovac F (2012). A mixed-signal EEG interface circuit for use in first year electronics courses In ISCAS 2012 – 2012 IEEE International Symposium on Circuits and Systems (pp. 2689–2692). IEEE. [Google Scholar]
- Light GA, Williams LE, Minow F, Sprock J, Rissling A, Sharp R, … Braff DL (2010). Electroencephalography (EEG) and event-related potentials (ERPs) with human participants. Current Protocols in Neuroscience / Editorial Board, Jacqueline N. Crawley … [et Al.], Chapter 6, Unit 6.25.1–24. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Lin RJ, Bettencourt J, White JA, Christini DJ, & Butera RJ (2010). Real-time Experiment Interface for biological control applications In 2010 Annual International Conference of the IEEE Engineering in Medicine and Biology Society, EMBC’10 (Vol. 2010, pp. 4160–4163). IEEE. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Marshall L, Helgadottir H, Molle M, & Born J (2006). Boosting slow oscillations during sleep potentiates memory. Nature, 444(7119), 610–613. [DOI] [PubMed] [Google Scholar]
- Nunez P, & Srinivasan R (2006). Electric fields of the brain: the neurophysics of EEG. Retrieved from https://books.google.com/books?hl=en&lr=&id=fUv54as56_8C&oi=fnd&pg=PR11&dq=nunez+electric+fields+of+the+brain&ots=nXUg7RoIKY&sig=ewK6uUK93I3tYiCMaNRdDMEEwbE
- Piipponen K. Va. T., Sepponen R, & Eskelinen P (2007). A biosignal instrumentation system using capacitive coupling for power and signal isolation. IEEE Transactions on Biomedical Engineering, 54(10), 1822–1828. [DOI] [PubMed] [Google Scholar]
- Renard Y, Lotte F, Gibert G, & Congedo M (2010). OpenViBE: an open-source software platform to design, test, and use brain-computer interfaces in real and virtual environments. Presence: Teleoperators. Retrieved from http://www.mitpressjournals.org/doi/abs/10.1162/pres.19.L35
- Sanders JI, & Kepecs A (2014). A low-cost programmable pulse generator for physiology and behavior. Frontiers in Neuroengineering, 7(December), 43. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Schalk G, McFarland DJ, Hinterberger T, Birbaumer N, & Wolpaw JR (2004). BCI2000: A general-purpose brain-computer interface (BCI) system. IEEE Transactions on Biomedical Engineering, 51(6), 1034–1043. [DOI] [PubMed] [Google Scholar]
- Shein-Idelson M, Ondracek JM, Liaw H-P, Reiter S, & Laurent G (2016). Slow waves, sharp waves, ripples, and REM in sleeping dragons. Science, 352(6285), 590–595. [DOI] [PubMed] [Google Scholar]
- Siegle JH, Hale GJ, Newman JP, & Voigts J (2015). Neural ensemble communities: Open-source approaches to hardware for large-scale electrophysiology. Current Opinion in Neurobiology. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Siegle JH, & Wilson MA (2014). Enhancement of encoding and retrieval functions through theta phase-specific manipulation of hippocampus. eLife, 2014(3). [DOI] [PMC free article] [PubMed] [Google Scholar]
- Soikkeli R, Partanen J, Soininen H, Paakkonen A, & Riekkinen P (1991). Slowing of EEG in Parkinson’s disease. Electroencephalography and Clinical Neurophysiology, 79(3), 159–165. [DOI] [PubMed] [Google Scholar]
- Tallgren P (2006). DC-EEG for routine clinical use: Methods and clinical impact. Retrieved from http://www.tkk.fi
- Technologies, I. (2012). RHD2000 Series Digital Electrophysiology Interface Chips RHD2216 RHD2132 Digital Electrophysiology Interface Chips.
- Tyner FS, Knott JR, & Myer B (1983). Fundamentals of EEG Technology: Basic concepts and methods (83rd ed.). Raven Press. [Google Scholar]
- Vanhatalo S, Palva JM, Holmes MD, Miller JW, Voipio J, & Kaila K (2004). Infraslow oscillations modulate excitability and interictal epileptic activity in the human cortex during sleep. Proceedings of the National Academy of Sciences of the USA, 101(14), 5053–5057. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Vigario R, Sarela J, Jousmaki V, Hamalainen M, & Oja E (2000). Independent Component Approach to the Analysis of EEG and MEG Recordings. IEEE TRANSACTIONS ON BIOMEDICAL ENGINEERING, 47(5). [DOI] [PubMed] [Google Scholar]
- Webster J (2009). Medical Instrumentation Application and Design (4th ed.). Wiley Global Education. [Google Scholar]
- Winter BB, & Webster JG (1983). Reductionl of Interference Due to Common Mode Voltage in Biopotential Amplifiers. IEEE TRANSACTIONS ON BIOMEDICAL ENGINEERING, (1). [DOI] [PubMed] [Google Scholar]
- Wolpaw JR, McFarland DJ, Neat GW, & Forneris CA (1991). An EEG-based brain-computer interface for cursor control. Electroencephalography and Clinical Neurophysiology, 78(3), 252–259. [DOI] [PubMed] [Google Scholar]
- Worden MS, Foxe JJ, Wang N, & Simpson GV (2000). Anticipatory biasing of visuospatial attention indexed by retinotopically specific alpha-band electroencephalography increases over occipital cortex. The Journal of Neuroscience, 20(6), RC63. [DOI] [PMC free article] [PubMed] [Google Scholar]