1 Introduction

Electroencephalography (EEG) signal acquisition originated in the 1930s, but not until the development of digital systems in the 1980s was there a significant impact on the technology, particularly with respect to EEG signal analysis.

Before digital technology, EEG systems were analogues, recording signals using pens directly onto paper that didn’t allow any further modifications or processing. It was only possible to inspect or “read” the ink tracing and add some handwritten comments or observations.

The adoption of digital technologies allowed the data to be stored into a computer and subsequently processed and displayed. This has opened new opportunities for the user to analyse and display the data which has changed the way EEG data is “read”. Not only is the EEG now read on a high-resolution PC screen and manipulated, but the screen can display additional information that is of added value to the reporting process.

In order to appreciate the significance of digital electroencephalograph, this chapter will explore the structure of a modern data collection system to identify the different components and understand their function. The next chapter describes some of the ways data can be processed and/or analysed.

This chapter presents information that is essential for the overall understanding of a digital electroencephalograph system. Other information that is not essential will be found as notes or in the appendix and can be read only if deemed necessary. This is to simplify the text for those who want an overview of the topic but also provides more detailed information for those who wish to understand more.

Fig. 5.1
figure 1figure 1

Digital electroencephalograph

1.1 Digital EEG System Structure

A digital electroencephalograph (Fig. 5.1) is a system composed of the following main elements:

  1. 1.

    Data acquisition devices

    1. (a)

      EEG “headbox” - Amplifier

    2. (b)

      Video camera

  2. 2.

    Manual input devices

    1. (a)

      Keyboard

    2. (b)

      Mouse

  3. 3.

    Stimulation devices

    1. (a)

      Photic stimulator

  4. 4.

    Output devices

    1. (a)

      Monitor

    2. (b)

      Printer

  5. 5.

    Processing devices

    1. (a)

      Computer

  6. 6.

    Recording accessories

    1. (a)

      Electrodes

    2. (b)

      Caps

    3. (c)

      Conductive gel

  7. 7.

    Supports

    1. (a)

      Carts

    2. (b)

      Arms/stands

The data acquisition devices are the core of the system and convert the analogue signals and visual images collected from the patient to a digital representation that can be stored in a computer. The main component of the entire EEG system is the headbox and collects the EEG data from the patient and will be the subject of most of this chapter. The video camera is the device that records the continuous image (video) of the patient and is closely synchronized with the electrical (EEG) information. Section 5.5 describes the Video in more detail.

The input devices, usually a keyboard and mouse, allow the user to enter additional information into the system and to control the system functionality.

The stimulation devices are used to deliver controlled stimuli to the patient with the objective of stimulating a controlled response, for example, to induce an epileptic seizure. The most common example of a stimulation device is the photic stimulator that emits a powerful flash (up to 2 J/stimuli) at a given frequency and intensity and for a selectable duration. The first photic stimulators used a xenon lamp to generate the light. These lamps had the ability to deliver very powerful bursts of light for very short durations. However, they have now been replaced with high-power LED (light-emitting diode) systems which have similar, or even better, characteristics. For additional information on the use of the photic stimulator, see Chap. 13.

The output devices provide the user with feedback and output from the system. This includes the monitor, where the EEG and additional information is displayed (see Sect. 5.4.3), and the printer, where information and results can be printed for a permanent record (see also Sect. 5.4.4).

The processing devices include the computer, which always hosts a processor, that performs all the basic analysis, an internal RAMrandom access memory—to temporarily store the data (typical values are 4–8 Gb) and programmes necessary to run the analysis, at least one hard disk to permanently store the data (typical values are 500 Gb to 1 Tb) and usually a CD/DVD reader/writer to read and/or write data onto external media that can be read on any PC. The computer will have several interfaces or communication ports (i.e. network,Footnote 1 serial port,Footnote 2 USB portFootnote 3), allowing the computer to communicate with the various peripherals including the input and output devices. One particular type of interface are the synchronization devices commonly referred to as trigger IN and trigger OUT; these are communication ports that allow the user to send and receive very simple signals (typically TTLFootnote 4) used to synchronize devices. The trigger IN port of an EEG system receives synchronization signals from external devices (e.g. a photic stimulator), while the trigger OUT port of an EEG system can send synchronization signals to peripheral devices that need to be driven or controlled. In general, the role of the computer is to process all the data coming from input devices and data acquisition devices and provide the user with feedback and control through the output devices.

The recording accessories are the electrodes, caps, conductive gel and other transducers that interface or connect the patient to the headbox. Information about these accessories can be found in Chap. 3 of this book.

The supports consolidate the system into a single unit for ease of use and functionality. They are typically the cart and the various arms and support frames that hold the amplifiers, computer and other devices.

2 Analogue Components

2.1 EEG Signal Detection: The Electrodes

The electrodes, which include all the signal detection devices like the caps, wire electrodes, belts and other transducers, connect directly to the patient and play a fundamental role in the EEG signal acquisition. They represent the connection between the location where the signal is measured and the amplifier. Given their fundamental importance and the number of different electrodes available on the market, this book has a dedicated chapter on this topic (Chap. 3).

