Вы находитесь на странице: 1из 22

Matching Pursuit Decomposition for EEG Analysis

Arindam Dutta Department of Electrical Engineering, Arizona State University adutta7@asu.edu

Abstract Matching Pursuit Algorithm is an adaptive decomposition technique that decomposes a signal into a set of linear waveforms which can be used for feature extraction, wave parameter estimation, EEG analysis etc. This paper explored Matching Pursuit decomposition using Gaussian and GD power signal dictionaries to decompose/approximate EEG signals and extract wave parameters. While the Gaussian dictionary is optimal to decompose symmetric signals, it is shown that the GD power signal dictionary is able to decompose asymmetric signals, such as EEG with artifacts.

1 Introduction
Electroencephalography (EEG) and magneto encephalography (MEG) can be used to examine activity in the brain using a net of sensors placed over the scalp to measure electric potential and magnetic eld, respectively. Since its rst recordings on human subject performed in 1929, the EEG has become one of the most important diagnostic tools in clinical neurophysiology [8]. EEG recordings are achieved by placing electrodes of high conductivity in dierent locations of the head. Measures of the electric potentials can be recorded between pairs of active electrodes (bipolar recordings) or with respect to a supposed passive electrode called reference (monopolar recordings). These measures are mainly performed on the surface of the scalp of the head. Modern ERP studies that intend topographic analysis often employ 32 to 256 electrodes [6]. Location of such electrodes is given in Figure 1. EEG analysis had mostly relied on visual inspection which is rather very subjective and hardly allows any statistical analysis or standardization. Due to this several methods were proposed in order to quantify the information of the EEG. One of such method was the Fourier analysis.

Although the Fourier Transform allows a passage from domain to frequency domain, it does not allow the combination of both the domains, in other words it does not provide the time localization of the frequency components. That is why time-frequency analysis proved to be a better solution for EEG analysis. One of the methods which is presented in this paper is the Matching pursuit decomposition of the EEG signals using time-frequency dictionary. Matching pursuit relies on the decomposition of signals into linear expansion of waveforms belonging to a very broad class of functions. These waveforms are adaptively matched to a dictionary of known waveforms, so that proper analysis can be made based on it. The objective of this paper is to explore the application of Matching Pursuit to decompose an approximate EEG signals using two dierent dictionaries, the conventional Gabor (Gaussian) dictionary and GD power (signal with power law group delay) dictionary.

Figure 1: EEG sensor locations (32), created using EEGLAB

2 Matching Pursuit Algorithm


Matching pursuits (MP) is a well known technique for sparse signal representation introduced rst by Mallat and Zhang [2]. MP is a greedy algorithm that nds linear approximations of signals by iteratively projecting them over a redundant, possibly non-orthogonal set of signals called dictionary. Since MP is a greedy algorithm, it may give a suboptimal approximation. It decomposes any signal belonging to a Hilbert space H into a linear expansion of waveforms that are selected from a redundant dictionary (or set of dictionaries) D of functions. These waveforms are iteratively chosen to best match the signal structures, producing a sub-optimal expansion. Vectors are selected one by one from the dictionary, while optimizing the signal approximation at each step k. 2

Let D = {g } be the dictionary of P > N M with the properties cited above. This dictionary includes N M independent vectors that dene a basis of the space RN M of signals with size N M . The Matching Pursuit algorithm begins by projecting the target function f on a vector g0 D and computing the residue Rf .

f = f, g0 g0 + Rf,

(2.1)

where Rf is the residual vector after approximating f in the direction of g0 . Since we impose Rf to be orthogonal to g0 :

f As we want to minimize Rf
2

= f, g0
2

+ Rf

(2.2)

= f

f, g0

we must choose g0 D such that f, g0 is

maximum. In some cases, it is not computationally ecient to nd the solution given by the Matching Pursuit algorithms, and a Matching Pursuit-suboptimal solution is computed instead:

| f, g 0 | sup | f, g |,

(2.3)

where (0, 1] is an optimality factor ( = 1 means that we choose the optimal solution given by the Matching Pursuit method). Into the next step, Matching Pursuit subdecomposes iteratively the residue Rf by projecting it on a vector of D that matches Rf at best. If we consider R0 f = f and we suppose the n-th order residue Rn f (n 0) has been computed, the next iteration will choose gn D such that:

