A Novel Approach of ECG Signal Enhancement Using Adaptive Filter Based on Whale Optimization Algorithm

1Department of Electronics and Communication Engineering, G. B. Pant Institute of Engineering and Technology, Pauri, Uttarakhand, India. 2Department of Computer Science Engineering, G. B. Pant Institute of Engineering and Technology, Pauri, Uttarakhand, India. 3Department of Electrical Engineering, G. B. Pant Institute of Engineering and Technology, Pauri, Uttarakhand, India. *Corresponding Author E-mail: arverma06ei03@gmail.com

The ECG is a very important screening tool. ECG provides the information about the human heart condition. It's provides the information about electrical changes in the heart. It detects the anomalies of heart rate. ECG is pivotal detection of cardiac activities. It detects different types of disease related to heart. ECG is also finding the non-cardiac disease as emboli and electrolyte disorders. It records the heart rate. The different component is present in an ECG signal as the P wave, QRS wave, and T wave. These waves provide firm information about the ECG signal. To find the ECG signal the electrodes are placed on the human body and it finds the waveform of heart. The multiple view of heart activity is recorded by the ECG machine. The electrodes are also playing an important role to find out the multiple views in 1-4 . The major problem of ECG signal measurement is that ECG signal is degraded with noise. So to obtain a pure ECG signal right diagnosis of the signal is important. ECG is filtering and de-noising is important to clinical application. The important information of the waveform is affected by the noise. The noise is present due to different reason in the ECG signal.

ECG Artifacts
The noise present in ECG signal occurs by different cause. The noise is called artifacts in ECG signal. In the Power Line interference are occurs high frequency noise which is generated by respiration and body movement. The base Line wander consist low frequency noise which is generated by power lines at 50Hz to 60Hz frequency. The ECG signal is sensitive to SNR. The sensitivity is caused by the low frequency component of ECG signals. The low frequency band has some different internal and external noise. Internal noise commonly generated by the different function of the human body as-EMG. The external noise generated by the device used to measure the ECG signal as-Base line wandering. The signal filtering is very necessary to get the pure ECG signal. Because different noise is present in ECG signal so filtering of signal is a difficult task.
Several methods are used to de-noising the ECG signal. The adaptive filter gives a good result over the different type of filter. The WOA technique is used to find good convergence or better fidelity parameter over PSO, MPSO and ABC in [4][5][6][7] .

Adaptive filter
The adaptive filter coefficients are varying according to some condition. Its coefficient is changeable and adjustable according to requirement. The performance of the system has improved by these characteristics. Its characteristics adapt the change in parameters so it has a self-adjustable quality. The adaptive filter is widely used in biomedical signal enhancement. The adaptive filter is a very good method to remove noise or artifacts from ECG signal. It is used where the signal to noise occupies a proper distinct frequency band. The conventional filters are basically used to extract the signal but to remove the noise or   In many cases the coefficient of filter needs to be changeable. The adaptive filter is changing the signal characteristics according to need. Adaptive filter is mainly used by this reason: 1. When it compulsory to change the filter coefficient according to requirement. 2. When the signal and noise frequency overlap. 3. When the frequency occupied by the artifact is changing according to time.
The use of conventional filter is cause of distortion in the desired signal. Adaptive filter used like a noise canceller to produce a optimum result in corrupted signal. So by using the adaptive filter the accurate result of desired signal obtain in 7,8 . The feedback network updates the filter coefficient and it reduces the noise until the desired response is obtained. The d(n) is the corrupted ECG signal, s(n) is pure signal and q(n) is noise signal which consist the high frequency component as-power line interference and low frequency component as muscles noise. So the q 1 (n) is high recurrence noise and q 2 (n) is low recurrence noise. The q 1 (n) and q 2 (n) is are not correlated with s(n). The ANC filter used to generate the output signal y(n). The error signal e(n) is obtained by subtraction of d(n) and y1(n). Error signal feedback to the every cycle. This process is continued until the desired output obtain. The e 1 (n) is feedback until the high frequency component reduce in the first circuit. The final signal s'(n)+q'(n) consist low frequency component. Error signal e 2 is generated by subtraction of s'(n)+q(n) and y2(n). The e 2 (n) is also feedback every instant until the e 2 (n) is reduce. The final stage gives s'(n) signal which is similar to s(n). The error signal is described by the following equation- The e ij is i th sample of n repetition. N is the total number of samples. To get optimum results in each iteration we used WOA technique. This algorithm gives the better rate of convergence, better global search, better fidelity parameter or easy to execute in 9, 10 .