2.2 EEG Acquisition System: The Differential Amplifier

EEG signals are normally acquired using a differential amplifier. This is a component that measures small electrical potential difference between two points and then amplifies several times that potential for recording.The general design of a differential amplifier, connected to two points on the scalp, can be represented by Fig. 5.2.

Fig. 5.2
figure 2figure 2

Differential amplifier

The amplifier has two inputs, normally referred to as inverting input and non-inverting input. The amplifier then measures and amplifies the difference of potential between these two inputs, that isFootnote 5:

$$ {V}_{\mathbf{OUT}}=A\left({V}_{\mathbf{A}}-{V}_{\mathbf{B}}\right) $$

where VOUT is the measured voltage, VA the voltage at the inverting input, VB the voltage at the non-inverting input and A is the amplification factor. In the case of an EEG signal, the amplification factor is in the range of 10,000 and increases the measured voltage, normally in the range of 500 μV, to become compatible with the voltage normally used in electronic circuits that are in the range of a few volts. The exact value of this amplification factor is not relevant for the user because it is made redundant by the signal processing, and for the sake of simplicity, it will be omitted, and a simplified version of the formula will be used:

$$ {V}_{\mathbf{OUT}}=\left({V}_{\mathbf{A}}-{V}_{\mathbf{B}}\right) $$

The measured voltage VOUT is theoretically referenced to a potential normally called “ground”Footnote 6 and highlighted in Fig. 5.2 as VG, so that:

The formula shows that the value of the measured voltage is independent of the ground potential. However, this is only true if the amplifier can effectively measure the voltages (VA − VG) and (VB − VG); if not, the amplifier could “saturate” and measure VOUT incorrectly. As a result, although the electrode that detects the ground potential could, theoretically, be placed in any location on the patient, its position must actually consider the possible saturation effect and should always be positioned close to all the other electrodes to minimize the difference of potential between them.

In reality, signal amplification is not perfect and cannot be simplified to the extent shown in the formula. As a result, several parameters have been defined to evaluate the ability of an amplifier to amplify the signal. The most common parameters for this evaluation are the CMRR (Common Mode Rejection Ratio), the internal noise of the amplifier, its input impedance and its bandwidth.

CMRR is an index of the rejection of common noise between two inputs of the amplifier (inverting and non-inverting). If the same noise is present at the two inputs (very common in practice), this noise should be completely cancelled by the amplifier because of its “differential” nature. In other words, because the amplifier is only detecting the difference of potentials between the two inputs, any common noise should be eliminated. In practice, the common noise is not perfectly cancelled but is significantly attenuated. For example, a common noise of 1 V will not be cancelled entirely but will result in a component of noise typically about 1 μV. The value of the CMRR is measured in dB to highlight the attenuation factor and is calculated as followsFootnote 7:

$$ \mathrm{CMRR}=20{\log}_{10}\left({V}_{\mathbf{IN}}/{V}_{\mathbf{OUT}}\right) $$

Using the values of the example this becomes:

$$ {\displaystyle \begin{array}{l}\mathrm{CMRR}=20{\log}_{10}\left(1\ \mathrm{V}/1\ \mu V\right)=\\ {}20{\log}_{10}\left(1,000,000\right)=20\times 6=120\ \mathrm{dB}\end{array}} $$

The value recommended by [1] is 110 dB, and amplifiers currently on the market have values around 100 dB or higher.

The internal noise of the amplifier is the value of the output when all inputs are set to zero. Theoretically according to the formula, the output should be zero, but, in practice, the circuits that compose the amplifier produce some noise that by design should be minimized. Normal values for this noiseFootnote 8 are a few μV, if measured peak to peak (indicated as μVPP), or below 1 μV, if measured as effective value (indicated as μVRMS).Footnote 9

The input impedance of the amplifier is a parameter that indicates the resistance to current flow through the amplifier as a function of the applied voltage. Its value should be as high as possible and is typically in the range of hundreds of MΩ or higher.

The bandwidth of the amplifier defines the operating frequency range of the amplifier. If the lower limit of the bandwidth is 0 Hz, the amplifier is called a DC-amplifier (direct current) and can record very slow potentials.Footnote 10 In all other cases, the amplifier is called an AC-amplifier (alternating current) and will have a cut-off frequency below which all potentials will be significantly attenuated.Footnote 11 The lower limit of the amplifier bandwidth should be selected based on the signal to be recorded, typically in the range of a tenth of a Hertz (i.e. 0.1 Hz). Values for this limit are shown in Table 5.1 and in Sect. 5.3.4 where the upper limit of the bandwidth is shown and which is always correlated to the anti-aliasing filter that is necessary for sampling.

Table 5.1 Recording parameters for EEG and polygraphic signals

2.3 EEG Acquisition Technique: Common Reference and Bipolar Electrodes

One of the biggest advantages offered by digital EEG is that the signals are no longer recorded in an unmodifiable way on paper but acquired and stored in a format capable of post-processing and display. This big advantage is used by digital systems to record not the potential differences between only two electrodes, as on paper EEG, but to record the potential difference between each electrode and, through a common electrode, any other electrode. For this reason the common electrode is called a common reference. A common reference amplifier design is shown in Fig. 5.3.