| Rn f, gn | sup | Rn f, g |,

(2.4)

With this choice Rn f is projected onto gn and decomposed as follows:

Rn f = Rn f, gn gn + Rn+1 f,

(2.5)

where Rn+1 f and gn are orthogonal, so the quadratic module of the previous equation is:

Rn f

= Rn f, gn

+ Rn+1 f

(2.6)

From Equation 2.5, we can see that the decomposition of f is given by:
N 1

f=
n=0

Rn f, gn gn + RN f,

(2.7)

and with the same principle we can also deduce from Equation 2.6 that the module of the signal f is:
N 1

=
n=0

| Rn f, gn |2 + RN f

(2.8)

where RN f converges exponentially to 0 when n tends to

lim RN f = 0;

(2.9)

Hence

f=
k=0

Rk f, gk gk ,

(2.10)

and

=
k=0

| Rk f, gk |2 ,

(2.11)

Thus the original vector f is decomposed into sum of the dictionary that matches best with the residual at each stage. Also it can be seen that although the decomposition is non-linear, it follows the energy conservation rule as if it was linear.

3 Time Frequency Decomposition


The time representation is usually the rst description about a signal. The Fourier transform is also a powerful tool which gives light to the spectral part of the signal. But it does give us any idea about the time localization of the signal. Especially most of the real- world signals are time varying signals whose frequency change with time. In that case neither representation is good enough to

get a detailed idea about the signal. That is why time-varying signals are best represented in the time-frequency (TF) domain to obtain time-varying frequency information. In order to analyze the time varying EEG signals eectively, the time and frequency domain characteristics must be considered jointly. These joint time frequency representation gives light to both the time and the frequency localization which can help us to analyze a signal properly. A number of time frequency representations have been built such as the linear TFRs like Short time Fourier transform, Wavelet transform, quadratic TFRs like Wigner distribution, Spectrogram etc. The matching pursuit a TF based technique that decomposes a signal into highly localized TF atoms and can provide a highly concentrated TFR. These atoms are the dilated, translated, and modulated versions of a single basic function, for example Gaussian function. The matching pursuit decomposition (MPD) algorithm iteratively selects the best atoms for the decomposition of the waveform based on their orthogonal projections on the waveform. This is done by performing an exhaustive search over all the atoms in the dictionary [1].

3.1 Gabor Matching Pursuit In general any basis function can be used as a dictionary to decompose the required signal. But It can be shown that the only signal that achieves the lower bound is the Gaussian signal, x(t) = cet Tx Fx =
2

1 , 4

(3.1)

where Tx and Fx are the duration and the bandwidth of the signal. This implies that it is the most concentrated signal in the time frequency plane. This is why Gaussian dictionary is chosen for optimal matching pursuit. In practice the Gaussian basis function is dilated, translated and modulated to create a large array of dictionary. Let D = g (t), = (s, u, ), be the dictioanry of all time-frequency atoms generated g (t), where (s, u, ) are the scaling factor, translation is time and frequency shift respectively. The Gaussian atom belonging to the dictionary is given by, 1 t u jt g (t) = g ( )e , s s

(3.2)

where,

g (t) = 2 4 et ,

(3.3)

Its Fourier transform is centred at the frequency and localized over the frequency domain proportional to 1 s . The Wigner Distribution of a Gaussian atom is given as,

W Dg (t, ) = 2H (

tu )F [s( )], where s


2 2

(3.4)

H (t) = e2t , F ( ) = e 2

The Wigner Distribution of a Gaussian atom is shown in Figure 2 As the Wigner distribution of the Gaussian atom is always positive, the Matching Pursuit distribution is never negative. So the energy expression can be found from the time-frequency distribution.

Figure 2: A single Gabor atom and its Wigner Distribution

