Journal of Artificial Intelligence and Metaheuristics cover
Journal of Artificial Intelligence and Metaheuristics

Online ISSN 2833-5597

Full Length Article

Volume 1 • Issue 1 • PP: 08-19 • 2022

Removing Powerline Interference from EEG Signal using Optimized FIR Filters

Mohamed Saber 1*
1Electronics and Communications Engineering Dep., Faculty of Engineering, Delta University for Science and Technology, Gamasa City, Mansoura, Egypt
* Corresponding Author.
verified

Open Access & Copyright

© 2022 The Author(s). Published by ASPG. This article is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).

Abstract

The Electroencephalography (EEG) is a signal representing the electrical activity of the brain and is used in the diagnosis of brain diseases. The EEG signal is weak and highly prone to noise from the powerline which generates a sinusoidal signal with the main frequency of 50/60 Hz. Therefore, three harmonics of powerline noise must be removed using notch filters for a perfect diagnosis which requires three series notch filters. This paper presents a new method to design a digital notch finite impulse response (FIR) filter using a modified particle swarm optimization technique. The proposed method provides a short length, maximum stopband attenuation, and small transition width compared to different algorithms which results in removing the noise in EEG signal efficiently.

Full Text

This HTML version is generated from the article PDF. The PDF remains the version of record.

1. Introduction

Digital signal processing is critical for several applications ,including seizure detection / prediction, sleep state classification, and categorization of motor imagery. As shown in Fig.1, digital EEG signal processing consists of three components: a signal collection unit, a feature extraction unit, and a decision algorithm. The EEG signal collected from the scalp, brain surface, or brain interior is used as the system’s input. Electrodes, whether invasive or non-invasive, are used to represent the signal acquisition unit. The feature extraction unit is a signal processing device responsible for extracting distinguishing characteristics from a channel(s). For example, in a brain computer interface (BCI), the decision unit is a hybrid unit that performs categorization, decisionmaking,andidecision-passingtoexternaldevicesthatoutputthesubject’sintention[1].

Figure 1. Processing of EEG Signal
Figure 1. Processing of EEG Signal

The brain regions are shown in Fig.2. Most of the relevant information about the functioning condition of the human brain is contained in five main brain waves, each with its own distinct frequency band. Delta band within (0–4iHz), I the a band within (3.5 –7.5Hz), alpha band within (7.5–13Hz), beta band within (13–26 Hz), and gamma band within (26-70Hz) are these frequency bands [2]. Delta waves are associated with profound slumber. The ta waves are associated with the most meditative state (body asleep/mind awake). Alpha waves are associated with dreams and relaxation. Beta waves are the most prevalent during the waking state of intense concentration. Gamma waves are intimately connected with the brain’s decision-making process. When dealing with mental disease situations, unanticipated changes in brain waves occur, necessitating a significant amount of signal processing to diagnose aberrant conditions [3-4].

Figure 3. EEG signal affected by powerline noise
Figure 3. EEG signal affected by powerline noise
Figure 2. Human brain and various lobes [4]
Figure 2. Human brain and various lobes [4]

Digital filters have two FIR and infinite impulse response (IIR). FIR filter has a symmetrical tap of length (N), provides a linear phase, simple in design, stable, and is suitable in phase-sensitive applications [5]. There are different methods to design digital filters such as window methods (most popular), frequency sampling, Parks-McClellan Equi-ripple method. In the window method , the ideal response of the filter is multiplied by a different window waveform such as rectangle, hanning, hamming, Kaiser according to design requirement (ripples in pass band and stop band). The drawback of the window method is that it cannot control the errors in different bands. In the frequency sampling method although it can be used for any kind of frequency response there is no equation to calculate the order of the filter. Parks McClellan (PM) method is most popular method to design digital filters based on Remez Exchange algorithm, provides an optimum approximation to the desired frequency response. PM method has the main drawback which is the relation between ripples in passband and stopband is fixed. [6]. Using optimization techniques in the design of digital filters introduces the idea of parameter control and also provides a better approximation to the ideal filter. Different optimization algorithms such as artificial bee colony, Tabu search, simulated annealing, genetic algorithm, and particle swarm are used to design FIR filters [7].

