Improving Capabilities of the Adaptive Recursive Least-Squares Filter in the Ocular Artifact Removal from EEG Signal

One of the most popular techniques in the Ocular Artifact (OA) removal from Electroencephalogram (EEG) signals is Adaptive Filter (AF) with Recursive Least-Squares (RLS) algorithm. The low convergence rate, good tracking, low miss-adjustment, and good stability are expected capabilities of this filter, which depend highly to value of forgetting factor (0<λ<1). As, with a λ very close to one, stability of the filter is increased due to low misadjustment, but its tracking capabilities is reduced and consequently the OA will remained in the EEG signal even after filtering. To preserve stability of the AF-RLS and improve its tracking, a new configuration of two AF-RLS in the wavelet domain is proposed for applying on approximation and detail coefficients. The proposed algorithm is compared with two older AF-RLS in the time domain (AF-T) and Wavelet based AF using approximation coefficients (WAF-A). Simulation results demonstrate the effectiveness of the proposed algorithm in term of the OA removal and preserving background EEG signals. Also some performance criteria such as visual comparison in the time domain, correlation coefficient and artifact to signal ratio are employed as evidence of this achievement. The proposed algorithm can be implemented in the real-time applications due to fast processing speed. *Author for correspondence Indian Journal of Science and Technology, Vol 9(13), DOI: 10.17485/ijst/2016/v9i13/85908, April 2016 ISSN (Print) : 0974-6846 ISSN (Online) : 0974-5645 Improving Capabilities of the Adaptive Recursive Least-Squares Filter in the Ocular Artifact Removal


Introduction
Electroencephalography (EEG) is a non-invasive medical technique for measuring the brain potentials activity. EEG signals are very useful in clinical application and Brain Computer Interface (BCI) 1 systems. Analysis of this signal is a challenging problem due to the fact that the signal is multi-component and very non-stationary 2 . In addition to cortical signal recorded by EEG, the non-cortical signals are also propagated over the scalp due to volume conduction effect 3 , which called artifact. The superposition of these artifacts with the EEG signal is recorded on the head surface 4,5 . Because of the overlapped frequency of these artifacts with cortical signals, their separation is almost impossible by visual inspection.
Hence artifacts make trouble for EEG interpretation and must be removed without scratching useful information of EEG signals. Among of these artifacts, Ocular Artifact (OA) is the most dominant form of interference in the EEG measurement 6 which is known as 10 to 100 times stronger than EEG signals 7 .
In recent decades, researchers have introduced various types of advanced digital signal processing techniques to remove the OAs from EEG signals such as, Independent Component Analysis (ICA) 8 , Adaptive Filter (AF) 9 , Wavelet Transform (WT) 10 , artificial neural network (ANN) 11 , Principal Component Analysis (PCA) 12 , Hilbert-Huang Transform (HHT) 13 . A comprehensive review of these techniques is given by 14 .
Keywords: Adaptive Filter, EEG, Ocular Artifact, RLS, Wavelet Transform Since bio-signals are time varying, the AF owing the ability to operates satisfactorily in an unknown environments and tracks time variations of input statistics 15 , has been used as a powerful technique in the OA removal. As compared to the Least-Mean-Square (LMS) algorithm, the Recursive Least-Squares (RLS), offers a superior convergence rate, especially for highly correlated input signals 16 , fast procedure for real time processing and independency to pre-processing and calibration 9 .
One most challenging issue related to adaptive RLS filters (AF-RLS) which affects its performance in terms of convergence rate, misadjusment, tracking and stability, is selection of the forgetting factor (λ) in the range of 0<λ<1. As, with a λ very close to one, the algorithm gets low misadjustment and good stability, but its tracking capabilities are reduced, while in the contrast, with a smaller value of the λ, the tracking is improved but stability due to the misadjustment is reduced 16 .
In the OA removal application, preserving background EEG signals which attains due to high stability and low misadjusment, have priority over OA removal which, achieves due to good tracking. Hence, the AF-RLS with a λ very close to one owing high stability and low miss-adjustment, is the main interest in this letter and as results, the tracking of the filter must be improved for proper OA removal. Although, the AF in the time domain have shown its effectiveness in the OA removal, but most of the EEG frequencies will be affected in the filtering process, even in the non-contaminated zones. While, the OAs usually occur in the range of 0 to 16 Hz 17 and being maximal at frequencies below 4Hz 18,19 .
A wavelet based AF-RLS with filter length= 16, λ =0.4 and sym3 as mother wavelet, has been proposed 20 to reduce noise in the EEG signals. The method has applied approximation coefficients of the signals to a single AF. In the present work, to increase properties of the previous filters with a larger λ, the EEG and Electrooculogram (EOG) signals are decomposed them into different levels of high frequency (detail) and low frequency components (approximation) using Stationary Wavelet Transform (SWT) with db8. The approximation Coefficient (CA) and Detail Coefficient (CD) of these signals are separately employed to two same AFs with a λ =0.9998, for adequate adaption and filter length=4 for the appropriate filtering. Results have shown robustness of the proposed algorithm in the OA removal along with preserving valuable EEG signals.

