next up previous contents index
Next: What is ``high-resolution'' mode? Up: What else can WAVE do? Previous: How can I make a screen dump?

Can WAVE read digitized signals in (fill in the blank) format?

   Probably it can. The most common formats for storage of digitized signals are fixed-length binary formats that encode integer samples, and WAVE supports dozens of such formats. WAVE does not require any embedded header information within signal files (but it can be made to ignore such information). In most cases, all you need to do is to write a header file that describes the format in terms understandable to WAVE; once you have done so, any of the other DB applications can also read your signals. Writing a header file can be most easily done by copying an existing header file and modifying it using a text editor. See signal(5) and header(5) in the ECG Database Applications Guide, for details on supported signal formats and how to write a header file.

  There are at least three common ways of storing multiple signals: in separate files, in multiplexed (sample-interleaved) files, and in block-interleaved files. In a multiplexed file containing N signals, each set of N consecutive samples contains one sample from each signal. In a block-interleaved file containing N signals in blocks of 512 samples, for example, the first 512 samples come from the first signal, the next 512 samples come from the second signal, and so on. WAVE supports reading multiple signals from separate files or from multiplexed files (or both in the same recording), but it does not directly support block-interleaved files in general.

WAVE does support reading a special type of file containing signals sampled at different sampling frequencies. Files of this type contain ``frames'' of samples. Each frame contains at least one sample of each signal, but there may be two or more samples of signals sampled at multiples of the frame rate within each frame.

Block-interleaved files may be described simply as files with very large frames. If you have a block-interleaved file, therefore, you may be able to view it with WAVE via this expedient:

  One significant limitation of this approach is that the time resolution of any annotation files created in this way is limited to the frame interval. You can avoid this limitation by reformatting the signal file (for example, by following the steps above to verify that the signal file is properly readable, then using xform with its  own -H option; see xform(1) in the ECG Database Applications Guide.

   A common feature of many signal file formats is embedded header data: bytes at the beginning of the signal file that do not contain digitized samples. By specifying the length of the embedded header data as the byte offset for the sample data in the (external) header file, such formats can be easily accommodated; WAVE and any other applications built using the DB library simply ignore any preamble. If the signal file format is documented, it is usually not difficult to write a program to generate a header file based on embedded header data. See header(5), in the ECG Database Applications Guide, for details on byte offsets.

WAVE does not support directly reading signals stored in text files, because there is no general method for computing the position within such files of samples occuring at arbitrarily-chosen times. It is usually simple to convert such text files into WAVE-compatible binary files using wrsamp,  an application supplied with WAVE.

For the same reason, WAVE does not support directly reading signals stored using variable-length encoding or non-uniform sampling intervals. If a decompression utility is available, convert the data to fixed-length, uniform samples.

WAVE does not support any non-integer storage formats either, mainly because such formats are not commonly used for digitized data.

If you have signals in an unsupported format, you have two choices if you wish to analyze them using WAVE:

 For example, WAVE does not support directly reading EDF, the European Data Format first used for recordings of polysomnograms. (This is not the format used for either the European ST-T Database or the MIT-BIH Polysomnographic Database, both of which can be read directly by WAVE.) EDF uses block interleaving, and also includes an embedded header. Although the method outlined above for reading block-interleaved files can be used to read EDF files, a difficulty in doing so is that the block size is specified within the embedded header, and may vary between records. Moreover, since typical block sizes are quite large, the time resolution of annotations in this case is very coarse. A format converter for EDF files, edf2mit, may be used to rewrite such files in a format that WAVE can read without these limitations. This converter also constructs a suitable header file from the embedded header in the EDF file.

All currently supported signal formats use 16 bits per sample or less. In principle, formats requiring up to 32 bits per sample should pose no problem in environments that support WAVE, but formats requiring more than 16 bits may be difficult to support in other environments.


next up previous contents index
Next: What is ``high-resolution'' mode? Up: What else can WAVE do? Previous: How can I make a screen dump?

George B. Moody (george@hstbme.mit.edu)
Wed May 7 20:21:25 EDT 1997