next up previous contents
Next: The structure of EDF: Up: Some introductory notes to Previous: Introduction   Contents

The structure of EDF/EDF+: The data records

The filing of EDF/EDF+ uses two basic principles.

Since these features are the core of EDF and EDF+, we are going to explore some of its consequences.

Imagine that we want to include three signals in a file, the first being sampled every second, the second one being sampled every two seconds and the third one, every three seconds. We represent a sample as a red, yellow or green ball. Each ball is a two-byte integer. Let's see this in the figure 2.1

Figure 2.1: Three signals sampled at a different rate. Notice that all the signals are not defined at all timepoints
\begin{figure}\begin{center}
\epsfig{file=figures/signals.ps,width=15cm,height=6cm }
\end{center}\end{figure}

Of course, each ball is a value (e.g., the output of a A/D converter) that is dimensionless but in practice the resolution of the signal is determined by its sampling rate. Each value is what we know about the signal until we get the next value. I call this concept a sixel (from signal element). Sixels are similar to pixels but they have only one dimension: time. Their size could measured in dots per second. We can see a representation of this feature in the figure 2.2

Figure 2.2: The samples as if they have a duration: the sixels
\begin{figure}\begin{center}
\epsfig{file=figures/sixels.ps,width=15cm,height=6cm }
\end{center}\end{figure}

We could decide to store different signals in different files. EDF follows the opposite approach: trying to include everything in a file. This is the base of its structure: EDF uses blocks of data. Each block is called a data record. In our case (three signals sampled every one, two and three seconds) we have to find a size of the data record. Our block can last six, twelve, eighteen seconds: i.e., a common multiple of the duration of the sixels that form the file. Usually, signals in EDF are not sampled at very different rates. Often, there is a base sampling, being the other signals sampled at a multiple of this rate. Let us see the result of our grouping in the figure 2.3

Figure 2.3: The data record is marked as a blue frame. Notice that the duration of the data record has to be a common multiple of the sampling rate of the signals
\begin{figure}\begin{center}
\epsfig{file=figures/blocks.ps,width=15cm,height=6cm }
\end{center}\end{figure}

Now we have to store the data records one after the other. The result is shown in the figure 2.4. In the file, each record is consecutively stored.

Figure 2.4: Each data record is shown as a row. In the file they are consecutively stored
\begin{figure}\begin{center}
\epsfig{file=figures/edf.ps,width=15cm,height=6cm }
\end{center}\end{figure}

Consider the advantages of this order. If we are creating a very long file we only have to append the successive data records. Imagine that we are storing a record with two signals: EEG and rectal temperature. We need at least a sampling rate of 100 Hz for EEG and we decide sampling temperature each 30 seconds. We could use a data record with a duration of 30 seconds, containing 3000 values (sixels) of EEG signal and 1 value (sixel) of temperature. Each data record has 6002 bytes (two bytes for each value).

This arrangement is a powerful method to store data but it has some inconvenience. Since signals are not sampled at the same rate, there is not an equivalent rectangular matrix of values able to mirror the EDF structure. It implies that:

If you feel that differential sampling is an obstacle, consider that sampling all the signals at the same rate is a particular case of differential sampling. You can use the same sampling rate for each signal and you have a file where data records are no longer needed, you can even mix the values of the different signals in order. I will try to show that the use of differential sampling is full of possibilities and implies the additional beauty of adapting the recording to the spectral properties of the signal.


next up previous contents
Next: The structure of EDF: Up: Some introductory notes to Previous: Introduction   Contents
je 2006-10-12