3.2 Simulation Results In this section the Matching pursuit decomposition algorithm is implemented on the EEG dataset created using EEGLAB with an array of Gabor atoms. The algorithm is given as follows, Algorithm 1: How to write algorithms input : EEG signal b , Gabor dictionary D output: Residue R, Normalized energy of Residue E initialization R=b; Iteration = 400; En= ||R||2 ; for i=1:iteration do Calculate the inner product (dot product) for each atom, P = R, D ; Find D for which P is maximum (Di ); update Residue,R = R Di , = R, Di ; update Energy, E = set i = i+1; if E En then break; end end
RR En

3.2.1 EEG dataset The EEG dataset has been obtained from an experiment on reaction to visual stimulus. This is provided with the EEGLAB toolbox [6]. In this experiment, there were two events, square and rt. The square events are the appearances of a green colored square on the screen and rt is the reaction time of the subject. The square could be presented at ve locations, but here we have only considered presentation on the left. In this experiment, the subject covertly attended to the selected location on the computer screen responded with a quick thumb button press only when a square was presented. They were to ignore circles which were presented at the same time. To reduce the amount of data required to download and process, this dataset contains only targets, i.e. square presented at the two visual eld attended locations for a single subject. Figure 1 shows the 32 sensor locations on the brain scalp. Figure 3 shows each sensor readings.

Figure 3: EEG readings from dierent channels, created using EEGLAB

3.2.2 Gabor Dictionary In 3.1 we have discussed in details about the Gabor dictionary. The Gabor dictionary used in this simualtion is of the form,
tu2 4t 1 g (t) = e 2s2 2 cos( ), s

(3.5)

where, the range of , u and s is varied from 1-200, 0-1024 and 1-50 respectively. Six of such Gabor atoms and there corresponding Wigner Distribution is shown in Figure 4.

Figure 4: 6 Gabor atoms with their Wigner distribution

3.2.3 Decomposition In this work, Matching Pursuit algorithm is implemented in MATLAB tested to decompose/approximate the EEG signals and extract the wave parameters. Stop criteria of the decomposition is set to either a. maximum iteration number at 200 (iteration=200) or b. Normalized Residual energy E En (normalized energy of the initial EEG), whichever is reached rst. Figure 5 shows the input EEG signal and the decomposed signal after 200 iterations. Figure 6 9

shows the rst 5 gabor atoms that matches with the input EEG signal and the residue after 200 iterations.

Figure 5: Input EEG and residue after 200 iterations

3.2.4 Residual Energy The residual energy E is dened as


N 1

E=
i

(b
n=0

Rn b, gn )2 ,

(3.6)

Figure 7 shows the gradual reduction of energy of the residue with the increase in the number of iterations.

3.3 Matching pursuit with Power law group delay signals In this part dictionary atoms are created using signals with nonlinear group delay. Such signals have dispersive group delays which are governed by a power law of some factor k. Analysis of these signals with linear or bilinear TFRs, which belong to the Cohens class, is almost inadequate. These signals are represented by the Power class (Ane class) quadratic time frequency representations where these signals are well localized along their power law group delay functions. The general

10

Figure 6: First 5 Gabor Atoms equation such kind of signals in given as follows,

tx(f ) = T0 + Cf 1 ,

(3.7)

Examples of such signals include dispersive propagation of a shock wave in a steel beam ( = 1 2 ), 11

Figure 7: Change in Energy of the Residue wth iteration trans-ionospheric chirps measured by satellites ( = 1), acoustical waves reected from a spherical shell immersed in water, waves propagating along a uniform distributed RC transmission lines ( = 1 2 ) [9]. These signals constitute the family of power impulses. Power impulses are denes in the frequency domain as: || f 1 j 2csgn(f )| ff | r )| | e fr fr

Ic (f ) =

| (f )|e

f j 2c f

(3.8)

with power group delay || f 1 d f | | = c ( )withf R fr fr df fr

g (f ) = c (f ) = c

(3.9)

One of such atoms with its Bertrand distribution is given in Figure 8

12

Figure 8: Signal with power law group delay with its Bertrand distribution

3.4 Simulation Results In this section Matching pursuit decomposition algorithm is implemented on the EEG dataset, created by EEGLAB, with atoms of the above described signals. The algorithm is same as given in section 3.2

3.4.1 EEG dataset Same EEG dataset is taken as in section 3.2.1