Fig. 5.3
figure 3figure 3

Common reference acquisition

Figure 5.3 only shows four electrodes with common references, but this can be extended to any number of channels in a recording system. The common reference electrode is connected internally to the inverting input of each differential amplifier, and the ground electrode is connected internally to each differential amplifier. Consequently in order to record, for example, a 19-channel EEG, it is necessary to apply 21 electrodes to the patient, 19 so-called active electrodes plus the common reference and the ground. Generally speaking, to record N channels, N + 2 electrodes have to be applied.

Once all the active electrode potentials are recorded with respect to a common reference, any specific signal between any two electrodes can be calculated using simple subtractionFootnote 12 for example:

The formula illustrates that the result does not depend on the position of the common reference electrode, at the condition to avoid any saturation of the recorded signal. Saturation can occur in two different ways:

  1. 1.

    Both recorded potentials (Fp2-Ref) and (C4-Ref) saturate: in this case, the display of Fp2-C4 will be a flat line because the difference between two saturated signals (which implies they are both at the maximum value) is zero. This situation is typical in cases where the potential of the common reference electrode increases due to artefact. In a unipolar montage, this artefact will be seen easily, while in any bipolar montage, only a short flat line will be seen.

  2. 2.

    Only one of the two recorded potentials (Fp2-Ref) or (C4-Ref) saturates: in this case, the display of Fp2-C4 will be the signal from the electrode that does not saturate; thus, this problem is very difficult to detect.

Note that in Fig. 5.3, there are a couple of bipolar electrodes (ECG), to show examples of polygraphy electrodes (ECG, respiration and others) that are recorded in bipolar mode and only share the ground electrodes with the EEG channels.Footnote 13

Note that the physical bi-auricular reference is a common reference where two earlobe electrodes are shorted and used as a common reference as shown in Fig. 5.4:

Fig. 5.4
figure 4figure 4

Physical bi-auricular common reference acquisition

2.4 EEG Acquisition System: Noise

What has been described for the differential amplifier is valid under ideal circumstances; however, we must consider the “true” characteristics of the amplifier operating under nonideal circumstances. The main problem is that the contact between the electrodes and the scalp is never perfect. This imperfect contact is defined as the contact impedances and is measured on all the electrodes, including the common reference and ground electrodes, and leads to the susceptibility of unwanted noise detected through the electrodes and the connecting cables. The complete analysis of this interference is very complex and depends on a large number of variables; however, a simplified analysis can be made using the following diagram (Fig. 5.5):

Fig. 5.5
figure 5figure 5

Diagram of noise detected by a differential amplifier

In the diagram, IP indicates the micro-current that can flow through the patient due to electromagnetic induction (the patient acts as an antenna for the electromagnetic noise) and that reaches the ground. IC indicates the micro-current that can flow through the cables again caused by electromagnetic induction (the cables form a loop, and an electromagnetic force is induced in the cables following Faraday’s Law). ZA, ZB and ZG represent the contact impedances at input A, B and ground respectively, while ZIN represents the input impedance of the differential amplifier. By applying the law of electronic circuits,Footnote 14 the output voltage, VOUT, can be calculated as:

$$ {\displaystyle \begin{array}{l}{V}_{\mathbf{OUT}}=\left[{V}_{\mathbf{A}}-{V}_{\mathbf{B}}\right]+\left[{I}_{\mathbf{P}}\times {Z}_{\mathbf{G}}\left({Z}_{\mathbf{B}}-{Z}_{\mathbf{A}}\right)/{Z}_{\mathbf{IN}}\right]+\\ {}\left[{I}_{\mathbf{C}}\left({Z}_{\mathbf{A}}-{Z}_{\mathbf{B}}\right)\right]=\mathrm{Signal}+\mathrm{Noise}\end{array}} $$

It is clear that the output is two components: the desired signal VA − VBFootnote 15 plus an undesired noise component. To understand the origin of this noise component, representative values can be used for the variables: if it is assumed that the induced micro-current caused by the patient and cable is, respectively, IP = 0.2 μA and IC = 10 nA and the contact impedances are ZA = 10 kΩ, ZB = 5 kΩ and ZG = 20 kΩ (which are representative of values seen in practice) and the input impedance of the differential amplifier ZIN = 100 MΩ. The result is:

$$ {\displaystyle \begin{array}{l}{V}_{\mathbf{OUT}}=\left[{V}_{\mathbf{A}}-{V}_{\mathbf{B}}\right]+\left[0.2\ \mu A\times {Z}_{\mathbf{G}}\left({Z}_{\mathbf{B}}-{Z}_{\mathbf{A}}\right)/{Z}_{\mathbf{IN}}\right]+\\ {}\left[10\ \mathrm{nA}\left({Z}_{\mathbf{A}}-{Z}_{\mathbf{B}}\right)\right]\end{array}} $$
$$ {V}_{\mathbf{OUT}}=\left[{V}_{\mathbf{A}}-{V}_{\mathbf{B}}\right]+\left[0.2\ \mu V\right]+\left[50\ \mu V\right] $$

