|

|
|
|
|
|
EEG R&D » High Frequency EEG » 6.4
 

6.4  General Algorithm Methodology

Using the information/knowledge that we have acquired up to this point about the correlation between high frequency band activity and performance, we can construct a general algorithmic structure for an off-line tracking algorithm.  The structure detailed below is based on the actual steps taken from data collection through the initial high frequency analysis.


6.4.1  Data collection hardware overview


Figure 6.4.1
illustrates the data acquisition stage of processing.  These steps are implemented in hardware (as opposed to algorithms) and are the steps prior to data processing.  The input signal is filtered and amplified through a high gain AC EEG amplifier and subsequently digitized and stored.  The steps in this process are detailed below in Equations 6.1-6.3.




Figure 6.4.1
  Data acquisition block diagram


Acquired analog signal

          n                                                              (6.1)

Analog EEG data is collected using conventional EEG amplifiers.  The signals are obtained from standard EEG electrodes with an electrode impedance of less than 2K Ohms (as measured from the electrode to the combination of the remaining electrodes) and are considered laboratory grade impedances (clinical impedances typically run between 5-10k Ohms).


Convolution in the time-domain: anti-aliasing filtering


          n                 (6.2)
          where nthe impulse response of the filter

Lowpass and highpass filters are used prior to A/D conversion the EEG channels.  The filters used for this experiment were built into the EEG amplifiers between the amplifier stages.  Highpass filtering is used to eliminate any large DC and near-DC components which would cause the amplifiers to saturate.  Because the highpass filtering eliminates those components with the potential of saturating the EEG amplifiers, higher amplifier settings can be used to increase the amplitude of the measured signal and improve the A/D process.  Lowpass filters are used strictly as anti-aliasing devices.  Although the lowpass filters used in this experiment had a very shallow cutoff, sharper cutoff filters (such as the commonly available 6th-order Butterworth switched capacitor filters) are preferred.  The standard EEG filters are adequate and all of the analysis in this study is based on output from these filters.


Sampling the signal

          n                            (6.3a)
          with  n


Conversion to finite word length


Given real-valued voltage n in the range of n (peak-to-peak voltage span of the input signal), the twos complement representation can be described as:

            n                      (6.3b)
            where B = number of conversion bits

The resolution of the quantization process (quantization step size) is:

            n                                                        (6.3c)

The input voltages (sampled signal) is rounded to the nearest integer multiple of q using (6.3c).

After highpass and lowpass filtering the EEG signals are sampled and converted to finite word length (digitized).  For the experiments summarized in this document, the analog signals were sampled at 950Hz (nearly 10-times the conventional EEG sampling rate) and quantized with 12-bit resolution.



6.4.2  Drowsiness tracking algorithm

After sampling and quantization, the EEG signals are ready to be processed by the drowsiness tracking algorithm.  Figure 6.4.2 illustrates the steps involved in converting the EEG signal to a drowsiness measure using the windowed FFT for frequency analysis.  Certainly the windowed FFT could be replaced by time-domain filters, matched wavelet filters, etc. which can be used in a real-time implementation of the algorithm to replace the need for an FFT.  The computational steps are detailed in Equations 6.4-6.10.




Figure 6.4.2
  Drowsiness tracking algorithm block diagram


Re-scale data for processing

            n                                  (6.4)
            where B = number of conversion bits
            amplification = amplification used when the segment of data was recorded

The digitized data is re-scaled to micro-volts using (6.4).  If several different amplifications were used on the data segment, the data is broken up appropriately and operated upon in contiguous units.  The data is then re-combined and is now ready for processing by the measure.


Create overlapping time bins


            n                                                       (6.5a)
            n                                           (6.5b)
            n
            n                                (6.5c)

            L = bin length
            r = bin overlap
            m = number of time bins

The selected channel of EEG data is windowed from the data stream by a rectangular windowing function to create smaller, (overlapping) temporal bins.



Windowed Fourier Transform of each time bin


            n               (6.6a)
            withn                                   (6.6b)
            for i = 0, 1, 2, ...

The small data segments are multiplied by a standard windowing function (Hanning, Hamming, Blackman, etc.) and transformed into the frequency domain with an N-point DFT.  The output is then sampled using (6.6b) into discrete frequencies.  Windowing the data is necessary before taking the Fourier transform because the signal is nonstationary.  The implementation of the algorithm observed here uses a Hanning window with spectral decomposition via a double-precision FFT algorithm.


Power spectral density


            n                                                        (6.7)

The Power Spectral Density (PSD) is the amount of power in the signal at each frequency point.


Filter compensation and noise removal (frequency domain)


            n                        (6.8)
            with  n
            and   n

The objective is to eliminate 60hz and additive odd-harmonics (60, 180, 300, ...) that are introduced into the signal as electrical noise and also compensate for the attenuation introduced by the anti-aliasing lowpass filters.  This is accomplished using custom non-causal non-unity-gain filters applied to the frequency domain data.


Compute total energy in pre-selected spectral bins

            n                                   (6.9a)
            n                                  (6.9b)
            n
            n                               (6.9c)

            M = number of spectral bins
            fi = indices associated with frequency range in the ith bin
            ci = integration term for ith bin

Portions of the power spectrum are grouped according to pre-selected frequency bands, energy in the frequency bands are computed, and the resulting energy bands are inverted.


Output Measure


           n                                                      (6.10)
            Wp = weighting functions
            M = number of spectral bins

The energy related measures for each frequency bin are combined to form the output measure.  In the current implementation of the measure, a linear weighted average of the individual bins uses a set of scalar values Wp and the output of the measure is given by (6.10).

This completes the essential signal processing steps involved in implementing the algorithm and computing the measure, some explanation as to the meaning of each step are given next.   If we follow the steps in the equations, we see that (6.1-6.2) are implemented at the EEG amplification stage, (6.3) during data acquisition, (6.4) is data rescaling, (6.5-6.7) describe the spectrogram operation, (6.8) is the non-causal filtering stage, and (6.9-6.10) create the output measure.  At the output stage, a logical device of some type can use the measure for signaling an alert at the appropriate time using either an on/off alarm that signals that the measure has reached a given value (threshold), or an incremental alarm whose intensity is proportional the output magnitude of the measure relative to values that correlate with certain desirable or undesirable behaviors.

 

Copyright © 2010 Consolidated Research of Richmond, Inc. All rights reserved.