Simulated annealing (SA) algorithm used to design linear phase digital filter, Nyquist filter, and cascade from FIR filter. The drawbacks of this algorithm are the long computation time which increased as the order of the filter increase and causing the failure to find the optimum solution [8]. Another algorithm called tabu search used a flexible realization of the filter taps to design a digital filter that provides high accuracy [9]. A method based on an artificial bee colony algorithm to design IIR filter is presented in [10]. Particle swarm optimization (PSO) is an optimization technique used in a multidimensional nonlinear environment. PSO provides simplicity and convergence in designing a digital filter [11]. The drawback of the conventional PSO method in filter design problems is that the initial solutionsiareiusuallyifarifromitheiglobalioptimumiandihenceitheilargeriinertiaiweightiwimayibei provedito be beneficial. This paper presents a modified traditional PSO for designing a linear phase notch filter to remove power noise which is built using FIR LPF. The proposed notch filter removes three harmonics of power noise which requires three series notch filters.

3. Proposed Model

To remove the three harmonics of line power noise, a three-series notch (band stop) filter is needed at 60iHz, 120iHz, and 180iHzirespectively as shown in Figure 4.

Figure 4. Power line noise remover
Figure 4. Power line noise remover

The notch filter can be built using the following steps: Design a first FIR LPF with a cut-off frequency . Design a second FIR LPF with a cut-off frequency . Convert the second FIR LPF to a FIR HPF with a cut-off frequency using the following formula ( ) (1) Where n: is the length of the filter The magnitude of the frequency response of LPF, HPF, and a notch filter at a frequency of 60 Hz is shown in Figure 5.

Figure 5. Magnitude response of notch filter The transfer function of the FIR digital filter can be described using
Figure 5. Magnitude response of notch filter The transfer function of the FIR digital filter can be described using
( ) ∑ ( )

Where N is the order of the filter. And the frequency response of the FIR digital filter is given by

(   ) ∑ ( )

Where is the digital frequency

Asymmetrical low pass FIR describes as

( ) ( ) where N is the order of the filter, and (N/2+1) are filter coefficients While the main objective of the FIR filter design is to compute the filter coefficient using an optimization algorithm that leads to the optimum filter design. The optimum filter is reached when a maximum weighted error function is minimized [12-13]. In the PM method, the error function is

( )  ( )[  (   )   (   )] (4)

Where ( ) is the frequency response of the desired filter ( ) is the frequency response of the ideal filter. ( ) is the weighting function, that is used to provide the approximation error differently in different frequency bands. For an ideal LPF, ( ) is:

