Filtering of neurophysiologic signals

Filtering of neurophysiologic signals

Handbook of Clinical Neurology, Vol. 160 (3rd series) Clinical Neurophysiology: Basis and Technical Aspects K.H. Levin and P. Chauvel, Editors https:/...

4MB Sizes 0 Downloads 105 Views

Handbook of Clinical Neurology, Vol. 160 (3rd series) Clinical Neurophysiology: Basis and Technical Aspects K.H. Levin and P. Chauvel, Editors https://doi.org/10.1016/B978-0-444-64032-1.00004-7 Copyright © 2019 Elsevier B.V. All rights reserved

Chapter 4

Filtering of neurophysiologic signals RICHARD C. BURGESS* Department of Neurology, Cleveland Clinic Foundation, Cleveland, OH, United States

Abstract Clinical neurophysiologic signals cover a broad range of frequencies. Filters help to emphasize waveforms that are of clinical or research interest and to mold their frequency characteristics to suit the purpose of the investigation. Some frequency content is obvious and well known, such as the alpha rhythm (8–11 Hz) or spindles (12–14 Hz) in the EEG. Other frequencies are not initially discriminable from background activity and require filtering in order to examine them, such as high-frequency oscillations (80–500 Hz) in EEG and brainstem auditory evoked potentials (100–3000Hz). Often used to mitigate the effects of background noise or artifact, filters can be used specifically to attenuate unwanted frequencies, such as mains interference (50 or 60Hz) and electrode offset potential (<0.1 Hz). For digital instrumentation, an antialiasing filter (below Nyquist) is always needed prior to sampling by the analog-to-digital converter. Once the signals are in the digital realm, sophisticated filtering operations can be carried out post hoc; but in order not to be misled, the neurophysiologist must always bear in mind the effect of filtering on the physiological waveform.

INTRODUCTION The clinical neurophysiologist examines waveforms from the central or peripheral nervous system, whether normal or pathologic, to make a diagnosis or develop a therapeutic plan. Before the minute signals emanating from neurons and muscles can be employed for any diagnostically useful purpose, they must be “conditioned,” i.e., electronically manipulated so that they can be viewed, analyzed, and interpreted. The most fundamental signal conditioning operation is filtering. In order to focus attention on the important features of the waveform, we attempt to screen out or attenuate the other ongoing activity that is unimportant to the waveform of interest. The major components of EEG instrumentation (see Chapter 3) are schematically illustrated in Fig. 4.1. This chapter details filtering, with examples applied principally in electroencephalography. Every physiologic signal consists of a variety of frequency components. Depending on the purpose of the recording or monitoring, only a relatively restricted band of the frequency components is relevant to the diagnostic question under study. For example, to the cardiologist, the EMG is unwanted “noise,” while to the

electroencephalographer, the EKG is noise. Some of the undesirable noise and artifacts have frequency components that are predominantly in a band different from the desired signal. The process of filtering allows us to separate signals on the basis of their frequency, attenuating (reducing in amplitude) the unwanted frequency components and/or emphasizing the components that are important to us, as illustrated in the top portion of Fig. 4.2. Filtering is exactly what is done for us by our radio tuner, separating the stations on the basis of their frequency, so that we hear the station at 104.1 MHz, but not the adjacent one at 104.5 MHz. In clinical neurophysiology there tends to be considerable overlap in frequency between the signals of interest and unwanted noise signals, as depicted at the bottom of Fig. 4.2. Nevertheless, considerable “cleaning up” of the signal can be accomplished by screening out the frequencies that are irrelevant to our neurophysiologic study and that would otherwise corrupt the desired signal. Importantly, however, because there is often at least some overlap of these frequencies, filtering unfortunately removes—at least partially—some of the signals of interest.

*Correspondence to: Richard C. Burgess, M.D., Ph.D., Department of Neurology, The Cleveland Clinic Foundation, 9500 Euclid Avenue, Cleveland, OH 44195, United States. Tel: +1-216-444-7008, Email: [email protected]

52

R.C. BURGESS

Fig. 4.1. Neurophysiologic recording systems sense signals from the body (EEG, EMG, EP, etc.) through metallic electrodes applied either to the skin or inserted into active tissue. The microvolt level signals are made larger by amplifiers, then fed to high-pass filters to eliminate baseline wander and to low-pass filters to remove high-frequency artifacts like muscle noise. To assure that the system is properly representing the input signals, the capability to switch a known calibration signal into the circuit in place of the physiologic signal is provided. From Levin KH, Luders HO (2000). Comprehensive clinical neurophysiology, Saunders WB.