Clearly, the majority of the noise is generated by the induction through the cables and can have significant values that are in the same range, or even greater, than the signal. Typical EEG signals are normally in the range of hundreds of μV, so it is clear that a component in the range of 50 μV can significantly impact the recording. The most common noise detected by the electrode cables is induced by the mains power (in Europe 220 V at 50 Hz, in the US 110 V at 60 Hz) and is generated by almost every electronic device. Typically, the induced noise has a frequency of 50 Hz (or 60 Hz in the US).Footnote 16 This is the reason why all EEG systems feature a stopband filter, centred at 50 Hz. This filter, commonly called a notch filter,Footnote 17 is designed to eliminate the undesired component (i.e. 50 Hz) and is often called 50 Hz Filter.Footnote 18 The transfer function of the filter is shown in Fig. 5.6.

Fig. 5.6
figure 6figure 6

Notch filter transfer function

Unfortunately, given the growing number of electronic devices that are present in a hospital environment, plus old or poorly installed main lines, the noise is not only a sinusoidal component at 50 Hz but 50 Hz signal contaminated by other components which quite often create harmonics of the mains frequencies, or multiple frequencies, each a multiple of the original mains frequency. The most typical example of this is the 50 Hz sinusoidal signal with multiple peaks associated with its cycles that are caused by switching systems. The notch filter eliminates the 50 Hz component, but all the peaks remain, contaminating the signal. These problems have resulted in the design of multi-notch filters that can be set to eliminate several frequency components of the original signal, starting from 50 Hz and moving forward with each main harmonic, for example, 100 Hz, 150 Hz, 200 Hz and further if necessary. The transfer function of such a filter is shown in Fig. 5.7:

Fig. 5.7
figure 7figure 7

Multi-notch filter transfer function

Another important reason to consider the formula for the noise with respect to the output voltage is that both additional noise terms are functions of (ZA – ZB). This means that noise does not depend on the “value” of the impedance of a single electrode but on the “difference” between the values of two electrodes. As a result, to minimize the noise, it is necessary to make the two impedances equal to each other. Clearly, this is not possible so the only available strategy to minimise noise is to reduce all the contact impedances as much as possible, including those of the common reference and the ground electrodes, so that their difference will be minimal.

3 Analogue-To-Digital Conversion

The analogue-to-digital conversion of a signal is a process that converts an analogue signal waveform to a sequence of numbers that can be processed and stored in a PC. The analogue-to-digital conversion is very common in our daily life, used for music, telephones, televisions and many other applications. This is discussed in Sect. 5.3.5.

3.1 Sampling

Sampling is a very simple process that, given an analogue signal properly amplified, consists of “measuring” the signal a given number of time per second and then storing the measured values instead of the entire analogue signal. An example of an analogue-to-digital conversion is shown in Fig. 5.8.

Fig. 5.8
figure 8figure 8

Sampling process equivalent scheme

As shown in the diagram, the analogue signal is measured at regular periodic intervals. The frequency of this measurement is defined as the sampling frequency, indicated as FS. Sampling is a no-loss process, which means that no information is lost, if and only if the sampling frequency is at least twice FMAX, the maximum frequency that occurs in the signal.

This is known as the sampling theoremFootnote 19 and can be written as a formula:

$$ {F}_{\mathrm{S}}>2\times {F}_{\mathrm{MAX}} $$

If the sampling theorem is not followed, the resulting digital signal can be corrupted, so all sampling systems filter the analogue signal at least at half the sampling frequency before sampling. This is usually called an anti-aliasing filter, where the name aliasing is taken from the typical error that can appear if the sampling is not performed correctly.Footnote 20 For example, if we assume that the bandwidth of the EEG does not exceed 100 Hz, an adequate sampling rate, in agreement with [1], is 256 Hz,Footnote 21 which means that the low-pass anti-aliasing filter should have a cut-off frequency of approximately 100 Hz as shown in the diagram. Note that the cut-off frequency of the anti-aliasing filter is never exactly half the sampling frequency. This is because at the cut-off frequency, the signal is not completely cancelled but only attenuated to about 70% of its value. Normal cut-off frequencies are in the range of 1/3 or even 1/4 of the sampling frequency to ensure that frequencies above half of the sampling frequency are properly cancelled.

Note that with the sampling process, we represent a set of continuous real numbers (the signal to measure) with a set of real numbers (the sampled signal).

3.2 Quantization

The objective of the quantization process is to complete the analogue-to-digital conversion process by reducing the measured samples to a set of finite numbers. It is important to note that the values measured by the sampling process are real numbers, so they have practically infinite resolution. This makes it impossible to store them in a simple form like a byte. Quantization approximates the real measured value to a close integer value.

A diagram of such a process could be that of Fig. 5.9

