Journal of Theoretical and Applied Information Technology30th June 2016. Vol.88. No.3
© 2005 - 2016 JATIT & LLS. All rights reserved.
ISSN: 1992-8645 www.jatit.org E-ISSN: 1817-3195
558
COMPARING WINDOWING METHODS ON FINITEIMPULSE RESPONSE (FIR) FILTER ALGORITHM IN
ELECTROENCEPHALOGRAPHY (EEG) DATA PROCESSING1NOVA EKA DIANA, 2UMI KALSUM, 3AHMAD SABIQ, 4WISNU JATMIKO, 5PETRUS
MURSANTO1,2,3E-Health Research Center, Faculty of Information Technology, YARSI University, Indonesia
4,5Faculty of Computer Science, University of Indonesia
E-mail: [email protected]
ABSTRACT
Electroencephalography (EEG) data contains electric signal activities on a cerebral cortex to record brainelectrical activities. EEG signal has some characteristics such as non-periodic, non-standardized pattern,and small voltage amplitude. Hence, it is lightly heaped up to noise and difficult to recognize and extractmeaningful information from EEG data. Finite Impulse Response (FIR) with various windowing methodshas been widely used to mitigate noise and distortions. This paper compares and analyzes the windowingtechniques in resulting the most optimal results in EEG filtration process. The experiment results show thatBlackman Window gives the best result in term of the most negative value in stop-band attenuation, thewidest transition bandwidth, and the highest cutoff frequency compares to Rectangular Window, HammingWindow, and Hann Window.
Keywords: Electroencephalography (EEG), Finite Impulse Response, Windowing Methods, SignalFiltering, Blackman Window
1. INTRODUCTION
Electroencephalography (EEG) data signalconsists of electric signal activities on a cerebralcortex with some characteristics, such as non-periodic, non-standardized pattern, and smallvoltage amplitude. These attributes evoke EEGsignal to be swiftly mixed up with noise anddifficult to recognize [1]. Many factors can generatenoise and distortions, e.g. room exposure, energeticradiation, heart, muscles, and eyes movement.Noise and other parameters such as a suddenchange in signal phase and loss of signal amplitudecan briefly stimulate distortion in the signal [2].
Data filtering is used to mitigate noise ordistortions in EEG data. Many techniques havebeen proposed to process data signal filtering, suchas Finite Impulse Response (FIR) digital filter. Inmany cases, a bad filter design can induce signaldistortions to occur. Windowing methods areusually employed to extract and repair impulseresponses in FIR filter. Many researchers hadproposed different windowing methods, but onlysome can give a good result in filtering EEG data.This paper focuses on comparing four windowing
methods to get the best outcome in EEG signalfiltering process.
We organized this article as follow: Section IIdiscusses literature reviews, Section III explains themethods used in this research, and Section IVprovides results and discussion. Finally, Section Vpresented the conclusion and future works.
2. MOTIVATION
Electroencephalographic (EEG) is ameasurement procedure using electro-medicalequipment to record electrical activities of the brainand its interpretation. Neurons in the cerebralcortex issue electric waves with a minimum voltage(mV) which then passed through an EEG machineto do an amplification process. After it is amplified,the recorded EEG size will be enough to becaptured by the reader's eyes as an alpha, beta, andtheta wave [3]. EEG signal is used to diagnosediseases related to brain and psyche, such asepilepsy, brain tumors, detect the position orlocation of the injured brain and diagnose mentaldisorders.
Many researchers have proposed variousmethods to filter EEG data. Surface Laplacian (SL)
Journal of Theoretical and Applied Information Technology30th June 2016. Vol.88. No.3
© 2005 - 2016 JATIT & LLS. All rights reserved.
ISSN: 1992-8645 www.jatit.org E-ISSN: 1817-3195
559
filter is used to emphasize the electrical activitiesthat are spatially located near the electrode whichcurrently being recorded, and to sift out signals thatmay come from outside of the skull. SL filter alsomuffles EEG activities which are common todedicated channels hence increasing the spatialresolution of the recorded signal [4]. However, SLfilter can only be applied to EEG data with thenumber of 64 electrodes or more [5].
Another researcher, Guerrero-Mosquera andVazquez used Independent Component Analysis(ICA) and Recursive Least Squares (RLS) methodto eliminate the eye movement artifacts in EEGdata. The method uses separate electrodes thattightly localized to the eyes, in which register tovertical and horizontal eye movements forextracting a reference signal. This procedureprojects each reference input into ICA domain, andthen RLS algorithm estimates the interference thatmay occur in this data. This proposed methodefficiently rejected artifacts produced by eyesmovements by relying on ICA and RLS adaptivefiltering [6]. Miyazaki et al. also utilized InfiniteImpulse Response (IIR) filter to eliminate theartifacts from EEG data. Their research resultsshowed that the IIR filter can remove artifacts inEEG data quite well. However, IIR has poles thatlead the filter to be unstable [7].
Different with the aforementioned methods, FIRfilter does not require many electrodes and not onlyfocus on the noise of eye movements. Hence, FIR ismore stable than other filters above. In thisresearch, we utilize FIR filter to process EEG datathat is captured using Emotiv EPOC device with 14electrodes.
3. METHODOLOGY
3.1 Finite Impulse Response (FIR)Finite Impulse Response (FIR) has a finite
response and no poles compare with IIR filter. FIRis more stable than other digital filter andpreferably used by researchers. In general, theoutput of FIR filter y[k] can be expressedmathematically as Equation 1.
1
0][][][
M
nnkxnhky (1)
where M is the filter length, h[n] is the impulseresponse’s coefficient, x[n] is the input filter andy[k] is the output filter.
The transfer function of FIR filter isapproximately ideal following the increasing offilter order. Equation 2 expressed this process,
where m is the order of the filter, ΔF is thetransition width normalization, Δf is the transitionwidth, and fs is the sampling frequency. Somewindowing types to implement FIR filter areBlackman, Hamming, Hann, and Rectangularwindow. Each windowing type has a different valueof normalized transition width (ΔF), as depicted inTable 1.
fsfFm
(2)
Table 1: Normalization of Transition Width.
Window Type Transition WidthNormalization ΔF
Blackman Window 5.5/MHamming Window 3.3/M
Hann Window 3.1/MRectangular Window 0.9/M
FIR filter is usually employed to process thedigital signal, e.g. sound and digital image, to find aclear message without any disruptions. Puspasari etal. implemented FIR filter for pedestrians' locationmonitoring system captured by Global PositioningSystem (GPS). When an unstable GPS received thesignal, FIR filter would remove the noises whichmay occur, such as multipath effect. Beforeapplying FIR filter, the coordinate points of thepedestrian are scattered because of the noise. But,after being processed by FIR, only one coordinatepoint was obtained from these distributed data [8].
FIR also can be utilized for digital signalprocessing in Field Programmable Arrays (FPGA)equipment. FPGA has an ability to handle heavyloads of works in parallel mode. FIRimplementation in FPGA can generate an outputwhich suitable for the specification of 20 KHzcutoff frequency. For sinusoidal input withinfrequency range 20-22000Hz, FIR filter willsuppress the signal above 20,000Hz [9].
3.2 Windowing MethodIn EEG data processing, we should consider the
impulse response of the data. Finite impulseresponse may generate an excessive ripple in thepass-band and create low stop-band attenuation.Windowing techniques could overcome thisproblem during a filtering process. Given a windowfunction (w[n]) and an impulse response of theideal filter (hd[n]), then the impulse response of theactual filter can be expressed in Equation 3.
][*][][ nwnhnh d (3)
Journal of Theoretical and Applied Information Technology30th June 2016. Vol.88. No.3
© 2005 - 2016 JATIT & LLS. All rights reserved.
ISSN: 1992-8645 www.jatit.org E-ISSN: 1817-3195
560
Windowing methods employed with FIR filterto mitigate disruptions during filtration process areRectangular, Hamming, Hann and BlackmanWindow.
1. Rectangular WindowResearchers rarely employed the rectangular
window due to its low stop-band attenuation result.The first lobe of this window has an attenuation of13dB and the narrowest transition region among allwindow methods. Hence, a filter designed usingthis window should have minimum stop-bandattenuation of 21 dB. Coefficient of RectangularWindow is defined as follows:
otherMn
nw,0
10,1)( (4)
2. Hamming WindowHamming window is one of the most popular
windowing methods. A filter designed with theHamming window has minimum stop-bandattenuation of 53dB, which is sufficient for mostimplementations of digital filters. Unlike minimumstop-band attenuation, transition region can bechanged by altering the filter order. The transitionarea will become narrow and minimum stop-bandattenuation remains unchanged as the filter orderincreases. Coefficient of Hamming Window isdefined as follows:
other
MnM
nnw
,0
10,1
2cos46.054.0)(
(5)
3. Hann WindowResearchers usually use Hann window to lessen
ill effects on frequency characteristic produced bythe final samples of a signal. The first side of a lobein the frequency domain of this window has 31dBof attenuation value, whereas it amounts up to 44dBin the designed filter. The advantage of this windowis its ability to increase the stop-band attenuation ofthe posterior lobes swiftly. Coefficient of HannWindow is defined as follows:
other
MnM
nnw
,0
10,1
2cos15.0)(
(6)
4. Blackman WindowBlackman window is considered as the most
popular window technique for data signal filtering.
Relatively high attenuation value makes thiswindow is very convenient for almost allapplications. The first side of a lobe in thefrequency domain of this filter has 51dB ofattenuation value, and the designed filter has stop-band attenuation up to 75dB. Coefficient ofBlackman Window is defined as follows:
other
MnM
nM
n
nw
,0
10,1
4cos08.0
12cos5.042.0
)(
(7)
3.3 Characteristics of a Good FilterA transition bandwidth, stop-band attenuation,
and cutoff frequency determine the quality of agood filter. Figure 1 illustrates the magnituderesponse for these parameters in the domainspectrum.
Figure 1: Magnitude response in domain frequency [11]
1. Transition BandwidthTransition band is an area that lies between
stopband and passband. Narrow transition bandslead to a steep filter roll-off and wide transitionbands allow a shallow roll-off. Filter roll-off is afunction of filter order (number of filtercoefficients/filter length minus one), moreaccurately the effective impulse response duration.Filters with a steep roll-off can better separatesignal and noise components in adjacent frequencybands than filters with a shallow roll-off. But, itmakes the filter has a longer impulse response thanfilters with a wide transition bands or shallow roll-off. Sharper and more extended filters produce
Journal of Theoretical and Applied Information Technology30th June 2016. Vol.88. No.3
© 2005 - 2016 JATIT & LLS. All rights reserved.
ISSN: 1992-8645 www.jatit.org E-ISSN: 1817-3195
561
stronger signal distortions and broader temporalsmearing of distortions and ringing artifacts [10].Therefore, to reduce or attenuate signal distortion, itis more advisable to choose a filter that has a broadtransition band.
2. Stop-band AttenuationStopband attenuation is the highest gain value
(in dB) in stopband area. Theoretically, smaller ormore negative stopband attenuation may generate abetter filtering result because the unwantedfrequencies can be eliminated or attenuated [11].Equation 8 express stopband attenuation:
1
210 1
log20
sA (8)
where As is stopband attenuation, δ1 is passbandripple tolerance and δ2 is stopband attenuationtolerance.
3. Cutoff FrequencyThe cutoff frequency is the midpoint of
transition bandwidth. The cutoff frequency of lessthan 0.1 Hz should be avoided because it maygenerate a very long filter length. Therefore, theselection of cutoff frequency determines how fastthe filtered signal centered at zero value followingthe signal deflection. Higher cutoff frequency, thenfaster the signal centered at zero value because ofthe low-frequency attenuation [10].
4. RESULTS AND DISCUSSIONS
4.1 Data CollectionEEG data of three respondents with the age
range between 19-21 years old are recorded usingEmotiv EPOC device. Emotiv EPOC headset has14 EEG channels and two references that offering aposition for accurate spatial resolution. This deviceoperates with 14 bits resolution or 16* per channelwith a frequency response between 0.16 – 43 Hz.Each of participants is given an instruction to watcha video with duration about 3-5 minutes long. Thepurpose of the given instruction is to assess theEEG data that represent the emotion state ofparticipants during/after watching the video.
EEG data recorded using Emotiv EPOC consistsof 36 columns with 14 columns are EEG channels.Those channels are AF3, F7, F3, FC5, T7, P7, O1,O2, P8, T8, FC6, F4, F8, and AF4. These channelsrepresent electrical activities of the brain. The restof EPOC columns give information about status ormounting accuracy indicator of electrodes on thescalp. Here, instead of using all the channel data,
we focus only on F3 and F4 channel which locatedon the frontal lobe. These two channels are themost influential in determining emotional changesoccur in human brain [12].
4.2 Filter DesignIn this research, we utilized EEGLAB to do
filtering process. Figure 2 depicts the architecturedesign of this research approach. There are twoprimary processes: data preparation and filteringprocess.
In the data preparation, EDF file of EEG datacaptured by Emotiv EPOC is loaded to EEGLAB.We selected only two channels: F3 and F4, becausethese channels responsible for regulating humanemotions. And for the sampling rate, we assigned128 Hz/s value as the default setting from EPOCheadset.
The filtering process is the essential task in ourresearch architecture. There are three steps involvedin filtering process: (1) digital filter set up (2)filtering execution and (3) quality parameterscomputation. The first step, we need to decide thetype and the specification of the digital filter. Wechoose band-pass filter following the characteristicsof the data signal. According to the literature study,the band-pass filter is the most recommended filtertype to eliminate noise in EEG data. In this step, wealso need to specify the frequency band, the filterlength, and the windowing method to mitigate noisewith FIR filter. The second phase, the alreadyprepared EEG data is filtered using the designeddigital filter. The last step, we calculate threeparameters to determine the best windowingmethod in mitigating noise in EEG data signal.Table 2 shows the parameter configuration in thefiltering process.
Table 2: Parameters Configuration
Parameter ValueEEG channels F3, F4Sampling rate 128 Hz/s
Frequency band 0.16 HzFilter length 2481, 2641, 4401, 8801,
17601Windowing method Rectangular, Hamming,
Hann, Blackman
4.3 ExperimentsThe aim of this research is to find the best
windowing method for eliminating noises of EEGsignal using FIR filter. We conducted fiveexperiments with a different filter length of each, asdepicted in Table 2. Each experiment follows thesame scenario as below:
Journal of Theoretical and Applied Information Technology30th June 2016. Vol.88. No.3
© 2005 - 2016 JATIT & LLS. All rights reserved.
ISSN: 1992-8645 www.jatit.org E-ISSN: 1817-3195
562
a. Choose a windowing method(Rectangular, Hamming, Hann, andBlackman method).
b. Repeat five procedures for eachwindowing method with a different filterlength (2481, 2641, 4401, 8801, and17601).
c. Calculate the stop-band attenuation, thetransition bandwidth and the cutofffrequency for each method.
Figure 2: Design Architecture
Figure 3, 4, 5 and 6 shows the filtering result ofEEG signal using Rectangular, Hamming, Hann,and Blackman window, in the domain frequency.We examine ripples appearance in either pass-bandor stop-band attenuation. Ripples appearancedetermine the quality of windowing method in termof transition bandwidth, stop-band attenuation, andcutoff frequency. These parameters can be used todecide which windowing method gives the bestfiltering result.
Based on those figures, the rectangular windowcreates a high number of ripples either on pass-band or stop-band. At a glance, we can deduce thatRectangular window will give the worst result inEEG signal filtering. Otherwise, the Blackmanwindow may give the best result because it has asmall number of ripples and narrow transition
bandwidth. Discussion section will explore moreabout the filtering result analysis.
4.4 DiscussionBased on the characteristics of a good filter,
we compare the value of stop-band attenuation,transition bandwidth, and the cutoff frequency ofthe filtering results using four windowing methods.Figure 7, 8, and 9 illustrate the average yield ofEEG data obtained from three participants.
Figure 7 compares the stop-band attenuationvalue of Rectangular, Hamming, Hann, andBlackman window method. In three experimentswith a different filter length for each, Hann windowgenerates the most negative stop-band attenuationvalue when the filter length value is 2641, 4401,and 8801. The smaller stop-band attenuation value,then the more unwanted frequencies can beeliminated. Hence, it can generate a better filteringresult.
Figure 8 illustrates the comparison of thetransition bandwidth characteristic for eachwindowing method. As mentioned in section 3.4, itis advisable to have a wide transition bandwidth toget an ideal filter with little as possible distortions.From this figure, we can see that Blackman windowhas the largest transition bandwidth in allexperiments. Hence, we can conclude thatBlackman window is the best method forattenuating noise and distortions compare to theothers windowing methods.
Figure 9 shows the cutoff frequency results offive filter lengths’ experiment over threeparticipants EEG data. Higher cutoff frequencyvalue, then faster the signal centered at zerobecause of the low-frequency attenuation. Analysisresults indicate that Blackman window methodgives the constant highest cutoff frequency valuefor all tests. Hence, the digital filter whichemployed with Blackman window will enormouslymake EEG signals to be centered on zero value.
Table 3: Windowing Method Comparison
Criteria Windowing method1st 2nd
Stop-band attenuation Hann BlackmanTransition bandwidth Blackman Hann
Cutoff frequency Blackman Hann
Table 3 summarizes the comparison betweenRectangular, Hamming, Hann, and Blackmanwindow based on three criteria: stop-bandattenuation, transition bandwidth, and cutofffrequency. From all experiments, the Blackmanwindow excels in term of transition bandwidth and
Journal of Theoretical and Applied Information Technology30th June 2016. Vol.88. No.3
© 2005 - 2016 JATIT & LLS. All rights reserved.
ISSN: 1992-8645 www.jatit.org E-ISSN: 1817-3195
563
cutoff frequency. And it also comes second tohaving the most negative stop-band attenuation.Therefore, we can conclude that the bestwindowing method which provided the mostoptimal result in EEG data filtering is BlackmanWindow.
5. CONCLUSIONS AND FUTURE WORKS
5.1 Conclusion DiscussionFIR digital filter was employed to process EEG
data signal which recorded using Emotiv EPOCdevice. Poles absence characteristics made FIRfilter more stable in processing data signal. A band-pass filter is recommended to process signal data inelectrophysiology, e.g. EEG data. FIR filter needsto employ windowing techniques to repair theimpulse responses resulted from filtering process.Four windowing methods can be utilized to processdata filtering; Rectangular, Hamming, Hann, andBlackman window method.
Experiments were conducted to find the bestwindowing method that provides the optimalfiltering results. The results show that Blackmanwindow gives the most optimal outcome in EEGdata filtering based on stop-band attenuation,transition bandwidth, and cutoff frequencymeasurements. Blackman window provides thesecond most negative value of stop-bandattenuation, the widest transition bandwidth, andthe highest cutoff frequency. Hence, we concludethat to better process EEG data with 14 electrodes,it is advisable to employ FIR filter equipped withBlackman window technique to eliminate noise anddistortions during the filtering process.
5.2 Future WorksIn the future, windowing techniques comparison
can be further developed to find the optimal valueof transition bandwidth in EEG data filtration.Great design of filtering method can generate anoptimal output of data signal filtering. Thus, it cancontribute to process the next steps in EEG dataprocessing, such as to extract and classify dataefficiently and also to simply gather the meaningfulinformation in EEG data.
ACKNOWLEDGEMENT
This research was funded by PEKERTI grantfrom Directorate General of Higher Education(DIKTI) of Indonesian Ministry of Education andCulture number 105/K3/KM/2015.
REFRENCES:[1] Kemalasari, M. H. P, R. W, and N. S, “Pengolahan
sinyal elektroensephalogram (EEG) sistimpeletakan 8 elektrode dengan metode wavelet,”Proceeding of Industrial Electronic, Surabaya,2003.
[2] Repovš G., “Dealing with noise in EEG recordingand data analysis,” Informatica Medica Slovenica,vol. 15, no. 1, pp. 18-25, 2010.
[3] Murugappan M., Ramachandran N., and Sazali Y.,“Classification of human emotion from EEG usingdiscrete wavelet transform,” J. Biomed. Sci. Eng.,vol. 03, no. 04, pp. 390–396, 2010.
[4] Cohen M. X., “Analyzing neural time series data:theory and practice,” Illustrate. MIT Press, p. 600,2014.
[5] Guerrero-mosquera C. and Vazquez A. N.,“Automatic removal of ocular artifacts from eegdata using adaptive filtering and independentcomponent analysis,” 17th Eur. Signal Process.Conf. (EUSIPCO 2009), no. Eusipco, pp. 2317–2321, 2009.
[6] Miyazaki R., Ohshiro M., Nishimura T., andTsubai M., “A novel neural network with Non-Recursive IIR Filters on EEG ArtifactsElimination,” Eng. Med. Biol. Soc. 2005, pp.2048–2051, 2005.
[7] Sakato M., “Alat pengukur gelombang otak,”2014. [Online]. Available:http://sentramedis.com/?sentra-medis=newsdetail&id=292. [Accessed: 17-Jan-2015].
[8] Puspasari B. D., Setiawan I., and Darjat,“Penerapan low pass filter dan finite impulseresponse menggunakan GPS,” Transient, vol. 2,no. 3, 2013.
[9] Putra R. J., Rif’an M., and Setyawan R. A.,“Implementasi filter digital FIR (Finite ImpulseResponse) pada Field Programmable Gate Arrays(FPGA),” Jurnal Mahasiswa TEUB, vol.1, no. 4,2013.
[10] Widmann A., Schröger E., and Maess B.,“Digital filter design for electrophysiological data– a practical a p- proach,” J. Neurosci. Methods,pp. 1–16, 2014.
[11] Mooniarsih N. T., “Desain dan simulasi filterFIR menggunakan metode windowing,” J.ELKHA, vol. 2, no. 1, pp. 41–47, 2010.
[12] Othman M., Wahab A., Karim I., Dzulkifli M.A., and I. F. T. Alshaikli, “EEG emotionrecognition based on the dimensional models ofemotions,” Procedia - Soc. Behav. Sci., vol. 97,pp. 30–37, Nov. 2013.
Journal of Theoretical and Applied Information Technology30th June 2016. Vol.88. No.3
© 2005 - 2016 JATIT & LLS. All rights reserved.
ISSN: 1992-8645 www.jatit.org E-ISSN: 1817-3195
564
Figure 3: Bandpass Filter Result For Rectangular Window
Figure 4: Bandpass Filter Result For Hamming Window
Journal of Theoretical and Applied Information Technology30th June 2016. Vol.88. No.3
© 2005 - 2016 JATIT & LLS. All rights reserved.
ISSN: 1992-8645 www.jatit.org E-ISSN: 1817-3195
565
Figure 5: Bandpass Filter Result For Hann Window
Figure 6: Bandpass Filter Result For Blackman Window
Journal of Theoretical and Applied Information Technology30th June 2016. Vol.88. No.3
© 2005 - 2016 JATIT & LLS. All rights reserved.
ISSN: 1992-8645 www.jatit.org E-ISSN: 1817-3195
566
Figure 7: Comparison Of Stopbaand Attenuation
Figure 8: Comparison Of Transition Bandwith
Journal of Theoretical and Applied Information Technology30th June 2016. Vol.88. No.3
© 2005 - 2016 JATIT & LLS. All rights reserved.
ISSN: 1992-8645 www.jatit.org E-ISSN: 1817-3195
567
Figure 9: Comparison Of Cutoff Frequency