Fig. 4.2. Filtering is an effective means to remove artifact when the signal of interest and the interfering signals are in different frequency ranges. However, the signal of interest and the signals to be excluded do not always occupy separable portions of the frequency spectrum. From Levin KH, Luders HO (2000). Comprehensive clinical neurophysiology, Saunders WB.

SIGNAL PROCESSING, FILTERS, AND NOISE For the output signal of a neurophysiologic acquisition system to be a faithful representation of the input signal, it must pass with an equal gain factor all the frequencies

that are presented to its input, within the “meaningful bandwidth,” otherwise distortion will occur. This meaningful bandwidth differs for the particular signal under study. Excessive bandwidth, however, is also to be avoided. For example, the direct-current (DC) component

FILTERING OF NEUROPHYSIOLOGIC SIGNALS is generally not diagnostically useful in neurophysiology, and amplifying it to the same degree as the alternatingcurrent (AC) component would in most cases only lead to saturation. In addition to adequate bandwidth, all the frequency components that are passed by the filter must be shifted by a constant time delay—the definition of phase linearity. Filtering is the most basic signal-processing tool, designed to make the waveform of interest stand out from the background. Filters are circuits or transformation processes with a deliberately nonuniform transfer function with respect to frequency; that is, the gain (or loss) varies with the frequency of the signal applied to the input of the filter. The transfer function is the ratio of the output to the input, expressed in relation to the frequency spectrum. Filtering is used in general to (1) reduce external interference, (2) eliminate large amplitude out-of-band signals that would otherwise block subsequent amplification stages, (3) remove baseline offset, (4) limit the frequency range under study or modify the frequency domain properties of the signal, (5) prevent aliasing during analog-todigital conversion, and (6) smooth the results of a processed waveform, such as an ensemble average. High-quality electrode contact is the foremost prerequisite for high-quality recording. However, the old adage applied to computers, “garbage in, garbage out,” applies to filters as well. No amount of filtering, artifact rejection, or other signal conditioning can make up for poor-quality electrode contact. Noise is defined as any unwanted or extraneous signal, i.e., any disturbance that interferes with the information in the signal under study (Brittenham, 1974). Noise currents are introduced into recording instrumentation by (1) capacitive coupling from external electric fields, (2) induction of an electric current into a conductive loop by an external magnetic field, or (3) artifacts generated within the body or at the interface of the transducer to the body. Some unwanted interference is inevitable, and filters are often used to mitigate the effects of noise.

FILTER OUTPUT VS INPUT LEVELS Filter attenuation is measured by means of an engineering unit called a decibel (named in honor of the inventor of the telephone, Alexander Graham Bell), abbreviated dB. A dB is defined as 20 times the log of the ratio of the output signal/input signal. Therefore, for example, a difference of 20 dB between two signals represents an amplitude ratio of 10:1; while a difference of 6 dB represents a ratio of 2:1. Ratios of less than 1, e.g., 1:10 or 1:2, are expressed as negative dB, since fractions have a negative logarithm. A few typical gain ratios along with their associated dB values are shown in Table 4.1.

53

Table 4.1 Gain or loss in decibels Amplitude ratio

Decibels (dB)

0.10 0.50 0.71 1.0 10 100 1000 10,000

20 6 3 0 20 40 60 80

Because the amplitude ratios of the frequencies that are passed through the filter vs those that are blocked can be very large, these ratios are conveniently measured using the logarithmic scale of decibels.

FILTER TYPES Most filters are designed to favor, or pass, signals in some frequency band, while markedly attenuating, or rejecting, signals in all others (Gussow, 1983). Filters are ordinarily divided into four categories, as shown in Fig. 4.3, based on the band of frequencies that they pass, i.e., allow through unchanged, or the band of frequencies that they stop, i.e., attenuate to acceptably low levels:

Low-pass filter A filter allowing frequencies from zero, or DC, up to the cutoff frequency to pass through unimpeded, but attenuating all frequencies above the cutoff frequency (Fig. 4.4).

High-pass filter A filter allowing all frequencies above the cutoff frequency to pass through unimpeded, but attenuating all frequencies below the cutoff frequency. Baseline offset (i.e., a DC potential present in the signal), as well as very slowly varying (i.e., close to DC) artifacts (such as the sweat artifact illustrated in Fig. 4.5) can be removed using this type of filter (Fig. 4.6).

Band-pass filter A filter allowing all frequencies in the passband between the low cutoff frequency and the high cutoff frequency to pass through unimpeded, but attenuating all frequencies above and below the passband.

Band-stop filter A filter attenuating all frequencies within a (usually narrow) stopband but allowing all the other frequencies to

54

R.C. BURGESS