As the diagram highlights, quantization happens in a finite range of amplitudes, often referred to as the maximum signal input (indicated in Fig. 5.9 as VIN), which defines an upper and lower limit for the signal to be converted. This parameter plays a very important role in the EEG signal acquisition process, because it needs to encompass the signal to be converted to avoid the saturation phenomenon. This happens when the measured signal exceeds the maximum signal input with the result that the value above the maximum signal input appears as the maximum signal input instead of the real signal, “cutting” the signal at the upper or lower value.Footnote 22 This saturation phenomenon should not be confused with the saturation of the amplifier, even though the result is very similar (as described in Sect. 5.2.3).Footnote 23 An example of saturation is shown in Fig. 5.10.

Fig. 5.9
figure 9figure 9

Quantization process equivalent diagram

Fig. 5.10
figure 10figure 10

Example of saturation of the input signal

Another very important parameter for the quantization process is the precision of the measurement. In a digital system, this is determined by the number of bits used for the quantization of the signal (indicated in Fig. 5.9 as Nbit). The number of bits used is directly proportional to the number of intervals (or more correctly number of digits) in which the maximum input signal is split. The relation is the following:

  • Nbit = 8 → 28 digit = 256 digit

  • Nbit = 12 → 212 digit = 4,096 digit

  • Nbit = 16 → 216 digit = 65,536 digit

  • Nbit = 22 → 222 digit = 4,194,304 digit

  • Nbit = 24 → 224 digit = 16,777,216 digit

We can define the precision of the measurement or resolution as the ratio between the maximum input signal and the number of intervals in which such a range is split:

$$ \mathrm{Resolution}=\frac{\mathrm{Maximum}\kern0.5em \mathrm{input}\kern0.5em \mathrm{signal}}{\mathrm{Number}\kern0.5em \mathrm{of}\kern0.5em \mathrm{intervals}} $$

This value identifies the precision of the measurement of the quantization process and is expressed in [V/digit]. Note that the precision of the process is not uniquely identified by the number of bits, as often specified, but by a well-defined ratio between two values where only the denominator is proportional to the number of bits.Footnote 24

As the quantization process induces an error in the measurement, it is necessary to quantify the magnitude of such an error to evaluate its importance. Considering how the process is performed, by “measuring” the signal using the closest interval, it is evident that the average quantization error is half the interval into which the maximum input signal is divided, as shown in Fig. 5.11.

Fig. 5.11
figure 11figure 11

Example of approximation of the signal due to quantization

As shown in Fig. 5.11, a signal is represented by the closest quantization level either above it (samples 3 T, 4 T, 6 T, 8 T, 9 T of Fig. 5.11) or below it (samples 1 T, 2 T, 5 T, 7 T, 10 T, 11 T of Fig. 5.11).

More precisely this can be written as:

$$ \mathrm{Average}\kern0.5em \mathrm{measurement}\kern0.5em \mathrm{error}=\frac{\mathrm{Quantization}\kern0.5em \mathrm{interval}\kern0.5em \mathrm{amplitude}}{2} $$

In systems on the market, the number of bits normally used for quantization is typically 16 (with a minimum value recommended by [1] of 12) combined with a maximum input signal of at least 1 mV for EEG (±500 μV), which leads to the following values:

$$ {\displaystyle \begin{array}{l}\mathrm{Resolution}=\frac{1000\left[\mu V\right]}{65536\left[\mathrm{digit}\right]}=0.015\left[\mu V/\mathrm{digit}\right]=\\ {}15\left[\mathrm{nV}/\mathrm{digit}\right]\end{array}} $$

Because this resolution is more than sufficient for most applications, quite often systems use maximum input signals higher than 1 mV to handle intracranial signals and various polygraphic signals (i.e. ElectroCardioGram, ElectroOculoGram and others).

3.3 Decimation

Decimation is an advanced technique that is not essential for the comprehension of the EEG signal acquisition process. This paragraph describes some of the more sophisticated aspects of the process. Decimation is basically a digital process which reduces the number of samples collected. For example, sampling a signal at 512 Hz and then keeping one sample for every two (which means one sample is kept and one sample discarded) results in a signal sampled at half the original sampling rate or 256 Hz. This operation is often referred to as downsampling, as it leads to a reduction of the original sampling rate.

In order to obtain the correct result from decimation, the sampling theorem (seen in Sect. 5.3.1) must be honoured. This means that the signal to be decimated must not contain any frequencies higher than half of the new sampling frequency resulting from the decimation. As a result an additional anti-aliasing filter should be applied to the signal before decimation. The advantage is that this filter operates on a sampled signal and is therefore a digital filter. This is the main reason over-sampling techniques are used. The original signal is sampled at very high frequencies (i.e. 8 kHz) and then decimated to obtain the desired sampling rate with a digital anti-aliasing filter, which has a much better performance than a similar analogue filter. A second advantage, which is more complicated and will not be addressed in this book, is the reduction of background noise (minimal) that results using this technique.

A possible scheme for the decimation process is shown in Fig. 5.12:

Fig. 5.12
figure 12figure 12

Decimation equivalent scheme

