[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.7 Signals That Are Not Stored in Disk Files

The fname component of a WFDB_Siginfo object can be any string acceptable as a file name to your operating system. Under Unix, for example, signals can be read from (or written to) ‘special’ files such as ‘/dev/rmt0’ (the raw tape drive). If I/O must be performed in fixed-size blocks (such as for Unix character devices), the bsize component of the WFDB_Siginfo object must contain the appropriate block size in bytes. In such cases, the WFDB library must obtain (using malloc (see K&R, page 167) an amount of memory equal to the size of one block when the signal file is first opened. For large programs running on 16-bit machines, this can cause problems if signal files with large block sizes are read. (In such cases, isigopen or osigopen will not open the signal file if there is not enough memory to allocate a buffer.) Under Unix, if this problem occurs, use the “piped records” (see section Piped and Local Records) instead. The usual method is to read or write the signal file using a utility such as Unix’s dd and to pipe the data to or from the application program. Although this approach is flexible, there are a few drawbacks:

  1. While reading piped input, the standard input cannot be used for other purposes by the application program. Interactive programs can avoid problems by opening ‘/dev/tty’ for I/O, however.
  2. Programs that use isigsettime or isgsettime cannot perform backward skips on piped input, and forward skips can be quite slow.
  3. Additional system resources (computation time, process slots, and memory) are needed when using pipes, in comparison with the usual method of operation.

Several special-purpose header files allow application programs to read data directly from 9-track tape. When the WFDB Software Package is installed, these files are copied into the ‘tape’ subdirectory of the system-wide database directory. The record names associated with most of these header files (‘tape/512’, ‘tape/1024’, ‘tape/4096’, ‘tape/10240’) specify the block size in bytes. These use 16-bit format, 250 Hz samples, 12 bit ADC with zero ADC offset, two signals multiplexed into one, and data to be read from ‘/dev/rmt0’. Record ‘tape/6144d’ uses 8-bit difference format, 6144 bytes/block, and is otherwise similar to the others. Records ‘tape/ahatape’ and ‘tape/mittape’ can be used to read or write an AHA-format signal file on a 9-track tape that has been positioned to the beginning of the correct file; the signal file for these is ‘/dev/nrmt0’ (the non-rewinding raw tape drive). If the tape density is encoded into the tape drive name on your system, additional header files may be needed.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

PhysioNet (wfdb@physionet.org)