Fig. 4.3. Filtering consists of taking an input signal, X, and modifying its frequency domain properties according to the transfer function, H, to produce an output function, Y, schematized in the top diagram. Idealized frequency domain representations of the four major types of filter transfer functions are shown. For each of these, the vertical axis shows the relative proportion (H) of the input X that can be seen at the output Y, as frequency (f ) changes along the horizontal axis. From Levin KH, Luders HO (2000). Comprehensive clinical neurophysiology, Saunders WB.

Fig. 4.4. At higher frequencies, the capacitor shown in the circuit becomes a better conductor, shunting some of the signal to ground. Selection of one of the three frequency cutoffs shown in the graph is done by selecting one of the resistors to change the RC time constant. In this example R1 > R2 > R3. When the product of R times C is greater, the frequency cutoff (as measured by the 73%, or 3 dB, point) is lower. From Levin KH, Luders HO (2000). Comprehensive clinical neurophysiology, Saunders WB.

FILTERING OF NEUROPHYSIOLOGIC SIGNALS

55

Fp1-F7 F7-T7 T7-P7 P7-O1 Fp2-F8 F8-T8 T8-P8 P8-O2 Fp1-F3 F3-C3 C3-P3 P3-O1 Fp2-F4 F4-C4 C4-P4 P4-O2 Fz-Cz Cz-Pz

Fig. 4.5. Electrode Fp2 is exhibiting considerable drift over the 10 s shown on this page. This type of artifact can be reduced or eliminated by high-pass filtering.

Fig. 4.6. In the case of the high-pass filter, the better conductivity of the capacitor at higher frequencies allows more of the signal through to the output, resulting in the output amplitude vs frequency graph shown at the top. As in Fig. 4.10, R1 > R2 > R3. The 3 dB cutoff frequency is lower for a larger RC product. From Levin KH, Luders HO (2000). Comprehensive clinical neurophysiology, Saunders WB.

56

R.C. BURGESS

pass through unimpeded. This kind of filter, called a notch filter when the stopband is very narrow, is most often used to eliminate interference from the 50 or 60-Hz power mains. Because of the relationship of the type of cutoff frequency to the type of filter, as well as the use of the words pass and stop, the nomenclature can be confusing. Since a low-pass filter allows frequencies through up to a certain point, it has a high cutoff frequency, and likewise a high-pass filter has a low cutoff frequency. In common parlance then, low-pass filters are therefore sometimes referred to as high-frequency filters and high-pass filters as low-frequency filters. And because they take a chunk of frequencies somewhere out of the middle of the frequency range of interest (such as 60 Hz), band-stop filters are frequently called notch filters. Filter terminology is further confused by the tendency of some manufacturers to utilize terms such as high linear filter and low linear filter. These terms originate from a description of the differential equation that expresses the behavior of the filter, and correspondingly the amplitude vs log frequency curve that on a semilog plot is a series of straight lines connected by curved transitional regions. Typical neurophysiologic instrumentation filters are tunable, meaning that the cutoff frequencies can be adjusted by the operator (or under computer control) to optimally reject the unwanted frequencies, illustrated as three different cutoff frequencies in Figs. 4.4 and 4.6. Fixed frequency filters also have a place, such as antialiasing filters and 60-Hz notch filters. Note that although the frequency cutoff may be controlled for all of the channels together, separate filters (like separate amplifiers) are required for each channel. Filters can be

constructed as analog filters or as digital filters. Analog filters accept as their input a continuous voltage vs time and produce at their output a continuous waveform as well. These are the conventional electronic filters that have always been present in neurophysiology instrumentation. Digital filters, on the other hand, operate on discrete samples of the waveform, and so require digitization of the data by an analog-to-digital converter before the filtering operation (see Fig. 4.7). Digital filtering is ordinarily carried out by computers, and therefore may not produce an output except to a computer monitor screen. However, the output of a digital filter can be transformed back into an analog voltage by a digital-to-analog converter (shown in the lower right of Fig. 4.7), thus mimicking an analog filter. The effect on a typical EEG signal of progressive decreases in the cutoff frequency of an adjustable low-pass filter is shown in Fig. 4.8. The theoretically perfect filter, allowing passage of the desired frequencies without any alteration or distortion and completely rejecting all frequencies outside the desired range, does not exist in either the analog or the digital world (see Fig. 4.9). This ideal filter would have a constant gain of exactly one (unity) throughout the passband, then abruptly drop off vertically to a gain of zero outside the passband. A practical filter, i.e., one that can be actually implemented and used, has a gain of approximately one in the passband but with some variation, especially as the cutoff frequency is approached. Around the region of the cutoff frequency is the transition band, where the filter changes from a device freely passing signal to one attenuating signal. This gain transition certainly does not occur abruptly but rather deviates from the ideal vertical dropoff with a characteristic rolloff,

