Comparison between Butterworth Bandpass and Stationary Wavelet Transform Filter for Electroencephalography Signal

The Electroencephalography (EEG) signals able to obtain the information from the brain signals. Reduce the noise of the raw EEG data can improve the accuracy of the result. The pre-processing step of the raw EEG data can generate a clean signal and improve the accuracy. The purpose of this paper is to compare the Butterworth bandpass (BB) and stationary wavelet transform (SWT) method for the pornography addiction EEG data. The data was collected from Yayasan Kita dan Buah Hati (YKBH), Jakarta, Indonesia, using the Brain Maker EEG machine with 19 channels. We used mean square error (MSE) and peak-to-noise ratio (PSNR) to compare the quantitative value for the filtered EEG signals. The result shows that the BB filter is more effective in removing the noise and keep the original information.


Introduction
Brain activities have been used by the scientist to understand human behaviours. Potenza [1] proved that brain activities reflected with addictive behaviours. A specific region of our brain correlates with different behaviours. However, the raw EEG signals are consist of noise and artefacts. To process the EEG signals, people usually transfer the raw data into different frequencies before analyzing the data. Mostly there are four essential bands are used for the researcher measure the brain activity which are δ (1 to 4Hz), θ (4 to 7Hz), α(8 to 15Hz), and β (12.5 to 28Hz) [2]. Before training any machine learning algorithm using EEG information, researchers usually generate a specific code (in the form of a script) to retrieve peak values, wave frequencies, or translate raw EEG data into a Fourier transform continuum diagram, or turns to a wavelet. Then the data can be used to develop a classification model. According to Caglar [3], there are four steps to process the EEG signals after collecting the raw EEG data.
1. The first step is the pre-processing, which reduce the noise of the data. The less noise of the data will provide higher accuracy in the following steps. 2. The second step is the feature extraction to minimize the loss of valuable information. 3. The third step is the feature reduction to remove the unimportant information. 4. The last step is the classification which determines the group of the input data. The pre-processing step will improve the accuracy of the result. Daud, S.S, et al., 2015, used BB and SWT as a pre-processing method [4]. To check the quality of the filter, MSE and PSNR used for the testing [5]. The MSE and PSNR aim to measure the quality of the signal. The score shows the degree of the similarity/fidelity and level of error/distortion between the original signal and filtered signal.
The MSE between the signals can be defined as where x and y are two finite lengths (discrete signals), N is the number of signals samples, and x and y are the values of the samples in x and y [5]. The MSE value usually converted into the PSNR value for determining the quality of an image in decibel value. PSNR can be defined as = 10 log 10 where L is the dynamic range of allowable image pixel intensities [5]. Moshfeghi, M et al., 2020, suggested that the bandpass is more suitable for the EEG signals filtering process [6]. The bandpass filters able to filter specific frequency for analysis, and another reason is able to retain the original signal with removing the artifacts. We expected that our result would also show a better outcome after applying bandpass.

Material
The EEG signal data was collected from YKBH, Jakarta, Indonesia. The data was collected using the Brain Maker EEG machine with 19 channels. Figure 1 shows the experiment set up for this study. The participants wear the EEG device while watching a stimulus that displayed on the monitor. The signals will be collected when the participants were doing the tasks. There are 14 participants (girl =5, boy = 9) are joining in this experiment. The ages varied from 13 to 15 years old. The psychologist has verified among the 14 subjects that 7 of them have a porn addiction, and 7 of them do not have a porn addiction. Table 1 and figure 2 displayed the details of the participants. In our research, we choose S12 and S11 for our pre-processing steps since one is addicted subjects, and another one is non-addicted subjects. There are six tasks in the data collection process. The total times for one participant are 12 minutes. The six tasks are baseline, emotional state, task 1, task2, task 3, and baseline extension. There are two baseline data collections, one at the beginning and one at the end with eyes open and eyes closed. The emotional state data were collected for happy, calm, sad, and fear, each emotion for 1 minute. The emotional state was based on the International Affective Picture System (IAPS) [7]. It provides a set of colour photographs that set of normative emotional stimuli. The stimuli will show a picture of happy, calm, sad, and fear photos for the participants. Task 1 is memorizing 15 words in 1 minute, and task 2 is an executive task in 2 minutes where the participants watch a video given by psychologist. Task 3 is the recall 15 words form task 1 in 1 minute. Table 2 displays an overview of the protocols.