As shown in Fig. 5.12, assuming an input signal SQ(nT1) sampled at 512 Hz, to perform a decimation of 2 to 1 (which means moving from a sampling rate of 512 Hz–256 Hz), the first process is to apply an anti-aliasing filter with a cut-off frequency that is at least half of the resulting sampling rate (i.e. lower than 256/2 = 128 Hz). In the example this frequency has been chosen to be 100 Hz. The decimation process of keeping just one sample for every two can only be completed after the filtering, obtaining the desired output signal SQ(nT2).

In reality the decimation process is often used to convert a signal from very high sampling rates (e.g. 8192 Hz) to much smaller values (e.g. 256 Hz) to take advantage of having a single analogue anti-aliasing filter in the circuits and the rest of the process performed by the software (or firmware) with digital filters to allow the selection of the desired sampling rate.

3.4 Summary of the Parameters of EEG Signal Acquisition

As discussed in the previous paragraphs, the parameters that must be known to sample EEG signals correctly are:

  • B = signal bandwidthFootnote 25

  • AMAX = maximum signal amplitude

Consequently, the following parameters must be set in the recording system:

  • FS = sampling frequency, which must be at least twice the maximum frequency composing the signal (i.e. the upper limit of the bandwidth)

  • VIN = maximum signal input, which must be larger than the maximum signal amplitude to guarantee correct signal recording

The most common parameters for typical EEG signals are shown in Table 5.1, derived from recommended standards [1], and calculated with a 16 bit quantization:

3.5 Examples of Other Analogue-To-Digital Conversion Processes

The analogue-to-digital conversion process described for EEG signals is common to many other applications of daily life such as telephones, music and others. For example, voice transmitted by our mobile phones is sampled at 8 KHz with a quantization at 8 bit, with a resulting bandwidth of less than 4 KHz, which works correctly for a normal conversation. However, when we consider high-fidelity audio, because the audible signal that can be heard by humans is in the range of 20 KHz, the music must be sampled at 44.1 KHz and 16 bit to sound correct. Examples of analogue-to-digital conversion of signals are shown in Table 5.2:

Table 5.2 Example parameters for analogue-to-digital conversion of common signals

4 The Digital Component

Once the analogue EEG signal is converted to digital, the signal goes through additional processes such as storing, display, printing and other manipulations for further analysis. The following paragraphs describe these processes.

4.1 EEG Signal Storage

Once the EEG signal is converted to a digital format, most EEG systems immediately store it. The first destination for data is the hard disk of the recording PC or another disk over the network. Subsequently the data is normally transferred to a disk over the network which provides reading station access for viewing, analysis and reporting. Once the signal has been displayed, analysed and reported, the signal (or just a part of itFootnote 26) is transferred to a permanent storage media, which could be another disk or a non-rewritable media like CD-RFootnote 27 or DVD-R,Footnote 28 through an application that is normally part on the reporting system. These media allow the data to be permanently stored (or at least for several years) in an unmodifiable way, as required by some national laws. It’s important to remember that in modern systems, the EEG is normally stored as “raw” data, that is, exactly as the signal was acquired by the amplifier. This means that all EEG channels are stored with a common reference, with only the filters performed by the hardware system and without any additional filter (including the notch filter), and these processes are performed when displaying the signal on the screen, as described in the next paragraphs.

4.2 EEG Signal Digital Processing

Before being displayed, the EEG signal goes through various processes, which include some or all of the following:

  1. 1.

    The original signal, where all channels are recorded in Common Reference, can be re-referenced, that is, calculating for each signal the Average Reference or the Source Reference.

    • Average Reference yields the absolute potential of each recorded electrode, as discussed in Sect. 5.2.3. For example, for the electrode C3 recorded as (C3-Ref), the average reference yields C3ABS. This is obtained by calculating the average of all the common reference electrodes (which should ideally be the absolute potential of the common reference electrode—named AVG) and subtracting this value from the signal of each channel. Written as a formula, this is:

The first term of the formula should tend to zero as the arithmetic average of a large number of uncorrelated signals, so the result will be the real “absolute” potential of the common reference electrode RefABS. By simply re-montaging the signals with this newly calculated reference, the result is:

The disadvantage of this process is that the number of averaged signals is normally not as large as required (should be infinite), so the AVG potential obtained is not the “real” potential of the common reference electrode but is contaminated by all the high-amplitude signals that are present in the various electrodes (e.g. eye blink artefact). When this signal is subtracted from each electrode, the contaminated signal spreads to all the electrodes.Footnote 29 This phenomenon, known as average reference contamination, can be avoided by increasing the number of electrodes to be recorded (which in most cases is not possible) or by excluding those electrodes where artefacts are most often present (e.g. Fp1, Fp2 for Eye Blinks) from the calculation of the AVG potential.

Figure 5.13 shows two set of signals displayed in unipolar montage. The signals on the left are shown in common reference and the signals on the right in average reference, including the fronto-polar electrodes in the average calculation.

Fig. 5.13
figure 13figure 13

Example of EEG signal with a common reference and average reference

As the figure shows, the artefact due to eye blinks that is present in the common reference display, mainly in the frontal area (i.e. Fp1 and Fp2), contaminates other electrodes (i.e. O1, O2 with reverse polarity) with the average reference display.