Fig. 4.7. Digital filters require two additional components: one to transform the analog signal into digital samples, and one to transform the digitally filtered data back into a continuous time domain signal. The characteristics of the filter are determined by the weighting coefficients and whether those coefficients are applied only to the raw input data, or recursively to the output data as well. From Levin KH, Luders HO (2000). Comprehensive clinical neurophysiology, Saunders WB.

FILTERING OF NEUROPHYSIOLOGIC SIGNALS

Fig. 4.8. See legend on next page.

57

58

R.C. BURGESS

wc

wc

w

w

Fig. 4.9. The “ideal” low-pass filter passes all frequencies up to the cutoff frequency (oc) without change and eliminates all higher frequencies. A practical, realizable filter exhibits variability in both the passband and the stopband, with a transition in between.

or downward slope. This transition band has a finite width in the frequency domain, and the gain does not necessarily vary smoothly in this range, therefore affecting the different frequencies in the transition band in different ways. In the stopband, where ideally the frequencies attenuate to zero, instead a certain percentage of the original signal still gets through. In addition, depending on the design of the filter, the reduction in the signal amplitude may not progress monotonically as we get further into the stopband (i.e., it exhibits “ripple”). Since the ideal filter with flat response, infinite attenuation, and linear phase is simply not mathematically and physically realizable, compromises (usually under the control of the filter designer and not the operator) are required. Selection of the proper filter properties is a multidimensional trade-off involving cutoff frequency, steepness of the roll-off, variation in the passband, attenuation in the stopband, and phase distortion. Several different filter types and roll-offs are shown in Fig. 4.10.

Basic hardware for filtering is accomplished through the use of combinations of resistors and capacitors, i.e., the RC networks seen in Figs. 4.4 and 4.6, which rely on the fact that capacitors exhibit a decreasing opposition to the flow of electrons at higher frequencies. Capacitors can be modeled as an open circuit at or near DC, and as a short circuit at high frequency. Analog filters are either active or passive depending on whether they are composed of only inactive components such as resistors, capacitors, and inductors; or they are composed of devices requiring external power such as transistors and op-amps. Significant performance advantages usually accrue through the use of active filters, and because neurophysiology instrumentation always incorporates amplifiers (which are active components), it is generally a simple matter for the manufacturer to make the filters active. Active filters are readily combined in functional blocks to build combinations of low-pass, high-pass, and notch filters. For narrow-band filters, the steepness

Fig. 4.8 An EEG signal containing both low frequencies (the eye movements on the left side of the tracing) and high frequencies (the muscle artifact toward the right side) illustrates the effect of various degrees of low-pass filtering on a real signal. The original signal, recorded with an upper frequency cutoff of 100 Hz, is shown at the top. Successive traces illustrate the effect of lowering the cutoff frequency to 30 and 6 Hz. At the lowest cutoff, the EMG activity has been completely attenuated, but the eye movements remain. From Levin KH, Luders HO (2000). Comprehensive clinical neurophysiology, Saunders WB.

FILTERING OF NEUROPHYSIOLOGIC SIGNALS

59

Fig. 4.10. The design of the filter (both number of poles and filter family type) determines the deviation from ideal in terms of overshoot and phase delay. The bottom panel shows increasingly steep roll-off with greater number of filter poles. The top panel shows how faster roll-off can be achieved at the expense of ripple in the passband by choosing a Chebyshev type filter. From Levin KH, Luders HO (2000). Comprehensive clinical neurophysiology, Saunders WB.

of the roll-off, i.e., the degree to which the immediately adjacent frequencies are affected, is expressed by an engineering quantity, the Q. Hence, high-Q 60-Hz notch filters have a very deep notch and little attenuation of the frequencies on either side of 60 Hz. A conventional notch filter constructed from a passive twin-T network of resistors and capacitors has a Q of approximately 0.3, so that much of the important signal will be distorted in the process of eliminating the mains interference. By adding an active component (an op-amp voltage follower), the Q can be easily raised to 50 or more.

PHASE SHIFT All filters exhibit some delay between the components of the signal seen at the input and the filtered versions of the same components seen at the output of the filter. It is possible using digital filters to correct for this delay, i.e., to make it zero (Green et al., 1986), since the computer has access to the data both before and after the point undergoing analysis. Generally speaking, the delay is proportional to the complexity of the filter. A delay time can be thought of as a proportion of one cycle of a sine frequency, i.e., the phase shift (see illustration in Fig. 4.11). If the delay is constant irrespective of the frequency, then the phase shift will be exactly proportional to frequency, called a linear phase characteristic. Filters with a nonlinear characteristic will cause different components of the signal to be delayed by various amounts of time, causing distortion of the resulting output signal, such that there will be alterations in the relative phase of the components. Phase shift