Stationary Wavelet Transform
WT is a function for converting the time domain signal into time and frequency domain signal by breaking a signal into shifted and scaled versions of the mother wavelet ) (t ψ as a basis function. As, practical EEG signals are discrete after sampling, Discrete Wavelet Transform (DWT) is widely used for these types of non-stationary signals and because of its fast computational speed, it is desirable for real time artifact suppression 21 . In each decomposition level, signal is divided to the CA and CD via, passing from low pass and high pass filter respectively, followed by down sampling. Hence, it makes the DWT as multi-resolution decomposition. The SWT, which is optimized of basic DWT, developed for overcoming to some restrictions of the DWT such as non-redundant, translation variance and aliasing because of down sampling in decomposition procedure 22 . It gives a better approximation than DWT since it is redundant, linear and shift invariant 23,24 . It can perform a multilevel 1-D stationary wavelet decomposition using a specific orthogonal wavelet such as Haar, Daubechies, Symlet and Coiflet families. Selection of mother wavelet highly depends to the similarity between the shape of the signal (OA in the contaminated EEG signal, here) and mother wavelet, for a better approximation and capturing of the OAs.

Principle of Adaptive Noise Canceller
In this paper, Adaptive Noise Cancellation (ANC) using RLS algorithm is used as a basic method for removing OA from EEG signal. The ANC is a process by which, the interference signal can be filtered out by identifying a model between a measurable noise source and the corresponding immeasurable interference 5 . Block diagram of an ANC for OA removal, is presented in Figure 1.
The contaminated EEG signal d(k) as demonstrated in the Equation 1, is a primary input which is naturally superposition of pure EEG s(k) (taken from cortical activity) and unknown form of the EOG signal n(k) as a reference signal to the AF.
The objective of an ANC in this application is, generation of the error signal (output) as the best estimate of pure EEG s(k). By feeding the error signal back to the AF through an RLS algorithm and setting up the filter coefficients, total error power will be minimized and objective of the ANC will be carried out. To achieve this goal, the Finite Impulse Response (FIR) filter as the Equation 2, is used to estimate the immeasurable interference signal n (k), which is mixed in primary signal.
Where, M is filter length, and w(i) is coefficients of the FIR filter and N (k-i) is pure EOG signal. Then, this estimated signal n̂ (k) will be subtracted from the primary signal, for generation of the error signal e (k), as Equation 3.
To estimate best fit of the model for calculating optimum coefficients w(i), minimization of the cost function J(k) according to Equation 4 is done.
The last part of the Equation 5 is removed because, s(k) is uncorrelated with n(k) and n(k), and therefore, its expected value is zero. As expected, by minimization of the cost function, the right side of Equation 5 must be minimized as is mentioned in Equation 6 and consequently n(k) can be assumed as a best fit of the n̂ (k).
This equation can be rewritten as Equation 7.
According to Equation 7, Equation 8 can be derived and one can say that, the output signal of this system is the best least square estimate of the pure EEG signal.

Methodology
This section is schedule to two parts including the main idea for development of the mentioned algorithm and, the applied procedure in the present work for the EOG artifact removal.

Idea for Algorithm Development
As it is discussed before, the RLS filter with a λ very close to one owing high stability and low miss-adjustment is able for preserving background EEG signals but, that is not capable in the perfect OA removal. Hence, in the present work it is attempted to improve the tracking of the AF-RLS with a λ very close to one for the perfect OA removal, as well as to preserve non-contaminated zones of the EEG signals in the high frequency ranges. On the other hand, studies have shown that, the coefficients of the WT have more supper-Gaussian nature in the probability density function and larger kurtosis than the original signal 21 . So, the coefficients of the AF in the wavelet domain, has significant performance than time or frequency domains. By applying both the CA and CD of the wavelet in the two different AFs, both coarser style and detail information of the signal can be considered. Hence, two AF-RLS in parallel, in the special level of the wavelet domain, have employed in this work; one for employing the CA, and another for the CD of the EEG and EOG signals. Since the EOG amplitude is higher than EEG and this artifact occurs in frequency range 0 to 16 Hz 25 and being maximal at frequency below 4Hz 18,19 , a low frequency range of these signals are employed using a certain decomposition level in the SWT. This certain level is highly related to the sampling frequency of the signals and, frequency of the artifact which can be slow or fast. For determining the maximum decomposition level in this work, a hypothesis is estimated as Equation 9.
Where, the F s denoted as the sampling frequency. Pursuant to this hypothesis, by increasing frequency of the OA (for fast OA), a level lower than estimated level must be applied. In the test case signals of the present work, because of existense of the slow and low frequency artifacts, the mentioned hypothesis is validated.

Procedure for OA Removal
The procedure of the OA removal is done as following steps.
• Calculation of the maximum decomposition level using Equation 9. • Decomposition of EEG and EOG signals using the SWT and db8 as mother wavelets. • Applying the CAs and CDs of last level of the EEG and EOG signals including the primary and reference signal respectively, to the two same parallel AF-RLS and generation of error signals as free-artifact coefficients. In this paper combination of the two wavelet based AF-RLS using the CA and CD denoted as WAF_AD. • Reconstruction of the error signals.
• Reconsruction of the time domain corrected EEG signal

Result and Discussion
In order to perform the proposed model, the natural contaminated signals were used. In this section, real EEG signal from C4 channel that is naturally contaminated to the OAs and right EOG signal, which are measured simultaneousely, taken from the Physionet website 26 . These signals are sampled at 250 samples per second.
One segment (3072 samples) of EEG and EOG signals are used including the primary signal for training of the AF-RLS and reference input, respectively. The optimum parameters for the AF-RLS are chosen as follows; length of filter=4, sigma=0. 0001 and λ= 0.9998. This section is divided to two parts. In the first part, the results of the OA removal using the proposed algorithm (WAF-AD) with two values of the λ are exhibited. In the second part, performance of the proposed method is compared with two older methods.

Removing the OAs
The maximum decomposition level for decomposition of these signals is suggested using Equation 9 as follow; 2 max nearest integer[log (250/2)] 7 level = = Hence, level 7 is chosen for decomposition of the EEG and EOG signals using db8. Figure 2 indicates the performance of the proposed WAF-AD algorithm with λ= 0.9998 for removing the OAs.
The Figure 2a shows one segment of the contaminated EEG, Figure 2b is related to the EOG, and the corrected EEG signals using the proposed technique is plotted in the Figure 2c. In the Figure 2a, two visible contaminated parts which are originated from the EOG in the Figure  2b, are demonstrated by arrows. By simple observation on the corrected EEG signal in the Figure 2c , it is found that the proposed algorithm has effectively removed the pointed OAs and, has protected the non contaminated parts of the EEG signals. To proof efficiency of the proposed algorithm for OAs removal, some performance metrics 27 are applied.
In the Figure 3, amplitude spectrum as a frequency domain analysis, is performed using absolute value of the Fast Fourier Transform (FFT). Figure 3a shows the magnitude of the FFT for the contaminated EEG in the y-axis, Figure 3b  To illustrate also superiority of the proposed algorithm in preserving non contaminated zones, frequency correlation plot (MATLAB coherence function) via Welch method for the corrected and contaminated EEG signals over the whole segment, is shown in the Figure 4.
From this figure it is evident that, there is a lowest correlation between these two signals in the very low frequency ranges which is due to existence of the low frequency OAs in the contaminated EEG and absent of that, in the corrected EEG. As expected, this correlation on the rest of the frequency ranges are almost near one, because of the more similarity between these two signals due to turning off the proposed filter in the same range.
The proposed algorithm is considered with a smaller λ as 0.7500 and results are displayed in the Figure 5. The  The Figure 5 indicates that, because of the good tracking of the AF-RLS with a smaller λ, the OAs have perfectly removed in the corrected EEG signal, but large part of the background EEG are also eliminated by this filter. For clarifying this issue, amplitude spectrum of the contaminated EEG, EOG and, corrected EEG are displayed in the Figure 6a, 6b and 6c, respectively.
It is obvious from pointed part of the Figure 6c that, the low frequency information of the EEG signal has lost. Comparing Figure 5 and Figure 6, with the Figure 2 and

Comparison of different AF-RLS Configurations
To demonstrate the superiority of the proposed method, performance of the WAF-AD was compared with two older AF-RLS configurations including the single WAF using CA (WAF-A) and single AF-RLS in the time domain (AF-T). For these configurations, the parameters are selected as same as discussed for WAF-AD.
Performance of the AF-T with λ=0.9998 in eliminating of the OAs presented in Figure 7. Figure 7a, Figure 7b and Figure 7c display the contaminated EEG, EOG and, corrected EEG, respectively. Considering the OAs pointed by arrows in the Figure 7a and Figure 7c it is evident that, the AF-T with the mentioned filter arrangement, is not able in complete OA removal. Also, performance of a WAF-A in elimination of the OAs is exhibited in the Figure 8. Figure 8a, Figure  8b display the contaminated EEG and EOG. Similar to the Figure 7c, the OAs are still remained in the output waveform (corrected EEG) of the Figure 8c, Since, the observation method is not reliable, the comparisons for the four mentioned configurations are also judged according to Correlation Coefficient (CC) criteria between the EOG signal with the conta-minated EEG and corrected EEG 27 . To achieve a good comparison using this criterion, two random zones including the minor and major contaminated zones with the same number of samples are marked in the Figure 9.
It is expected from an optimum OA removal algorithm that, for the minor contaminated zone, the filter works in the off mode and, for the major contaminated zone that works in the active mode. Consequently, it is expected that, higher similarity be seen between meajured CCs in the tow modes as before and after filtering for the minor contaminated zone and, higher difference for the major contaminated zone.
The CCs for the marked zones of the Figure 9, are measured for three mentioned configurations as WAF-AD, WAF-A and AF-T. For easy evaluation of these values, the bar graphs of the CC are presented in the Figure 10. The CC values for the minor and major contaminated zones are seperately dispalyed in the Figure 10a and Figure 10b. The Y-axis indicates the CC values and X-axis shows name of the algorithms. The CCs values measured from these algorithms will be compared with the CC value befor filtering. As it is evidient, in the Figure 10a the higher similarity between the CC before and after filtering is achieved using the WAF-AD. This algorithm has also recorded the higher difference between the CC before and after filtering in the Figure 10b. Hence, the WAF-AD has shown better results than two older algorithms.   In order to evident the above results, the Artifact to Signal Ratio (ASR) 28 for these algorithms are calculated using Equation 10 and are tabulated in the Table 1.    Where, the d(k) and e(k) were described in the Figure 1 and, N is number of samples. This comparison item shows the rate of OA suppression in contaminated EEG signal. As it is discussed in our previous paper 27 , the higher value of ASR indicates a better OA minimization in the contaminated zone. Clearly, from this table it can be concluded that, the WAF-AD having larger ASR, has shown a better performance for the OA removal than two older algorithms.

Conclusion
In this paper, a new configuration of wavelet based adaptive RLS filter is proposed to remove OA from EEG signal using ANC principle. The proposed configuration uses two AF-RLS with a λ=0.9998, for the approximation and detail coefficients of the last decomposition level constructed by SWT and db8. Simulation results show that applying both coarser style and detail information of the EEG and EOG signals in the two AF-RLS improves tracking capability of the AF-RLS with a λ very close to one. Hence, the proposed configuration removes OAs successfully without any distortion in background EEG signals. The performance of the proposed filter has also been compared to two older algorithms including the WAF-A and AF-T. The comparison results confirm the priority of the proposed WAF-AD algorithm. This technique is able in removing OA even from single channel EEG and can be applied in the real time application due to fast computational speed. The results which are included in this paper are in the extension and confirmation of the previous outcomes.