The average reference is rarely used for the visual interpretation of EEG, but it is often necessary for processing that requires an absolute value for the potentials, such as mapping.

Also, note that the average reference does not affect the display with a bipolar montage because the same potential is subtracted from all the electrodes so that the difference of potentials between two electrodes remains the same.

  • Source Reference is a signal processing technique that aims to highlight the “source” of the potentials. In other words, the potential will be higher in the electrode that is closest to the source of the potentials. A complete analysis of this technique is complicated and described in Appendix 2—Source Reference.

  1. 2.

    The Montage defines how signals are recombined and selected for display. This could be unipolar (each signal with the reference selected at the previous point) or bipolar (the difference between two channels recorded with the same reference). Refer to Sect. 5.2.3: Common Reference and Bipolar Electrodes—for further details.

  2. 3.

    Signals are filtered (using correctly designed digital filter) to reduce the recorded bandwidth for the display and to cut noise (e.g. a digital notch filter). These filters represent additional processing over and above the filters already applied by the hardware as seen in the previous paragraphs. For example, Fig. 5.14 shows a diagram of the complete filtering chain for a typical acquisition and display process.

Fig. 5.14
figure 14figure 14

Example of a complete filtering chain for an EEG signal

As Fig. 5.14 shows, the system works to progressively narrow the bandwidth of the signal until it is compatible with the display.

These three processes are all digital and allow any of their parameters to be modified to prepare the signal for display on the screen and/or for printing.

4.3 EEG Signal Display

Signal display is a very important process, often under evaluated, because it defines the quality of the final “presentation” of the recorded EEG to the user and can therefore influence correct data interpretation.

Data are drawn on a matrix of points, called pixels, that compose the LCDFootnote 30 screen. The size of the pixel matrix is a characteristic of the graphic card of the PC and the screen that is connected to the graphic card. In fact, to display an image on the screen, the matrix must exist in the memory of the graphic card, and the screen has to be capable of displaying the matrix of pixels, or interpolations have to occur. Typical matrix is 1440 × 900, 1680 × 1050 (mainly used on laptops) and 1920 × 1080 (Full HD). It is worth noting that the size of the pixel depends on the resolution and the size of the screen. Typical values for pixel size are shown in Table 5.3.

Table 5.3 Typical pixel sizes

The display of the EEG signal is presented by drawing on the pixel matrix of the graphic card the sequence of signal samples connecting each point, in the simpler hypothesis, with a line identified by “on” pixels. The result, on a different scale, is shown in Fig. 5.15, where the digital signal SQ(i) = [3.0; 4.0; 7.0; 5.0; 3.0; 1.0; 1.0; 2.0; 4.0; 6.0] is drawn.

Fig. 5.15
figure 15figure 15

EEG signal drawn on a pixel matrix 40 × 30

As Fig. 5.15 shows, the value of a signal sample is associated with a specific pixel (drawn in black in Fig. 5.15). The vertical coordinate is proportional to the value of the sample, while the horizontal coordinate is time (in Fig. 5.15 the proportion factor is 4 pixel/digit). These pixels are then linked by additional pixels (drawn in grey in Fig. 5.15).

The vertical scaling factor determines the video gain, often improperly called its sensitivity, that is calibrated by the EEG system manufacturer with proportions that are, for example, 100 μV/cm, 200 μV/cm, 400 μV/cm, 800 μV/cm for the EEG and other values for other signal types.Footnote 31 It is worth noting that typically a signal that is quantized at 16 bit, that is 65,536 digits, is then drawn in about 200 vertical pixelsFootnote 32; this means that all the efforts made to increase the precision of the quantization vanish when the signal is displayed.

The horizontal scaling factor determines the so-called base time, that is, the number of seconds of EEG drawn on the screen. This factor is also calibrated by the EEG system manufacturer to display an integer number of seconds on the screen (typically 10, 15 or 20 s) or to represent a proportion, for example, 1.5 cm/s or 3.0 cm/s. It is worth noting again that a signal, for example, sampled at 256 Hz is then drawn in about 96 horizontal pixels.Footnote 33 This quite often contaminates the signal (most of the time unperceivably) due to the number of samples that are drawn on the same horizontal position.

It is clear that for an optimal display of EEG signals, both the horizontal and vertical resolution of the screen must be chosen as high as possible. For the screen of an EEG reporting station, a minimum resolution of 1920 × 1080 pixel is recommended.

4.4 EEG Signal Printout

Signal printout is also a very important process but is less and less common as the display interpretation is now preferred. Printouts still occur, for example, to give patients a few pages of EEG together with the report and/or for medical-legal reasons. Printouts are normally done in two ways:

Single sheet printout, typically on A4 paper format (or “Letter” in the US) and with laser technology on standard paper. The process is very much the same as the display described in the previous paragraph: the paper is divided into a matrix of points that can be switched “on” or “off.” In the case of a printer, the number of points is determined by the resolution of the printer that is often at least 600 dpi,Footnote 34 which is four times larger than the video, minimizing the resolution issue described for the screen. This is also the reason why EEG signals printed on paper look “thinner” than the same signals on the screen: they are plotted on a matrix of much smaller points and consequently the lines are thinner.