Fig. 4.11. Phase distortion causes a relative time delay between components of different frequencies (e.g., the high-frequency spike and the lower-frequency wave of a 3-per-second absence discharge, or the high-frequency early components and the lower-frequency later components of an evoked potential). From Levin KH, Luders HO (2000). Comprehensive clinical neurophysiology, Saunders WB.

distortion is the effect of time shifting different frequency components by different amounts (Seaba, 1975). For example, in some circumstances, it is possible to shift

60

R.C. BURGESS

the spike component (high frequency) of a spike-and-wave complex from between two waves (low frequency) into the center of the wave component. Shifting of the apparent time location of an evoked potential peak due to filtering (Desmedt et al., 1974) can make a normal EP latency appear abnormal, or vice versa. Phase shift is ordinarily worst near the filter’s cutoff frequency. As stated previously, the cutoff frequency is not actually a sharp cutoff, but rather marks the transition from a horizontal gain characteristic to a steep roll-off. Even though it does not represent a highly distinct demarcation between passband and stopband, the cutoff frequency is measured exactly, using a mathematical definition. The cutoff frequency is that frequency where the amplitude of the signal is 3 dB down from the amplitude of the signal in the passband. Several filters, all with the same 3-dB point, are shown in Fig. 4.10. If the output of the filter is 1.0 in the passband, then the 3-dB point corresponds to the frequency where the signal is reduced to 0.71. Of note, the cutoff frequency of some digital filters is specified by a slightly different method. Some manufacturers do not use the standard 30% down point for characterizing their filters; rather, they indicate their filter cutoffs by the point that is 20% down. It is also possible to represent the frequency cutoffs by means of the time constant defined by the equation T ¼ 1/2pF. Time constant is most often used for characterization of the low-frequency cutoff because it corresponds to the time in seconds for a step input (such as an artifact or calibration signal) to decay by a factor of 0.37 (i.e., 1  e, the natural log base), illustrated in Fig. 4.12. It can be calculated from the product of resistance and capacitance used to build a simple passive filter, T ¼ RC. Although characterizing filters using

measures such as the time constant, 20% attenuation, 50% attenuation, etc., are theoretically valid methods, it is more sensible to adhere to the standard engineering definitions.

FILTER ORDER The steepness of the roll-off outside the passband is governed by the “order” of the filter (related to the number of “poles” the filter has). As the number of poles gets larger, the transition band gets narrower and the roll-off gets steeper (as shown in the lower part of Fig. 4.10), approaching the amplitude response of the ideal filter. The slope of the roll-off is logarithmic (one of the reasons we measure using dB). Table 4.2 takes a simple example of a two-pole high-pass filter with a cutoff of 1.0 Hz and shows the signal amplitude values as we proceed down by octaves below the cutoff frequency. Unfortunately, the number of poles cannot be increased indefinitely, irrespective of the number of components and complexity of the calculation needed. Very high-order filters have such excessive phase shift that they tend to exhibit unstable behavior, manifesting as ringing (brief resonation occurring in response to rapid input transients, then dampening out) or oscillation (undampened resonance building up and persisting). Oscillation at the output of an unstable filter is shown in Fig. 4.13 (applied to the same signal as in Fig. 4.8). In the case of digital filters, high-order filters also take longer to produce an output. At a cutoff frequency close to zero or Nyquist (the top end), more poles actually increase the width of the transition band.

FILTER CHARACTERISTIC In addition to the type of filter, cutoff frequency, and rolloff, the filter characteristic, or transfer function, is an important attribute. There are various common filter transfer functions, some seen in the upper portion of Fig. 4.10. The Butterworth filter is maximally flat in the passband, allowing all frequencies in the passband through without Table 4.2 High-pass filter frequency response

Fig. 4.12. Time constant is measured as the time that it takes for a sudden impulse to decay from 100% of its value down to 37%. The time constant t is inversely proportional to the frequency cutoff f. From Levin KH, Luders HO (2000). Comprehensive clinical neurophysiology, Saunders WB.

Frequency (Hz)

Attenuation

Amplitude remaining (%)

1.0 0.5 0.25 0.125 Etc.

3 dB point 12 dB 24 dB 36 dB

70 25 6.3 1.5

FILTERING OF NEUROPHYSIOLOGIC SIGNALS

61

Fig. 4.13. The same signal used in Fig. 4.13 has been applied to a very high-order filter. As the filter is activated by the higherfrequency EMG activity, it begins to oscillate, generating a false output. From Levin KH, Luders HO (2000). Comprehensive clinical neurophysiology, Saunders WB.