3.4.2 Dictionary The dictionary of atoms is created using the le gdpower.m from the tftb-0.2 toolbox. Equation 3.7 is used to create the dictionary by varying values of and C . Six of such atoms and their corresponding Bertrand distribution is shown in Figure 9

13

Figure 9: 6 atoms with their Bertrand distribution

3.4.3 Decomposition In this work, Matching Pursuit algorithm is implemented in MATLAB tested to decompose/approximate the EEG signals and extract the wave parameters. Stop criteria of the decomposition is set to either a. maximum iteration number at 200 (iteration=200) or b. Normalized Residual energy E En (normalized energy of the initial EEG), whichever is reached rst. Figure 10 shows the input EEG signal and the decomposed signal after 200 iterations. Figure 14

11 shows the rst 5 gabor atoms that matches with the input EEG signal and the residue after 200 iterations.

Figure 10: Input EEG and residue after 200 iterations

3.4.4 Residual Energy The energy of the residue is given as in equation 3.6. Figure 12 shows the gradual reduction of energy of the residue with the increase in the number of iterations.

4 Conclusion
It can be said that an EEG signal as a whole conveys very limited knowledge about itself unless some methods are used to extarct the features for a better study. From the above analysis it can be said that the Matching Pursuit Algorithm provides one of the best ways to extarct signicant features about the EEG. A comparative study is done here between two dierent types of atoms used as the dictionary, one with the conventional Gabor dictionary and the other with a dictionary of signals with nonlinear group delay. It can be seen that though Gaussian atoms provide an optimal matching pursuit, the nonlinear group delay signal also provides an optimal solution in this case. Moreover if we see the nal Residues in both the cases, it can be seen that the Signal is more decomposed in the latter case that the former. So the latter provides a good result even if the signal family is a bit complicated. 15

Figure 11: First 5 Atoms that matched the Residue

References
[1] F. Hlawatsch and G. F. Boudreaux-Bartels, Linear and quadratic time-frequency representations, IEEE Signal Processing Magazine, vol. 9, no. 2, pp. 21-67, 1992.

16

Figure 12: Change in Energy of the Residue wth iteration [2] S. Mallat and Z. Zhang, Matching Pursuits with Time-Frequency Dictionaries, IEEE transactions on Signal Processing, vol. 41, no. 12, December 1993 [3] Alex Maurer, Miao Lifeng,J.J. Zhang, N. Kovvali, A. Papandreou-Suppappola, C. Chakrabarti, EEG/MEG artifact suppression for improved neural activity estimation, Signals, Systems and Computers (ASILOMAR), pp. 1646 - 1650, 2012 [4] S. Das, I. Kyriakides, A. Chattopadhyay and A. Papandreou-Suppappola, Monte Carlo Matching Pursuit Decomposition Method for Damage Quantication in Composite Structures Journal of Intelligent Material Systems and Structures 2009, November 2008 [5] P. J. Durka and K. J. Blinowska,Analysis of EEG Transients by Means of Matching Pursuit, Annals of Biomedical Engineering, Vol. 23, pp. 608-611, 1995

17

[6] A. Delorme and S. Makeig. (2012, March) EEGLAB tutorial outline chapter 1: Loading data in EEGLAB. [Online]. Available: http:/sccn.ucsd.edu/wiki/Chapter 01: Loading Data in EEGLAB [7] Time Frequency toolbox (tftb-2.0), [Online], Available: http:/tftb.nongnu.org [8] J. C. Mosher, R. M. Leahy, and P. S. Lewis, EEG and MEG: Forward solutions for inverse methods, IEEE Transactions in Biomedical Engineering, vol. 146, pp. 245-259, March 1999. [9] Antonia Papandreaou- Suppappola, Time-Frequency Processing: tutorial on principles and practice, [Book] Applications in Time-Frequency Signal Processing

18

Appendix A: Matlab Code:


Matching Pursuit Decomposition of EEG clc close all ; clear all ;