Methodology
There are 19 channels from the original signal (see figure 3), however, we will only use three channels for our pre-processing experiment as the preliminary study for the pre-processing methods. The channels are Fp1, Fp2 and Fz. We selected data from two different participants. One is an addiction, and one is non-addiction. For this experiment, we choose the first baseline, one minute for eye closed.  We selected 15 000 data points with 60 seconds duration. The raw data saved in the tdms file and we have converted into a csv file. The sampling rate of the data frequency is 250 HZ. We loaded the data into MATLAB software for data processing process. Firstly, we used QtiPlot to convert the raw EEG data into a csv file. After we converted the raw EEG data, we loaded csv file in MATLAB and save the data into vectors. We selected three channels for our processing which are: Fp1, Fp2 and Fz. The channel information is generated from the EEGLAB. Table 3 displayed the details of each channel. We choose the Fp1 and Fp2 and Fz because it is the prefrontal area which is most related to the addiction behaviour [8].
Secondly, after we imported the data and got the channel information, we have selected the Fp1, Fp2 and Fz for both addicted and non-addicted subjects. The following figure displays the steps for the preprocessing step.  The first filter we used is a 4 th order of BB. This type of filter is chosen because it has a linear response compare to others. The cut-off frequency was 4 -40HZ. The delta frequency is below 4 HZ, and gamma frequency is more than 40HZ. These two frequencies were eliminated because it considers as noise. Hence, we choose the frequency band between 4-40 HZ.
The second filter is the SWT filter. The dB3 wavelet mother with five decomposition levels of decomposition is chosen for this filter [9]. This wavelet was selected because it can detect and localize the spike in the EEG signal [10].
After obtaining a clean signal from these two filters, we will save the clean signals in jpeg image. After we get the original signal image and filtered signal image, we will use the MSE and PSNR value to determine the quality.
(e) (f) Figure 6. (a) Clean Fp1 signal after BB filter for addiction subjects (b) Clean Fp2 signal after BB filter for addiction subjects (c) Clean Fz signal after BB filter for addiction subjects (d) Clean Fp1 signal after BB filter for non-addiction subjects (e) Clean Fp2 signal after BB filter for non-addiction subjects (f) Clean Fz signal after BB filter for non-addiction subjects.

Signal after BB Filter
The cut off frequency for the filter is 4 -40HZ. The function is used the BB filter function in the MATLAB. The low pass is 4hz, and the high pass is 40. The order of the bandpass filter is 4. This number is a reference from [4]. The code is used for the bandpass filter in MATLAB to get the filtered data. The frequency of the data is 250hz. Figure 6 displays the result for the BB filter for Fp1, Fp2 and Fz:  Figure 7 displays the EEG signals after using the SWT. We used the wavelet in db3 and level of 5. The following script is the code of the SWT filter from MATLAB.  Figure 8 and Table 4 display the MSE for BB filter and SWT at channel Fp1, Fz and Pz for addiction and non-addiction subjects.  The BB filter has a lower MSE value compared to the SWT filter from the figure and table above. The most difference is shown from the addiction subject on channel Fp1. The BB is only 4.005, and SWT is 144.0059. The most percentage difference we can see from the addiction subjects for the Fp1, Fp2 and Fz channels. Based on Table 5 and Figure 9, it shows that the BB filter has more significant PSNR value at the three channels for both addiction and non-addiction subjects. It means that it has more noise filtered out.

MSE and PNSR
Compare to the Daud [ dB3 and 5 decomposition level. In addition, the original information does not loss for the BB Techniques. Figure 9. PSNR of the BB and SWT filter

Conclusion
There are many noise data that affect the accuracy of the EEG signal. In this paper, we have compared two different filters to reduce the noise from the original data. The MSE and PSNR is a popular parameter to determine the quality of signal after filtering. BB is able to remove all artifact and keep the original information from our research results.