any change in amplitude (variation in amplitude is termed ripple), but it produces overshoot in response to a rapid input transient. Choosing a Chebyshev, inverted Chebyshev, or elliptical filter permits a sharper transition without increasing the number of poles. The Chebyshev filter characteristic has a controllable equiripple passband; in other words, the amount of variation of the frequencies can be kept equal throughout the passband and can be minimized to an acceptable level, and the Chebyshev has a rolloff faster than that of the Butterworth. The elliptic filter falls off faster than any other filter but cannot infinitely attenuate signals at the extreme of the stopband because of ripple in the stopband. The trade-offs between transition bandwidth and ripple are summarized in Table 4.3. There are other filter characteristics that minimize phase distortion and eliminate overshoot, such as the Bessel, Gaussian, and Paynter filters. Design parameters that change filter characteristics are illustrated in Fig. 4.14. It is always important to bear in mind the effects of filtering. Careless or habitual use of filters may produce unanticipated results. For example, the activity in the upper panel of Fig. 4.15 might at first glance be mistaken for asymmetric brain activity.

Table 4.3 Filter characteristics Filter characteristic Chebyshev Inverted Chebyshev

Sharpness

Trade-offs

Decreases transition region Decreases transition region

Introduces ripple into the passband Introduces ripple into the stopband (leakage) Introduces ripple into both passband and stopband Good phase response, eliminates ringing and overshoot

Eliptical

Sharpest transition region

Bessel

Gradual roll-off

DIGITAL FILTERING The inclusion of microprocessors and computers as fundamental components of clinical neurophysiologic instruments has dramatically altered their capabilities

62

R.C. BURGESS

Fig. 4.14. Transition bands (Df), as well as the passbands and stopbands of complex filters, exhibit nonlinear characteristics. The design of the filter is a trade-off between passband ripple (d1), roll-off, and stopband attenuation. From Levin KH, Luders HO (2000). Comprehensive clinical neurophysiology, Saunders WB.

and degree of flexibility. In digital EEG machines (Barlow, 1979) the output of the amplifiers, instead of simply being displayed on a scope (or moving paper), is fed directly to an analog-to-digital converter that changes the analog waveform into a series of ones and zeroes easily manipulated by a computer. The process is the same as that employed to encode music onto a compact disc and, if done correctly, conveys all the information present in the original analog recording. Analog-to-digital conversion of the raw, amplified signal is done by sampling, a process of measuring the amplitude of the continuous signal at regular intervals, and converting each sample into a digital value. Selection of the appropriate sampling rate is based on considerations of the frequency content of the neurophysiologic signal and the data volume capabilities of the computer system. Sampling at points too closely spaced will not only result in excessive quantities of digital data, but will also yield correlated and redundant data. On the other hand, insufficiently frequent samples of the EEG will lead to the condition known as aliasing, wherein highfrequency and low-frequency components of the signal become confused, producing distortion. Although Shannon’s sampling theorem dictates that the sampling frequency must be at least twice the frequency of the fastest component in the original data (the Nyquist frequency), practical systems employing realistic antialiasing filters should sample at three or four times the Nyquist frequency (Bendat and Piersol, 1971). In typical EEG applications, low-pass filtering prior to digitization is done at 70 Hz, and analog-to-digital conversion is

carried out at 200 Hz. Once the data have been digitized, they can be further conditioned—just like analog data— but with more flexibility. In particular, post hoc digital filtering can be accomplished. Averaging (see Chapter 3) is one of the simplest forms of a digital filter. Typically used in eliciting evoked potentials from a high-noise background, it assumes that the signal of interest is a more or less invariant response to a stimulus, providing us with a time function bearing the same relationship to the time of each stimulus. The noise, on the other hand, is assumed to be random, i.e., not time-locked to the stimulus, and therefore cancels out as N (the number of trials summed to produce the average) approaches infinity. It can be shown that the improvement in signal-to-noise ratio is proportional to the square root of N. Digital filters carry out a form of averaging on adjacent data points. Digital filtering is roughly akin to a sliding average, but with specific components chosen to effect the desired waveshaping. The number of points included in the weighted average determines the number of “taps” of the filter. Specification of the weighting (a multiplier or coefficient) applied to each tap determines how various frequencies are emphasized or deemphasized. Digital filters are constructed using simple operators: delays, multiplies, and adds, according to the general filter equation (following). Digital filters offer: (1) sharper roll-offs, (2) linear or zero phase, (3) no necessity for calibration, (4) perfect stability with time or temperature, (5) independence from power supply variations or component value tolerances, and (6) the facility for adaptation to the data since the parameters are controlled in software (Macabee et al., 1986). General Filter Equation N 1 M X X að jÞxðn  jÞ bðk Þyðn  k Þ yðnÞ ¼ j0

