Go to the first, previous, next, last section, table of contents.


Signal Information Structures

The siarray argument for isigopen, osigopen, dbinit, and osigfopen is a pointer to an array of objects of type DB_Siginfo. The first three of these functions fill in the DB_Siginfo objects to which siarray points, but the caller must supply initialized DB_Siginfo objects to osigfopen. Each object specifies the attributes of a signal:

char *fname
a pointer to a null-terminated string that names the file in which samples of the associated signal are stored. Input signal files are found by prefixing fname with each of the components of the database path in turn (see section The Database Path). fname may include relative or absolute path specifications if necessary; the use of an absolute pathname, combined with an initial null component in DB, reduces the time needed to find the signal file to a minimum. If fname is `-', it refers to the standard input or output.
char *desc
a pointer to a null-terminated string without embedded newlines (e.g., `ECG lead V1' or `trans-thoracic impedance'). The length of the desc string is restricted to a maximum of DB_MAXDSL (defined in `<ecg/db.h>') characters, not including the null.
char *units
a pointer to a null-terminated string without embedded whitespace. The string specifies the physical units of the signal; if NULL, the units are assumed to be millivolts. The length of the units string is restricted to a maximum of DB_MAXUSL (defined in `<ecg/db.h>') characters (not including the null).
DB_Gain gain
the number of analog-to-digital converter units (adus) per physical unit (see previous item) relative to the original analog signal; for an ECG, this is roughly equal to the amplitude of a normal QRS complex. If gain is zero, no amplitude calibration is available; in this case, a gain of DEFGAIN (defined in `<ecg/db.h>') may be assumed.
DB_Sample initval
the initial value of the associated signal (i.e., the value of sample number 0).
DB_Group group
the signal group number. All signals in a given group are stored in the same file. If there are two or more signals in a group, the file is called a multiplexed signal file. Group numbers begin at 0; arrays of DB_Siginfo structures are always kept ordered with respect to the group number, so that signals belonging to the same group are described by consecutive entries in siarray.
int fmt
the signal storage format. The most commonly-used formats are format 8 (8-bit first differences), format 16 (16-bit amplitudes), and format 212 (pairs of 12-bit amplitudes bit-packed into byte triplets). See `<ecg/db.h>' for a complete list of supported formats. All signals belonging to the same group must be stored in the same format.
int spf
the number of samples per frame. This is 1, for all except oversampled signals in multi-frequency records, for which spf may be between 2 and DB_MAXSPF (defined in `<ecg/db.h>'). Note that non-integer values are not permitted (thus the frame rate must be chosen such that all sampling frequencies used in the record are integer multiples of the frame rate).
int bsize
the block size, in bytes. For signal files that reside on UNIX character device special files (or their equivalents), the bsize field indicates how many bytes must be read or written at a time (see section Signals That Are Not Stored in Disk Files). For ordinary disk files, bsize is zero. All signals belonging to a given group have the same bsize.
int adcres
the ADC resolution in bits. Typical ADCs have resolutions between 8 and 16 bits inclusive.
int adczero
the ADC output given an input that falls exactly at the center of the ADC range (normally 0 VDC). Bipolar ADCs produce two's complement output; for these, adczero is usually zero. For the MIT DB, however, an offset binary ADC was used, and adczero was 1024.
int baseline
the value of ADC output that would map to 0 physical units input. The value of adczero is not synonymous with that of baseline (the isoelectric or physical zero level of the signal); the baseline is a characteristic of the signal, while adczero is a characteristic of the digitizer. The value of baseline need not necessarily lie within the output range of the ADC; for example, if the units are `degrees_Kelvin', and the ADC range is 200--300 degrees Kelvin, baseline corresponds to absolute zero, and lies well outside the range of values actually produced by the ADC.
long nsamp
the number of samples in the signal. All signals in a given record must have the same number of samples. If nsamp is zero, the number of samples is unspecified, and the cksum (see the next item) is not used; this is useful for specifying signals that are obtained from pipes, for which the length may not be known.
int cksum
a 16-bit checksum of all samples. This field is not usually accessed by application programs; newheader records checksums calculated by putvec when it creates a new `header' file, and getvec compares checksums that it calculates against cksum at the end of the record, provided that the entire record was read through without skipping samples.

The number of DB_Siginfo structures in siarray is given by the nsig argument of the functions that open signal files. Input and output signal numbers are assigned beginning with 0 in the order in which the signals are given in siarray. Note that input signal 0 and output signal 0 are distinct. Input signal numbers are supplied to aduphys, physadu, adumuv, and muvadu in their first arguments. There may be no more than DB_MAXSIG (defined in `<ecg/db.h>') input signals and DB_MAXSIG output signals open at once. See section Example 5: Reading Signal Specifications, for an illustration of how to read signal specifications from DB_Siginfo structures.


Go to the first, previous, next, last section, table of contents.



George B. Moody (george@hstbme.mit.edu)