l o a d EEG. mat ; run d i c t ; b=(EEG. data ( 1 , 1 : 1 0 2 4 ) ) ; [M,N]= s i z e ( gabor ) ; n=s i z e ( gabor ) ; A1=z e r o s ( n ) ; A2=z e r o s ( n ) ; R=b ; En= ( norm ( b ) ) 2 ; H= 5 ; i f (H<=0) e r r o r ( The number o f i t e r a t i o n s n e e d s t o be g r e a t e r then 0 ) end ; l =1; f o r k = 1 : 1 :H [ c , d ] = max( abs ( r e a l ( gabor ) R) ) ; A1 ( : , d )=r e a l ( gabor ( : , d ) ) ; f i g u r e ( 1 ) ; s u b p l o t ( 6 , 1 , k ) ; p l o t ( abs (A1 ( : , d ) ) ) ; a x i s ( [ 0 1024 1 1 ] ) ; t i t l e ( s t r c a t ( Atom , i n t 2 s t r ( k ) ) )

10

11

12

13

14

15

16

17

18

19

20

21

22

23

% a= t f r s p w v (A1 ( : , d ) ) ; % f i g u r e ( 1 ) ; s u b p l o t ( 6 , 1 , 6 ) ; i m a g e s c ( a ) ; h o l d on ; A2 ( : , k )= A1 ( : , d ) ;

24

25

19

26

27

f i g u r e ( 2 ) ; s u b p l o t ( 3 , 1 , 2 ) ; p l o t (A2) ; a= abs ( t f r b e r t (A2 ( : , k ) ) ) ; f i g u r e (1 ) ; subplot ( 6 , 1 , 6 ) ; imagesc ( a ) ; gabor ( : , d ) =0; y = A1 \ b ; R = b A1 y ; f i g u r e ( 3 ) ; s u b p l o t ( 3 , 1 , 3 ) ; p l o t (R) ; a x i s ( [ 0 1024 100 1 0 0 ] ) ; E( l )= (R R) /En ; f i g u r e ( 2 ) ; p l o t (E) ; t i t l e ( Energy o f t h e Residue ) ; x l a b e l ( i t e r a t i o n s ) ; y l a b e l ( Energy ) ;

28

29

30

31

32

33

34

35

36

l=l +1; % i f (E<= En 0 . 2 ) % % end %m =i n p u t ( Do you want t o c o n t i n u e , Y/N : , s ) ; % i f m==N % break % end end a= abs ( t f r b e r t (A2 ( : , k ) ) ) ; f i g u r e (1 ) ; subplot ( 6 , 1 , 6 ) ; imagesc ( a ) ; Gabor Dictionary % clc % clear all % close all break

37

38

39

40

41

42

43

44

45

46

t = (0:1023) ; j =1; 20

for u=0:64:1024; f o r i =0:5:200 f o r s= 1 : 1 : 2 5

10

11

sigmas = exp ( l o g ( i ) ) ; gabor ( : , j ) =(1/ s q r t ( s ) ) exp ( . 5 ( ( ( ( t u ) ) / s ) . 2 ) s i g m a s .( 2) ) . c o s ( ( t ) sigm a s .( 1) 2 p i 2 ) ;

12

13

% figure (1) ; % p l o t ( t , gabor ( : , j ) ) ; j=j +1; end end end Dictionary of signals with nonlinear group delay % clc % clear all % close all

14

15

16

17

18

% sigma s = exp ( l o g ( 0 . 5 ) ) ; K= 2 ; t =1:256; u= 1 0 0 ; C= 0 . 5 ; F0 = 5 0 ; j =1;

10

11

12

13

f o r K= 1 0 : 0 . 1 : 1 0 f o r C= 1 : 0 . 2 : 1 0 gabor ( : , j )= gdpower ( 1 0 2 4 ,K, C) ; 21

14

15

16

j=j +1; end end

17

18

19

20

% gabor =(1/ s q r t ( s ) ) exp ( . 5 ( ( ( ( ( t u ) ) ) / s ) . 2 ) s i g m a s .( 2) ) . c o s ( ( t ) sigma s .( 1) 2 p i 2 ) ;

21

22

% f i g u r e , p l o t ( r e a l ( gabor ) ) ; % f i g u r e , t f r w v ( r e a l ( gabor ) ) ;

23

22

Вам также может понравиться