k1

Feed Forward

Feedback

Digital filters are implemented in one of two ways: FIR and IIR. Finite impulse response filters (FIRs) are so named because an impulse fed into an FIR generates no more nonzero terms than the order of the filter. The feedback term of the infinite impulse response, or IIR, filter introduces some measure of phase shift distortion and therefore has the potential for infinite ringing when forced by an impulse. All digital filters introduce some amount of time shifting of a processed signal. It is possible to design a class of FIR filters that is phase-shift distortionless. However, the disadvantage of FIR filters is that they are not as efficient as the IIR filters and hence take longer to process the signals. Digital filters do not depend on the limitations of hardware devices, as analog filters do, but in practice are limited nonetheless because of software word-length restrictions.

FILTERING OF NEUROPHYSIOLOGIC SIGNALS

63

Fig. 4.15. The hazards of filter overuse. The EEG in the upper panel appears to show an excessive amount of beta activity, maximum in the left temporal region. This EEG was low-pass filtered with a frequency cutoff of 15 Hz. In the lower panel, which shows the EEG before filtering, it is clear that the “beta activity” is simply the creation of low-passed EMG.

FIR filters: (1) have linear phase because of constant delay, (2) do not accumulate round-off error because every output is a function of only N multiplications and accumulations, (3) are implemented using design by windows, or through CAD employing the Remez iteration. IIR filters: (1) are inherently unstable and can also oscillate as a result of round-off errors, (2) are not linear phase, but can be made fairly linear within the passband, (3) require far fewer coefficients than the FIR for the same filter performance, (4) can be implemented by the methods of invariant transformation, bilinear transformation, or using CAD via chains or biquads. Table 4.4 contrasts the critical properties of FIR and IIR filters.

Table 4.4 Digital filter design trade-offs FIR filter properties

IIR filter properties

Always stable Can have linear phase Can be adaptive Low round-off noise

Potentially unstable Nonlinear phase Feedback More efficient than FIR filters Subtle design issues

Easy to understand, design, and implement

FIR, finite impulse response; IIR, infinite impulse response.

64

R.C. BURGESS

Where all of the data are available for retrospective refiltering (e.g., after an evoked potential sweep), adaptive techniques such as Weiner filtering, Kalman filtering, and other time-varying filtering techniques may provide even better performance. These techniques are extensions of standard digital filtering methods modified by a priori knowledge of the expected waveform’s signal components. Digital filtering can provide a continuous output, albeit delayed by a few sampling intervals, and can be used to provide alteration of the frequencydomain characteristics of a signal in a controllable way.

WIDEBAND EEG Research has shown that useful information may be missed by our conventional EEG filtering. Flexibility in filter applications has enabled the exploration of nontraditional frequency ranges. Most of the conventional frequency bands for routine tests were established before the advent of digital instrumentation. For example, the ordinary 0.5–70-Hz range for EEG was established when results could only be viewed on paper. Over recent decades there has been considerable interest in wideband recording, for example, high-frequency oscillations (or HFOs) and infraslow activity (or ISA). These HFOs (Rampp and Stefan, 2006; Jacobs et al., 2012; Worrell et al., 2012; Zijlmans et al., 2012; Staba et al., 2014) have been divided into ripples (80–250Hz) and “fast ripples” (250–500Hz). While their pathophysiologic importance is still not clear, study of these faster rhythms requires extending the filter low-pass cutoffs to 500Hz and beyond (naturally accompanied by an increase in the sampling frequency). The most thorough investigation of HFOs has been via intracranial electrodes, but HFOs can be recorded noninvasively with scalp EEG (AndradeValenca et al., 2011) and MEG (Xiang et al., 2009; Rampp et al., 2010). It is very important to remember that any abrupt signal transition (such as an epileptic spike, a step change, a discontinuity) contains significant high-frequency energy. This broadband activity may be misinterpreted as an HFO if the principles of filtering are not kept clearly in mind (Urrestarazu et al., 2007; Benar et al., 2010). Investigation of very low-frequency (near DC or 0 Hz) has a somewhat longer history (Chatrian et al., 1968; Ikeda et al., 1996; Rodin et al., 2009; Modur et al., 2012; Shih et al., 2012; Thompson et al., 2016) but it also requires instrumentation that not only can extend the high-pass cutoff downward, but is designed from the sensors through to the display to eliminate contributions from other lowfrequency sources (such as electrode offset potential, sweat artifact, respiratory variation). Investigations of whether wideband EEG can better define the epileptogenic zone have encompassed both ends of the extended frequency spectrum (Imamura et al., 2011; Kanazawa et al., 2015).