Continuous module printout is rarely used. This was done on thermal paper that, by heating, became darker. The resolution of these printers, typically 16 points/mm, was not as high as the laser printers but still better than the screen resolution.

In both printout cases, vertical and horizontal scaling factors are properly calibrated by the EEG system manufacturer to reach the desired gain on paper and base time.

5 Synchronized Digital Video

Recording the patient video synchronously with the EEG is a technique used for many years and has evolved to its current form of synchronized digital video.

The first systems were composed of a camera filming the pens writing the EEG data onto the scrolling paper, while a second camera filmed the patient; the two signals were then mixed together and the video EEG was obtained.

With the first digital EEG, recording of the video started on videotape and the synchronization signal was encoded into the video tape. This kind of system is often referred to as the analogue video option for digital EEG.

In the middle 1990s, the first digital video systems were developed, which involved recording the video into a file, together with the EEG; the recording PC and its software performed the synchronization. It is worth noting that in many of these systems, analogue or digital, audio was always recorded.

Main advantages of digital video over analogue are:

  • Digital video is easier to store and transfer as both EEG and video can be written on the same media (hard disk, CD or DVD or any other).

  • Digital video offers direct access to any time instant of the video, without the need to rewind or fast forward the tape as with the analogue video.

However, it is worth noting that digital video has introduced new variables such as the resolution of the image, the codec used for the compression and the codec used to play the video on a PC. The following paragraphs describe these parameters in detail and how the digital video is recorded and stored.

5.1 Digital Video EEG Acquisition

A digital video EEG acquisition system is basically a PC that performs three digitizing processes simultaneously: analogue-to-digital conversion of the EEG, the video and the audio. Figure 5.16 shows a diagram for such a video EEG acquisition system:

Fig. 5.16
figure 16figure 16

Block diagram of a digital video EEG acquisition system

Analogue-to-digital conversion of the EEG has already been reviewed in Sect. 5.3. The analogue to digital conversion of the audio, as discussed in Sect. 5.3.5, is the same as EEG, just with different parameters; the next paragraph will analyse the digitizing process for the video.

5.2 Video Signal Digitalization

The video signal normally acquired by a standard camera is composed of 25 images per second,Footnote 35 captured by the camera itself.Footnote 36 The complete analogue to digital conversion consist of digitizing every image and storing the entire sequence of 25 images per second, or less if necessary,Footnote 37 into a file. The number of images or frames per second (fps) is the number of images per second that is recorded into the file. The resolution of the video is the number of pixels used for the digitization of each image, which defines the quality of the images and of the video, as shown in Fig. 5.17.

Fig. 5.17
figure 17figure 17

Digitalization of an image

As shown in Fig. 5.17—if the resolution of the image is too small, there is the “pixelisation” effect where the border of the original image is no longer visible in the digitized image. In practice resolution is much better than this, and typical values are shown in Table 5.4:

Table 5.4 Video resolution

Once the video signal has been digitized, it is never stored in its original form because its size would be too large and not practical to manage. To solve this problem, a process of compression of the video signal is performed to obtain more acceptable file sizes. Compression is a very complex process that is reviewed in the next paragraph.

5.3 Digital Video Compression

Digital video compression is a widely used process that is performed on all digital video signals currently used.

The first compression used in digital video was called MJPEG (Motion JPEGFootnote 38), in which every single image was compressed into a JPEG format and the sequence of images stored. This technique, despite being intuitive, didn’t exploit the fact that the difference between one image and the next could be minimal, so that new techniques have been developed, all of them named MPEG (Motion Picture Experts Group), that exploit this concept of only storing the difference between sequential images.

It is simple to understand that several different algorithms can be developed for this type of compression, so the MPEG standard has evolved enormously over time taking advantage of the increasing computational power of digital systems and optimizing the results. As a result, from the initial MPEG-1 standard, the MPEG-2 was developed (used by DVDs) up to the most recent MPEG-4. All these standards have their own peculiar characteristics but, as far as video EEG is concerned, their differences stand out in the fact that a similar quality result can be obtained with smaller file sizes, as shown in the following table:

The calculation in Table 5.5 was performed on a CIF resolution video and using a similar image quality factor. By changing these parameters, it is possible to get very different results that make any comparison looking at the file size, very difficult to identify the compression.

Table 5.5 Video file sizes

5.4 Digital Video File Display

As discussed in the previous paragraph, digital video files are always compressed, and there are several different compression standards. As each compression standard corresponds to a different compression algorithm, to display the video on a PC, it is necessary to have the complementary decompressor algorithm. The union of the two words (COmpressor–DECompressor) has created the word codec that identifies the software and algorithm that a computer should use for the compression of a video and which to use to display a compressed video. According to the compression type and the operating system used, it is possible to have different problems displaying a video, so it’s strongly recommended to always have the codec software available when moving a video to a different PC (i.e. for a presentation at a conference or simply on another PC).

It is worth noting that the file extension does not automatically identify the compression. Files with the same extension (typically .AVI) can have very different codecs.