# A Wireless EEG System for Neurofeedback Training
## 3 System Architecture of the EEG Device
### Transmission Module
#### 3.2.5 Software  
Three ADC boards were plugged together for 40-channel EEG acquisition. The wirelessly transmitted data from the hardware front-end to the host computer made the system portable. This allowed the connection of up to 3 modules of 16 channels to the PC via different receivers connected to the USB ports on the PC. The instructions for the PIC18F2420 were supported by the software tools for the family of devices (MPLAB environment, MPLAB C18 C-compiler, and MPASM assembly language [28]). The main program takes a sequence of ADS129x task-related converted data, standby mode, input common mode, and reading and writing registers, controlling the ADS129x operations including acquisition, translation, and formatting of data. Data transmission to the software platform was performed by the standalone program.  
The core functions of the software were data storage and real-time signal visualization (Figure 11). The software package provided reading, visualization, and recording of up to 40 channels. Algorithms for online analysis of the signal were implemented to provide real-time, stimulus-generated feedback, and functioning during neurophysiological tasks to create visual and auditory stimuli. Through temporal synchronization of stimuli events and data recording, the EEG signals and the task conditions can be compared with each other for further analysis. The real-time trace visualization of electrophysiological signals enabled the user to control the program through receive (\"Start\" and \"Stop\") and record buttons (\"Stimulus\" and \"NF\") (Figure 11). The generated stimuli, relevant to the external input, elicited EEG responses to certain experimental events synchronized to the EEG time stamps. The system implemented completed hardware and software EEG signal acquisition in various tasks. The stimuli were generated in C/C++ software on an NVIDIA GeForce GTX 1080 graphics card (Dell Alienware). At the same time, the acquisition front-ends for the EEG data recorded the 40 channels and the corresponding timestamps on a laptop (Acer Predator). Each dataset was constructed using EEG time stamps in the signal aligned to the stimulus events. A low-cost expansion of the EEG system for neurofeedback application was adapted for broad public use. The signal processing by the software was an important part, being the hardware component of the NF-EEG system where data collection takes place for high-speed performance in C/C+ and real-time signal processing in MATLAB [1; 22].  
For validation of the EEG system, a comparison of the data collection of the proposed system with the controlled data of the Nikon Kohden EEG system was performed (Figure 2). Both datasets correlated well, showing good agreement for the data in the time and frequency domains.  
The experiments showed an average of a 25 dB SNR over 10 trials (20 \(\upmu\)V EEG signal) which contained 250 \(\times\) 10 samples with a gain of 12 and sampling frequency of 250 Hz (Figure 1B; gains 1-12). The internal noise in the AFE analog circuit was quantified by analyzing the input-referred noise with short positive and negative analog inputs. The experiment showed the peak-to-peak and root mean square input-referred noise (Vpp = 2.29 \(\upmu\)V; Vrms = 0.34 \(\upmu\)V) under the data reported in the manual of the ADS129x AFE (2.4 \(\upmu\)V; 0.4 \(\upmu\)V) at a sampling frequency of 250 Hz and bandwidth of 0.01-70 Hz of the signal.