(   ) {

where is the cutoff frequency. The error fitness function using PM is defined as:

(| ( )|   ) (| ( )|   ) (6)

where and are the ripples in the pass band and stop band, respectively. and are pass band and stop band normalized cut-off frequencies, respectively. A novel error fitness function to achieve higher stop band attenuation and to reduce transition width, to be minimized is described as:

∑   [   (|  ( )|  )   ] ∑[   (|  ( )|   )] (7)

Where passband and a portion of transition band in the first term. While stopband and rest of transition band in the second term.

A. Traditional particle swarm optimization (PSO)

PSO is an optimization technique, which can easily handle non different objective functions. Compared to conventional optimization techniques, PSO is less disposed to trapped on local optima. The PSO idea is similar to the behaviour of a swarm of birds. PSO is developed through the simulation of a group of birds in multi-dimensional space, which optimizes an objective function [14]. Each particle vector or bird recognizes its best value ( ). Also, each particle vector recognizes the best value in the group ( ) among ( ). Each particle tries to change its location using the following information: • The distance between the current location and the . • The distance between the current location and the . In filter design, each particle vector consists of components as the required number of normalized filter coefficients, depending on the order of the filter to be designed. The velocities of the particle vectors are changed according to :

(   ) ( ) ( )

The searching point in the solution space may be updated by

(   ) (   ) (9)

Where

: is the vector velocity of particle vector at iteration W: is the weighting function and : are the positive weighting factors and : are random numbers between 0 and 1

: is the current position of particle vector h(n) at iteration

: is the personal best of the particle at the iteration : is the group best of the group at the iteration The first term in Eqn. (6) represents the previous velocity of the particle vector. While the second and third terms are used to change the velocity of the particle vector. Removing the second and third terms, the particle vector (bird) will continue to fly in the same direction until it reaches the boundary. It is considered as a kind of inertia represented by the inertia constant w and tries to explore new areas. Conventional PSO used for the generation of optimal coefficients of the filter design problem has a drawback is that the initial solutions are usually far from the global optimum and hence the large inertia weight ( ) may be used. In other words, the convolutional PSO has an oscillatory problem and is easy to be trapped in local optima for a promising area where the global optimum resides is not identified at the end of the optimization process.

B. Proposed Modified Particle Swarm

The modified PSO aims to improve the possibility of exploring the search space where the global optimal solution exists. The idea of the proposed method depends on the inertia weight (w) which has a significant effect in balancing the global and local exploration abilities. The value of ( ) for all particles will decrease at the same time as the iteration number increases and is calculated using the following expression,

(10)

(      )

where, and are the initial and final weight, respectively. The proposed weighting function is defined as follows:

(11)

(      )
{    (      )

where q=1, 2, … ; i=1, 2,…N.

(12) is the element inertia weight i of particle q in iteration m. Instead of maximum iteration count in Eqn. (10), another parameter (S) is designed to further provide a well-balanced mechanism between global and local exploration abilities. It is obvious that the value of (S) is an important factor to control the linearly decreasing dynamic parameter framework descending from . A suitable selection of (S) provides a balance between global and local explorations, thus requiring fewer iterations on average to find a sufficiently optimal solution. From Eqn. (12), if employed will be linearly decreasing to prevent the particles from flying past the target position during the flight. Otherwise, the value of will be kept without decreasing to facilitate a free movement of particles in the search space. The main aspect of the proposed inertia weight mechanism is to monitor the weights of a particle, which were linearly decreased in general applications, to avoid storing too many similar particles at the end of the optimization process. The significance of control of inertia weight w in the PSO algorithm is also retained to increase the possibility of occurrence of escaping from local optimal solutions. The velocity of the particle vector is updated according to the following formula

(   ) ( )         (

updating the position of the particles done using

(   ) (   ) (14)

The flowchart of proposed modified PSO for linear phase FIR LPF design is shown in Figure 6: In this paper, the end condition of modified PSO is either the convergence of minimum error fitness values is meteor the maximum number of iterations is reached.

) (13)

) move in the same direction, the value of

Figure 6. flow chart of proposed modified PSO
Figure 6. flow chart of proposed modified PSO

4. Simulation Results

This section presents the simulation results for the FIR LPF. The filter order (N) is 21. The sampling frequency ( ) is 1Hz. The number of frequency samples is 512. Both algorithms (PSO, and modified PSO) are run 50 times to obtain the best results. Table 1 shows the simulation parameters for PSO, and modified PSO, respectively.

Table 1. Parameters used in PSO and modified PSO
Table 1. Parameters used in PSO and modified PSO

The magnitude response of the proposed modified particle swarm optimizer (MPSO) compared to traditional particle swarm (PSO), Parks-McClellan (PM) method, Real Coded Genetic Algorithm (RGA) in figure 7.

Figure 7. Comparison of Magnitude response between the proposed method and other methods
Figure 7. Comparison of Magnitude response between the proposed method and other methods

As shown in figure 7, the proposed method provides minimum ripples in the stopband and short transition band. The amplitude of ripples in the stopband is shown in figure.8.

Figure 8. Amplitude of ripples in the stopband
Figure 8. Amplitude of ripples in the stopband

Table 2 shows the comparative results in terms of, transition width (normalized), execution time, and stopband attenuation. For LPF using PM, RGA, PSO, and the proposed modified PSO, respectively. It is noticed that MPSO results in a narrower transition width, and a higher stop band attenuation between all algorithms.

Table 2. Comparative results of all algorithms for the FIR LP filter of order 21
Table 2. Comparative results of all algorithms for the FIR LP filter of order 21

Table 3 presents a comparison between modified PSO and other similar works. MPSO provides 31.09 dB stop band attenuation, maximum passband ripple (normalized) = 0.118, maximum stop band ripple 0.0279, transition width = 0.0903. It is observed from Table 3 that the simulation results of MPSO are much better than the other related works.

Table 3. Comparison between the modified PSO and other related works
Table 3. Comparison between the modified PSO and other related works

Figure 9 shows the results at each stage of removing power line noise from EEG signal. Figure 9. a, shows the initial corrupted EEG data, which includes 60Hz interference and its 120 and 180 Hz harmonics. Figure 9.b shows that the 60Hz interference and its harmonics have been removed.

Figure 9. (a)Initial corrupted EEG data; (b) ECG after removing power line noise interference
Figure 9. (a)Initial corrupted EEG data; (b) ECG after removing power line noise interference

Figure 10 shows the power spectral density of the initial EEG signal corrupted with the power line noise at 60 Hz, 120 Hz, and 180 Hz. While Figure 11 shows the power spectral density of the final EEG signal after removing the powerline noise [21-33].

Figure 10. Power Spectral density of initial EEG signal
Figure 10. Power Spectral density of initial EEG signal
Figure 11. Power Spectral density of final EEG signal
Figure 11. Power Spectral density of final EEG signal

5. Conclusion

This paper presents a proposed notch filter based on a modified particle swarm optimizer (MPSO). The notch filter is used to remove the power line noise in EEG signal; which leads to errors in brain disorders automatic diagnosis. The proposed modified PSO archives the results of the traditional PSO algorithm with less number of iterations. The proposed FIR filter provides 31.09 dB stop band attenuation, 0.188 maximum passband ripple (normalized), 0.0279 maximum stopband ripples, and 0.0903 transition width with 21 filter lengths. All the simulation results compared to the different optimization methods and related works indicate that the proposed optimizer provides a narrower transition width and a higher stop band attenuation between all algorithms.

Funding: “This research received no external funding”

Conflicts of Interest: “The authors declare no conflict of interest.”

References

[1] William O. Tatum, (Demos Medical) (2021). Handbook of EEG Interpretation.

[2] Neville M. Jadeja, (Cambridge UNIVERSITY Press) (2021). How to Read an EEG.

[3] Michalis K. , (John Libbey Eurotext) (2021). The role of EEG in the diagnosis and classification

of the epilepsies and the epilepsy syndromes: A tool for clinical practice.

[4] M. M. Eid, F. Alassery, A. Ibrahim and M. Saber, Metaheuristic optimization algorithm for

signals classification of electroencephalography channels. Computers, Materials &

Continua,71(3), 4627–4641, 2022.

[5] Proakis, J.G. , & Manolakis, (Pearson Education) (2007). Digital signal Processing Principles,

Algorithms, and Applications.

[6] Li tan, J. Hiang, (Academic Press) (2013). Digital Signal processing fundamentals and

applications.

[7] N. Singh, A. Potnis. A review of different optimization algorithms for a linear phase FIR filters,

International Conference on recent Innovations in Signal Processing and embedded Systems

(RISE), 44-48, 2017.

[8] Wu, Chen, et al., Spare FIR Design Based on Simulated Annealing Algorithm, 15(1), 2015.

[9] K. Watcharasitthiwat, J. koseeyaporn, P. Wardkein, Designing Digital Filters Using Multiple

Tabu Search Algorithm , International Conference on Communications, Circuits and Systems,

171-175, 2006.

[10] A. Kumar, S. Ghosh, N. Londhe, Modified artificial bee colony optimization-based FIR filter design

with experimental validation using field-programmable gate array, IET Signal Processing, 10 (8), 955-

964, 2016.

[11] Adel Jalal Yousif, Ghazwan Jabbar Ahmed and Ali Subhi Abbood, Design of Linear Phase High Pass

FIR Filter using Weight Improved Particle Swarm Optimization, International Journal of Advanced

Computer Science and Applications, 9(9), 2018.

[12] N. Karaboga and B. Cetinkaya, “Design of digital FIR filters using differential evolution

algorithm,” Circuits, Systems, and Signal Processing, 25 (5), 649–660, 2006.

[13] G. Liu, Y. X. Li, and G. He, “Design of digital FIR filters using differential evolution algorithm based

on reserved gene,” in Proceedings of the IEEE Congress on Evolutionary Computation, 1–7, 2010.

[14] J. Kennedy and R. Eberhart, Particle swarm optimization, Proceedings of the IEEE International

Conference on Neural Networks, 4, 1942-1948, 1995.

[15] D. Karaboga, D.H. Horrocks, N. Karaboga, A. Kalinli, Designing digital FIR filters using Tabu search

algorithm, IEEE International Symposium on Circuits and Systems, 4, 2236-2239, 1997.

[16] G. Liu, Y.X. Li, and G.He, Design of Digital FIR Filters Using Differential Evolution Algorithm Based

on Reserved Gene, IEEE Congress on Evolutionary Computation,1-7, 2010.

[17] M. Najjarzadeh, A.Ayatollahi, FIR Digital Filters Design: Particle Swarm Optimization Utilizing LMS

and Minimax Strategies, International symp. on Signal Processing and Information Technology,

ISSPIT, 129-132, 2008.

[18] J.I. Ababneh, M. H. Bataineh, Linear phase FIR filter design using particle swarm optimization and

genetic algorithms, Digital Signal Processing, 18, 657–668, 2008.

[19] A. Sarangi, R.K. Mahapatra, S.P. Panigrahi, DEPSO and PSO-QI in digital filter design, Expert

Systems with Applications, 2011, vol. 38, No.9, pp.10966-10973.

[20] B. Luitel, G. K. Venayagamoorthy, Differential Evolution Particle Swarm Optimization for Digital

Filter Design, IEEE Congress on Evolutionary Computation, 3954- 3961, 2008.

[21] El-Sayed M. El-Kenawy, Seyedali Mirjalili, Fawaz Alassery, Yu-Dong Zhang, Marwa Metwally Eid,

Shady Y. El-Mashad, Bandar Abdullah Aloyaydi, Abdelhameed Ibrahim, and Abdelaziz A.

Abdelhamid.

Novel Meta-Heuristic Algorithm for Feature Selection, Unconstrained Functions and Engineering Prob

lems. IEEE Access, 10:40536–40555, 2022.

[22] Abdelaziz A. Abdelhamid, El-Sayed M. El-Kenawy, Bandar Alotaibi, Ghada M. Amer, Mahmoud Y.

Abdelkader, Abdelhameed Ibrahim, and Marwa Metwally Eid. Robust Speech Emotion Recognition

Using CNN+LSTM Based on Stochastic Fractal Search Optimization Algorithm. IEEE Access,

10:49265–49284, 2022.

[23] Doaa Sami Khafaga, Amel Ali Alhussan, El-Sayed M. El-kenawy, Ali E. Takieldeen, Tarek M. Hassan,

Ehab A. Hegazy, Elsayed Abdel Fattah Eid, Abdelhameed Ibrahim, and Abdelaziz A. Abdelhamid.

Meta-heuristics for Feature Selection and Classification in Diagnostic Breast-Cancer. Computers,

Materials & Continua, 73(1):749–765, 2022.

[24] Doaa Sami Khafaga, Amel Ali Alhussan, El-Sayed M. El-kenawy, Abdelhameed Ibrahim, Said H. Abd

Elkhalik, Shady Y. El-Mashad, and Abdelaziz A. Abdelhamid. Improved Prediction of Metamaterial

Antenna Bandwidth Using Adaptive Optimization of LSTM. Computers, Materials & Continua,

73(1):865–881, 2022.

[25] Nagwan Abdel Samee, El-Sayed M. El-Kenawy, Ghada Atteia, Mona M. Jamjoom, Abdelhameed

Ibrahim, Abdelaziz A. Abdelhamid, Noha E. El-Attar, Tarek Gaber, Adam Slowik, and Mahmoud Y.

Shams. Metaheuristic Optimization Through Deep Learning Classification of COVID-19 in Chest XRay

Images. Computers, Materials & Continua, 73(2):4193–4210, 2022.

[26] Hussah Nasser AlEisa, El-Sayed M. El-kenawy, Amel Ali Alhussan, Mohamed Saber, Abdelaziz A.

Abdelhamid, and Doaa Sami Khafaga. Transfer Learning for Chest X-rays Diagnosis Using Dipper

Throated Algorithm. Computers, Materials & Continua, 73(2):2371–2387, 2022.

[27] Doaa Sami Khafaga, Amel Ali Alhussan, El-Sayed M. El-Kenawy, Abdelhameed Ibrahim, Marwa

Metwally Eid, and Abdelaziz A. Abdelhamid. Solving optimization problems of metamaterial and

doublet-shape antennas using advanced meta-heuristics algorithms. IEEE Access, 10:74449–74471,

2022.

[28] Hala Hassan, Ali Ibrahim El-Desouky, Abdelhameed Ibrahim, El-Sayed M. El-Kenawy, and Reham

Arnous. Enhanced QoS-Based Model for Trust Assessment in Cloud Computing Environment. IEEE

Access, 8:43752–43763, 2020.

[29] Marwa M. Eid, El-Sayed M. El-kenawy, and Abdelhameed Ibrahim. A binary Sine Cosine-Modified

Whale Optimization Algorithm for Feature Selection. In 2021 National Computing Colleges

Conference (NCCC), pages 1–6, Taif, Saudi Arabia, March 2021. IEEE.

[30] El-Sayed M. El-Kenawy, Seyedali Mirjalili, Sherif S. M. Ghoneim, Marwa Metwally Eid, M. El-Said,

Zeeshan Shafi Khan, and Abdelhameed Ibrahim. Advanced Ensemble Model for Solar Radiation

Forecasting Using Sine Cosine Algorithm and Newton’s Laws. IEEE Access, 9:115750–115765, 2021.

[31] Abdullah Ali Salamai, El-Sayed M. El-kenawy, and Ibrahim Abdelhameed. Dynamic Voting Classifier

for Risk Identification in Supply Chain 4.0. Computers, Materials & Continua, 69(3):3749–3766, 2021.

[32] Abdelhameed Ibrahim, Seyedali Mirjalili, M. El-Said, Sherif S. M. Ghoneim, Mosleh M. Al-Harthi,

Tarek F. Ibrahim, and El-Sayed M. El-Kenawy. Wind Speed Ensemble Forecasting Based on Deep

Learning Using Adaptive Dynamic Optimization Algorithm. IEEE Access, 9:125787–125804, 2021.

[33] El-Sayed M. El-kenawy, Hattan F. Abutarboush, Ali Wagdy Mohamed, and Abdelhameed Ibrahim.

Advance Artificial Intelligence Technique for Designing Double T-Shaped Monopole Antenna.

Computers, Materials & Continua, 69(3):2983–2995, 2021.

Continue Reading

View the full issue arrow_forward

Cite This Article

Choose your preferred format

format_quote
Saber, Mohamed. “Removing Powerline Interference from EEG Signal using Optimized FIR Filters.” Journal of Artificial Intelligence and Metaheuristics, vol. 1, no. 1, 2022, pp. 08–19. https://doi.org/10.54216/JAIM.010101.
Saber, M. (2022). Removing Powerline Interference from EEG Signal using Optimized FIR Filters. Journal of Artificial Intelligence and Metaheuristics, 1(1), 08–19. https://doi.org/10.54216/JAIM.010101
Saber, Mohamed. “Removing Powerline Interference from EEG Signal using Optimized FIR Filters.” Journal of Artificial Intelligence and Metaheuristics 1, no. 1 (2022): 08–19. https://doi.org/10.54216/JAIM.010101.
Saber, M. (2022) ‘Removing Powerline Interference from EEG Signal using Optimized FIR Filters’, Journal of Artificial Intelligence and Metaheuristics, 1(1), pp. 08–19. Available at: https://doi.org/10.54216/JAIM.010101.
Saber M. Removing Powerline Interference from EEG Signal using Optimized FIR Filters. Journal of Artificial Intelligence and Metaheuristics. 2022;1(1):08-19. doi:10.54216/JAIM.010101
M. Saber, “Removing Powerline Interference from EEG Signal using Optimized FIR Filters,” Journal of Artificial Intelligence and Metaheuristics, vol. 1, no. 1, pp. 08–19, 2022, doi: 10.54216/JAIM.010101.
policy

Publisher's Note

The statements, opinions, and data presented in this article are solely those of the author(s) and do not necessarily represent those of ASPG, the journal, or its editors. ASPG and the editors disclaim responsibility for any harm arising from the use of any ideas, methods, instructions, or products described in this article, to the fullest extent permitted by applicable law.

Digital Archive Ready