## 5 Presentation of Expert System Based on the Various Algorithms  
EmotivPRO offers highly advanced solutions for the archiving of raw EEG signal. The user can easily export it and check its features and properties with any other software. Figure 16 shows the appearance of the desktop offered by the dedicated software EmotivPRO for the Emotiv kit.  
In the case of continuation of the research proposed in this approach, all analyses and classification methods were again performed on a programming and numerical computing  
Figure 16: Signal analysis dashboard in EmotivPRO software.  
Figure 15: Comparison of filtered and integrated signals—Person 10.  
platform, which is Matlab. An expert system was also designed there, including classic algorithms and an artificial neural network. The scheme of the system's operation is presented in Figure 1.  
The designed system is composed of several components. The signal collected by the Emotiv EPOC Flex device goes to the computer connected with the set. The raw signal should be properly filtered (see Section 3.1) as such data is difficult to qualitatively evaluate and classify.  
The same applies to the EMG signal, which is filtered using a moving average of 5 voltage measurements. Such a procedure is necessary in order to smooth the signal and make it easier to read by the user, and with the intention of removing of various types of interference.  
The EEG signal after the filtering operation is subjected to time-integration for each of the 22 electrodes separately. It is therefore a reuse of this method that took place in the [5] pilot test preceding this study. The signal integration is performed for one second during the entire duration of the signal. The result is one-second integrated samples. This approach is simple but effective, because thanks to it the system is able to efficiently classify two states of interest to researchers, i.e., the image of movement and the lack of it. Details on the integration method and filtering of the EEG signal are provided in Section 3.1.  
The modified EEG and EMG signals (see Figure 1) are assessed by an expert system. This program is used to classify them accordingly (see Figures 1 and 5). Its structure is composed of several cooperating algorithms. The most crucial element of the classification system is the feed-forward neural network. The use of this method related to artificial intelligence is quite simple and effective at the same time, so it was decided to choose it again. In the current approach, the multilayer neural network has 22 inputs and 2 outputs, as it classifies only two signal states, i.e., arm movement selection and no arm movement. The second algorithm cooperating with the neural network is a classic algorithm that classifies three selected states, i.e., blinking the right and left eyes, as well as blinking both eyes at the same time. Both parts of the system have an appropriate set of data at the output, which then goes to the verification algorithm (see Figure 5).  
Moreover, the classified EMG signal is fed to the same algorithm. The program that analyzes this signal outputs a binary value, where the zero value means no muscle stimulation, and the binary one means shortening the muscles by the examined person. (see Figure 5).  
The recognized EEG and EMG signals checked by the verification algorithm trigger a forward and right or left command. It can be passed to the robot to execute requested commands (see Figure 1). The robot is controlled only when the arm muscles are not moving. If the verification of the EMG signal indicates the activation of this part of the muscles, the command of movement to the motors of the LEGO Mindstorms EV3 mobile robot is interrupted.