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].
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].
2. Related Work
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.
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.
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
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:
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:
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
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
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.
) move in the same direction, the value of
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.
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.
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.
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 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.
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 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].
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.”