ELEKTRYKA 2009 Zeszyt 2 (2) Rok LV Michał LEWANDOWSKI Instytut Elektrotechniki i Informatyki, Politechnika Śląska w Gliwicach REDUCTION OF PASS BAND AMPLITUDE DISTORTIONS IN THE EEG FILTERING SYSTEM BASED ON SELECTED IIR FILTERS Summary. The paper presents pass band amplitude distortion reduction for the EEG multi-band filtering system containing IIR filters. The distortion reduction method is based on such redesigning the existent filters that an additional condition should be fulfilled (to get as close as possible to the brick-wall band-pass filters). In most cases obtained the results revealed significant improvement in filtering quality. Keywords: multiband filtering, distortion reduction, distortion analysis, frequency analysis, EEG REDUKCJA ZNIEKSZTAŁCEŃ AMPLITUDOWYCH W PASMACH PRZEPUSTOWYCH UKŁADU FILTRACJI SYGNAŁU EEG OPARTEGO NA WYBRANYCH FILTRACH NOI (IIR) Streszczenie. W artykule przedstawiono metodę redukcji zniekształceń amplitudowych w układach wielostopniowej filtracji pasmowej sygnału EEG. Przedstawione badania dotyczą układu zbudowanego na podstawie wybranych filtrów NOI (IIR). Proponowana metoda opiera się na takim przeprojektowaniu filtrów układu, aby charakterystyki częstotliwościowe zastępczych filtrów poszczególnych podpasm były jak najbardziej zbliżone do charakterystyk idealnych filtrów środkowoprzepustowych. W większości przebadanych przypadków uzyskano wyraźną poprawę jakości filtracji. Słowa kluczowe: filtracja pasmowa, redukcja zniekształceń, analiza zniekształceń, analiza częstotliwościowa, EEG 1. INTRODUCTION Analysis of brain EEG signals is a part of nowadays non-invasive medical diagnosis and therapy. In many cases it is purposeful to divide the EEG signal into characteristic bands: delta (0.5-4Hz), theta (4-8Hz), alpha (8-13Hz) and beta(13-30hz) [6] before the main analysis is performed. These bands are connected with physiological brain activity. In most cases it is
36 M. Lewandowski also desirable to filter the signal at the preprocessing stage to limit its frequency range (for example: 0.3-30 Hz) [2]. Systems used to performed such operation are called multiband filtering systems [3]. The medical diagnosis in most cases is based on the analysis of the wave shape [1], so filtering have to be done carefully to not introduce any significant distortions to the shape of the signal. There are two main types of multiband filtering systems: a single-level systems (set of parallel digital filters) and a multi-level systems which structure is far more complicated (may contain cascade filtering and additional elements) [3]. Generally, multiband filtering systems suffer from distortions connected with non-ideal amplitude and non-linear phase characteristics of the filters. In paper [5] a method of reduction of amplitude distortions in multi-level multiband filtering system has been presented. The results obtained in FIR based system were promising, so it has been decided to test systems based on selected IIR filters. The results are presented in the following paragraphs. 2. EEG SIGNAL MULTI-LEVEL FILTERING SYSTEM Analyzed EEG multi-level filtering system in presented in Fig.1. Fig. 1. EEG signal multi-level filtering system Rys. 1. Wielostopniowy układ filtracji sygnału EEG Discrete input EEG signal x[i] is split into four sub bands y1[i]-y2[i] which are containing the signals of EEG characteristic bands (beta, alpha, delta and theta respectively). The splitting is done by using a cascade of low-pass and high-pass filters and decimators. As has been shown in [4] (after transformation to the Z-domain), a cascade system constructed from LTI filters and decimators can be reduced to the form presented in Fig.2. In Fig.2 two characteristic elements can be distinguished in each signal path. First is a substitute subband filter Fn(z) and second is the substitute decimator of order 2-16. The
Reduction of pass band 37 system has been reduced to the form shown in Fig.2 because this form is most convenient for the distortion reduction algorithm described in the next paragraph. Fig. 2. Reduced form of analyzed EEG filtering system (Z-domain representation) Rys. 2. Zredukowana postać układu filtracji sygnału EEG (dziedzina transformaty Z) 3. REDUCTION OF AMPLITUDE DISTORTIONS IN EEG FILTERING SYSTEM As has been proposed in [5] the idea of reduction of amplitude distortions in multi-level filtering system is based on interaction between amplitude characteristics of connected filters. The substitute subband filters (Fn(z) in Fig.2) amplitude characteristics should be as close as possible to the ideal band-pass filters characteristics. It can be achieved by redesigning existing filters in such a way, that the substitute subband filters will fulfill (as close as possible) the following conditions: 1, n, n 0, n, n F f f f f, (1) n L H F f f f f, (2) n L H where Fn f is the amplitude characteristics of n-th substitute subband filter and are the lower and upper cut-off frequencies of n-th filter. When the pass band amplitude characteristic is optimized, only the first condition (1) has to be fulfilled and this is the general assumption in this paper. Another assumption is that only the high-pass filters (G1(z)-G4(z)) are redesigned in the corrected system. This assumptions make the results directly comparable with those presented in [5]. For filter redesigning one of the optimization filter designing techniques can be used. There are number of methods which f n L, f n H
38 M. Lewandowski provide arbitrary chosen amplitude characteristics of designed filter. In [5] the Remez algorithm was used for FIR filters. In the next paragraph the Yule a-walker method for IIR filters [7] has been used. 4. DISTORTION REDUCTION RESULTS FOR SELECTED IIR FILTERS Laboratory tests has been performed for Butterworth, Chebyshev type I and elliptic filters. Test has been done using EEG signal recorded during examination of a healthy man (certified EEG equipment by Elmiko has been used) and the distortion evaluation procedures were written in Matlab software. Results of relative difference in amplitude distortion evaluation before and after the correction are shown in Fig.3. Butterworth filters - -30-50 -70 220 Chebyshev I filters 120 20-80 220 Elliptic filters 120 20-80 Fig. 3. Relative amplitude distortion difference in corrected system Rys. 3. Względna zmiana zniekształceń amplitudowych po zastosowaniu korekcji
Reduction of pass band 39 The amplitude distortion measure has been calculated using the following amplitude distortion measure: where A fh A 0 H L fl E 2 1 H f H f d f f f, (3) E is the RMS based amplitude distortion measure, H f and 0 H f are the amplitude characteristics of ideal and the tested filter respectively and f, L f are the lower H and upper cut-off frequencies. It can be noticed in Fig.3 that for Butterworth filters the distortion reduction effect is visible for all tested filters (20 to 50 reduction). Best results were achieved for filters of order 3-6. In case of Butterworth and elliptic filters the reduction is clearly visible for filters of order grater then 2 and for orders 1 and 2 the results are significantly worse (more then 0 for most bands) than before the correction. 20 0-20 -40-60 -80-0 Butterworth filters 1 2 3 4 5 6 7 8 9 1 30 - -30-50 -70-90 30 - -30-50 -70-90 Chebyshev I filters 1 2 3 4 5 6 7 8 9 1 Elliptic filters 1 2 3 4 5 6 7 8 9 1 Fig. 4. Relative phase distortion difference in corrected system Rys. 4. Względna zmiana zniekształceń fazowych po zastosowaniu korekcji
40 M. Lewandowski It is also necessary to mention that not for all corrected systems the substitute filters Fn(z) were stable. The unstable cases were excluded from the presented results. Because all tested IIR filters were nonlinear phase filters, the influence of the amplitude correction algorithm on the phase distortions has been evaluated (Fig.4). Phase distortions has been calculated using the following formula: E H 1 2 arg( H ( f )) arg( H 0( f )) d f f f H f L fd, (4) where E is the phase distortion (nonlinearity) measure in pass band frequency range (fl;fh) and arg(h0(f)) is the amplitude characteristic of equivalent linear phase filter (calculated as linear regression of arg(h0(f)) on the range (fl;fh)). 120 0 80 60 40 20 0 1 60 160-40 160 1 60-40 Butterworth filters Chebyshev I filters Elliptic filters Fig. 5. Relative interband aliasing difference in corrected system Rys. 5. Względna zmiana aliasingu międzypasmowego po zastosowaniu korekcji
Reduction of pass band 41 As can be noticed in Fig.4, phase distortions were smaller after the correction in nearly every case (one exception for Butterworth y2 band filter of order 2). Most significant reduction was achieved for Chebyshev filters. The last analyzed parameter was the interband aliasing distortion shown in Fig.5. The interband aliasing distortion has been defined as: where frequency. fh f 1 2 1 N 2, (5) EP H( f ) df H( f ) df f f f L 0 N H fh E P is the interband aliasing (stop bands distortion) measure and f is the Nyquist N It can be noticed in Fig.5, that the interband aliasing parameter is usually worse after the correction for most of the tested filters. It can be explained by the fact, that when the pass band amplitude parameters are getting closer to those of the ideal filter (EA parameter (3)) and the order of the filters remain unchanged, then the stop band parameters are usually getting worse (Ep parameter in this case) [7]. 5. CONCLUSIONS Presented amplitude distortion reduction method can be used to improve pass band amplitude parameters of new and existing multi-level multiband filtering systems based on IIR filters. However, the results strongly depend on the type and order of used filters, so it is necessary to compare system distortions before and after the correction. In a few cases the amplitude distortions after correction were worse than before. The corrected systems had significantly better phase linearity in nearly every case (one exception). Interband aliasing (stop band) distortions were generally worse after the correction. BIBLIOGRAPHY 1. Delorme A., Makeig S.: EEGLAB: an open source toolbox for analysis of single-trial EEG dynamics including independent component analysis. Journal of Neuroscience Methods 2004, vol. 134, p. 9-21. 2. Huang R.S., Tsai L.L., Chung J.: Selection of Valid and Reliable EEG Features for Predicting Auditory and Visual Alertness Levels. Proc. Natl. Sci. Counc. ROC(B), 2001, Vol. 25, No. 1, p. 17-25. 3. Lewandowski M.: Selected multiband filtration methods of nonstationary signals. VIII International PhD Workshop OWD 2006, Wisła, October 2006.
42 M. Lewandowski 4. Lewandowski M.: Reduction of some multi-level multiband filtering system to a singlelevel system. XIII ZKwE Conference, Poznań, April 2008. 5. Lewandowski M., Walczak J.: Reduction of amplitude distortion in multi-level multiband filtering system. XXXI IC-SPETO, Ustroń, Maj 2008, s. 89-90. 6. Principe J.C., Smith J.R., Balakrishnan S.K., Paige A.: Microcomputer-Based Digital Filters for EEG Processing. IEEE Transactions on Acoustic, Speech and Signal Processing 1979, Vol. ASSP-27, No. 6, p. 697-705. 7. Zieliński T.P.: Digital Signal Processing: from Theory to Applications. WKŁ, Warszawa 2005 (Polish). Wpłynęło do Redakcji dnia 5 sierpnia 2009 r. Recenzent: Dr hab. inż. Andrzej Rybarczyk, prof. Pol. Poznańskiej Omówienie Sygnał EEG (elektroencefalograficzny) jest zapisem bioelektrycznej aktywności mózgu [1], [2]. Jego analiza w znacznej mierze opiera się na obserwacji zjawisk zachodzących w pewnych charakterystycznych podpasmach [6]: delta (0.3-3Hz), theta (4-7Hz), alpha (8-13Hz) i beta (14-30Hz). Każde z wymienionych podpasm odpowiada za pewne charakterystyczne stany aktywności mózgu. Na podstawie zmian sygnału w poszczególnych podpasmach można wnioskować o stanie pacjenta (pobudzenie, stan skupienia, sen, sen głęboki - tzw. faza REM), co pozwala na diagnozowanie wielu zaburzeń pracy mózgu [1]. Do rozdzielania sygnału na jego charakterystyczne podpasma można wykorzystać układy filtracji pasmowej [3], [4]. Podstawowym problemem związanym z układami filtracji pasmowej jest wprowadzanie przez nie do filtrowanych sygnałów zniekształcenia związanych z ich charakterystykami: amplitudową i fazową. W pracy [5] przedstawiono metodę redukcji zniekształceń amplitudowych w układach wielostopniowej filtracji pasmowej. Zastosowana metoda redukcji zniekształceń opiera się na wykorzystaniu wzajemnej interakcji pomiędzy poszczególnymi filtrami układu. W niniejszym artykule przedstawiono zastosowanie metody [5] do redukcji zniekształceń amplitudowych w układach wielostopniowej filtracji pasmowej sygnału EEG. Przeprowadzone badania układów filtracji opartych na wybranych filtrach NOI (IIR) wykazały spadek zniekształceń amplitudowych w zakresie od kilku do około 70 dla większości podpasm sygnału. Badania przeprowadzono z wykorzystaniem klinicznej aparatury EEG firmy Elmiko oraz pakietu Matlab. Dla kilku przebadanych przypadków wyniki były o kilkadziesiąt procent gorsze niż w układzie bez korekcji. Dodatkowo, uzyskano
Reduction of pass band 43 znaczną poprawę liniowości fazy układów (od 20 do 90). Poprawa zniekształceń amplitudowych i fazowych jest jednak okupiona kilkudziesięcioprocentowym pogorszeniem wskaźnika aliasingu międzypasmowego (tłumienności w pasmach zaporowych), a więc pogorszeniem selektywności układu. W świetle przedstawionych wyników badań można stwierdzić, że zastosowanie przedstawionej metody redukcji zniekształceń amplitudowych w układach filtracji sygnału EEG może być skuteczne (spadek zniekształceń amplitudowych i fazowych), należy jednak pamiętać, że ma ona negatywny wpływ na selektywność korygowanych układów.