REFERENCES Andrade-Valenca LP, Dubeau F, Mari F et al. (2011). Interictal scalp fast oscillations as a marker of the seizure onset zone. Neurology 77: 524–531. Barlow JS (1979). Computerized clinical electroencephalography in perspective. IEEE Trans Biomed Eng BME-26: 377–391. Benar CG, Chauvie`re L, Bartolomei F et al. (2010). Pitfalls of high-pass filtering for detecting epileptic oscillations: a technical note on “false” ripples. Clin Neurophysiol 121: 301–310. Bendat JS, Piersol AG (1971). Random data: analysis and measurement procedures, John Wiley and Sons, Inc, NY. Brittenham D (1974). Recognition and reduction of physiological artifacts. Am J EEG Technol 14: 158–165. Chatrian GE, Somasundaram M, Tassinari CA (1968). DC changes recorded transcranially during “typical” three per second spike and wave discharges in man. Epilepsia 9: 185–209. Desmedt JE, Brunko E, Debecke J et al. (1974). The system bandpass required to avoid distortion of early components when averaging somatosensory evoked potentials. Electroencephalogr Clin Neurophysiol 37: 407–410. Green JV, Nelson AV, Michael D (1986). Digital zero-phaseshift filtering of short latency somatosensory evoked potentials. Electroencephalogr Clin Neurophysiol 63: 384–388. Gussow M (1983). Schaum’s outline of theory and problems of basic electricity, McGraw Hill, New York, pp. 243–249. Ikeda A, Terada K, Mikuni N et al. (1996). Subdural recording of ictal DC shifts in neocortical seizures in humans. Epilepsia 37: 662–674. Imamura H, Matsumoto R, Inouchi M et al. (2011). Ictal wideband ECoG: direct comparison between ictal slow shifts and high frequency oscillations. Clin Neurophysiol 122: 1500–1504. Jacobs J, Staba R, Asano E et al. (2012). High-frequency oscillations (HFOs) in clinical epilepsy. Prog Neurobiol 98: 302–315. Kanazawa K, Matsumoto R, Imamura H et al. (2015). Intracranially-recorded ictal direct current shifts may precede high frequency oscillations in human epilepsy. Clin Neurophysiol 126 (1): 47–59. Macabee P, Hassan N, Cracco R et al. (1986). Short latency somatosensory and spinal evoked potentials: power spectra and comparison between high pass analog and digital filter. Electroencephalogr Clin Neurophysiol 65: 177–187. Modur PN, Vitaz TW, Zhang S (2012). Seizure localization using broadband EEG: comparison of conventional frequency activity, high-frequency oscillations, and infraslow activity. J Clin Neurophysiol 29: 309–319. Rampp S, Stefan H (2006). Fast activity as a surrogate marker of epileptic network function? Clin Neurophysiol 117: 2111–2117. Rampp S, Kaltenh€auser M, Weigel D et al. (2010). MEG correlates of epileptic high gamma oscillations in invasive EEG. Epilepsia 51 (8): 1638–1642. Rodin E, Constantino T, Rampp S et al. (2009). Seizure onset determination. J Clin Neurophysiol 26: 1–12.

FILTERING OF NEUROPHYSIOLOGIC SIGNALS Seaba PJ (1975). Understanding frequency response. Am J EEG Technol 15: 20–41. Shih JJ, Rodin E, Gupta V et al. (2012). Signal characteristics of intraventricular electrodes recordings in human epilepsy: a case report. Clin EEG Neurosci 43: 105–111. Staba RJ, Stead M, Worrell GA (2014). Electrophysiological biomarkers of epilepsy. Neurotherapeutics 11: 334–346. Thompson SA, Krishnan B, Gonzalez-Martinez J et al. (2016 Jan). Ictal infraslow activity in stereoelectroencephalography: beyond the “DC shift”. Clin Neurophysiol 127 (1): 117–128. Urrestarazu E, Chander R, Dubeau F et al. (2007). Interictal highfrequency oscillations (100–500 Hz) in the intracerebral EEG of epileptic patients. Brain 130: 2354–2366.

65

Worrell GA, Jerbi K, Kobayashi K et al. (2012 Sep). Recording and analysis techniques for high-frequency oscillations. Prog Neurobiol 98 (3): 265–278. Xiang J, Liu Y, Wang Y et al. (2009). Frequency and spatial characteristics of high-frequency neuromagnetic signals in childhood epilepsy. Epileptic Disord 11: 113–125. Zijlmans M, Jiruska P, Zelmann R et al. (2012). Highfrequency oscillations as a new biomarker in epilepsy. Ann Neurol 71: 169–178.

FURTHER READING Nandedkar SD, Mulot A (2018). Instrumentation for electrodiagnostic studies. this volume.