Proposed method ANC Filter Using Whale Optimization Algorithm
The Adaptive filter designed with whale optimization algorithm on noisy ECG signal gives a good performance. In the proposed work, the random noise is generated using Matlab 2013(a) which has a length of 18000. The fidelity parameters such as output Signal-to-Noise Ratio (SNR), Mean Square Error (MSE) and maximum error (ME) are varying according to, input Signal to noise ratio in [9,10]The different fidelity parameters are calculated using following mathematical terms: ... (3) ... (4) ... (5) The whale optimization algorithm is a meta-heuristic algorithm. It has two basic elements namely, exploration and exploitation. The exploitation is used for local search, which finds the information about the best search agent. The exploration is used to search the global optimum value. WOA technique uses killing nature of humpback whales. Which is analyzed and the process is completed by following two important methods: 1. The preys are chased by the random or best search agent. 2. Then the bubble net attacking method is used.
The humpback whale swims around the target, forming a thin shaped circle. It makes a winding path and creates distinct bubbles along the circle formed. The humpback whale uses two methods when they search for the prey. In mathematical terms for these 50% to choose among these two method to refresh the position of whales as follow-... (6) It also forms a path which is similar to the shape 9. They have a very different hunting method which is often called as the bubble net  Fig. 6. Representation of unimodal benchmark function F1 in objective space feeding method in 11 WOA consist of two major phases described as follow-

Encircling the prey
In encircling, the whale finds out the position of the prey and encircles them. In this method, we assume that the best solution is the target prey. The other search candidate continues to refresh the position. The mechanism is described by the following equation ... (7) ... (8) Where the current iteration is represented by t, the coefficient Vectors represented by A and C, the position vector of best solution is represented by X*, and the position vector of a solution is  represented by X,| | is the absolute value.The vectors A and C are determined by the following equation: ... (9) ... (10) Where components are linearly reduced to a from 2 to 0 in each cycle and the random vector r is in the range of [0, 1].

Bubble Net Hunting Method
The bubble net hunting method has two approaches to design a mathematical model.

Shrinking Encircling Prey
The value of A is a randomly chosen value in this method which lies between range [-a, a].Here, A is reduced by 2 to 0. The position is set to random values in the range of [-1, 1].The new position of a lies between the current and original position.

Spiral Position Updating
The spiral shaped mathematical model is used between position of the prey and the humpback whales. It follows the helix shaped path. The mathematical equation used for the position updating are- Table 3. Comparative result of ME by using different technique on ECG signal Input ME(× 10 -2 ) ME(× 10 -2 ) ME(× 10 -2 ) ME(× 10 -2 ) ME(× 10 -2 ) ME(× 10 -2 ) SNR(db) LMS [ D=|C.X*(t)-X(t)| represent the distance between the prey(best solution) and i th whale, b is a constant, l is a random value in the range [-1,1] in [11][12][13][14][15] Search for prey The search stage is also called exploration phase. The whales discover the prey by their random search. The whales change their position according to other whales. To oblige the search agent to relocate distant away from the reference whale, here we choose A with values greater than 1 or less than 1 in {16-25} The mathematical equation for the exploration is described as ... (12) ... (13) The random position vector chosen by current population is represented by X rand in [11][12][13][14][15][16][17][18][19][20][21][22][23][24][25] . The pseudo code and flow chart of WOA is shown below in fig 3 and fig.4

RESUlT ANd diSCUSSiON
The ANC filter using WOA gives improved amplitude of P, Q, R, S pulse. The WOA technique gives more optimum result compare to PSO, MPSO and ABC technique as it detects ECG signal more accurately in 9 The WOA technique gives high quality improvement in output SNR, MSE and ME with respect to input SNR. It is by far better than the other PSO, MPSO and ABC technique. By using unmoral benchmark function F1 we obtain good SNR, MSE and ME for ECG signals. The best Fig. 9. Performance analysis of MSE with respect to input SNR by using PSO, MPSO, ABC and WOA Fig. 10. Performance analysis of ME with respect to input SNR by using PSO,MPSO, ABC and WOA solution in objective space by using F1 is 2.7329e-28 and the best optimal value for F1 is 1.572e-65.
The comparative analysis of output SNR with respect to input SNR on different ECG signals is shown in the table1: The comparative analysis of MSE with respect to input SNR are given in the table2 The comparative analysis of ME with respect to input SNR are given in the table3

CONClUSiONS
The efficient ANC filter using WOA is developed for de-noising of ECG signal. The WOA gives better result for different fidelity parameters such as SNR, MSE and ME compared to PSO, MPSO and ABC technique. The ANC filter using WOA gives optimum solution compare to PSO, MPSO and ABC technique. This makes it a very attractive approach to find out better results for SNR, MSE and ME in comparison to PSO, MPSO and ABC for future prospective. The WOA gives a good convergence rate compare to swarm optimization such as PSO, MPSO and ABC so it is used for further comparison with the other technique.