ECG Database Applications Guide Table of Contents


db - ECG database library


#include <ecg/db.h>

int adumuv(DB_Signal s, DB_Sample adc_units)
double aduphys(DB_Signal s, DB_Sample adc_units)
char *anndesc(int annotation_code)
int annopen(char *record, DB_Anninfo *aiarray, unsigned int nann)
char *annstr(int annotation_code)
int calopen(char *calibration_filename)
char *datstr(DB_Date d)
char *dberror(void)
char *dbfile(char *type, char *record)
void dbflush(void)
int dbgetskew(DB_Signal s)
long dbgetstart(DB_Signal s)
int dbinit(char *record, DB_Anninfo *aiarray, unsigned int nann, DB_Siginfo *siarray, unsigned int nsig)
void dbquiet(void)
void dbquit(void)
void dbsetskew(DB_Signal s, int skew)
void dbsetstart(DB_Signal s, long byte_offset)
void dbverbose(void)
char *ecgstr(int annotation_code)
void flushcal(void)
int getann(DB_Annotator a, DB_Annotation *annotation)
double getbasecount(void)
int getcal(char *description, char *units, DB_Calinfo *cal)
DB_Frequency getcfreq(void)
char *getdb(void)
int getframe(DB_Sample *vector)
char *getinfo(char *record)
int getspf(void)
int getvec(DB_Sample *vector)
void iannclose(DB_Annotator a)
int iannsettime(DB_Time t)
int isgsettime(DB_Group signal_group, DB_Time t)
int isigopen(char *record, DB_Siginfo *siarray, int nsig)
int isigsettime(DB_Time t)
char *mstimstr(DB_Time t)
DB_Sample muvadu(DB_Signal s, int microvolts)
int newcal(char *calibration_filename)
int newheader(char *record)
void oannclose(DB_Annotator a)
int osigfopen(DB_Siginfo *siarray, unsigned int nsig)
int osigopen(char *record, DB_Siginfo *siarray, unsigned int nsig)
DB_Sample physadu(DB_Signal s, double v)
int putann(DB_Annotator a, DB_Annotation *annotation)
int putcal(DB_Calinfo *cal)
int putinfo(char *info)
int putvec(DB_Sample *vector)
DB_Frequency sampfreq(char *record)
int setanndesc(int annotation_code, char *annotation_description)
int setannstr(int annotation_code, char *annotation_mnemonic_string)
void setbasecount(double base_count)
int setbasetime(char *time_string)
void setcfreq(DB_Frequency counter_frequency)
void setdb(char *database_path_string)
int setecgstr(int annotation_code, char *annotation_mnemonic_string)
void setgvmode(int mode)
int setheader(char *record, DB_Siginfo *siarray, unsigned int nsig)
int setibsize(int size)
int setmsheader(char *record, char **seg_names, unsigned int nsegments)
int setobsize(int size)
int setsampfreq(DB_Frequency sampling_frequency)
int strann(char *annotation_mnemonic_string)
DB_Date strdat(char *date_string)
int strecg(char *annotation_mnemonic_string)
DB_Time strtim(char *time_string)
char *timstr(DB_Time t)
int ungetann(DB_Annotator a, DB_Annotation *annotation)


Waveform databases (including the MIT-BIH Arrhythmia Database, the AHA Database for Evaluation of Ventricular Arrhythmia Detectors, and the European ST-T Database) are accessible to applications written in C and C++ via the functions defined in the DB library. Under UNIX, programs may be linked with the DB library by using the -ldb option at the end of the C or C++ compiler command. The functions are described in detail in the reference below.


UNIX systems:

standard (statically bound) library
shareable library (bound at run-time, not available on all systems). On some systems, one of these pathnames is a link to the other, and both are needed; on others, only one of the pathnames is needed.
stubs for linking with applications that use (not needed on all systems).

The location of these files may vary on some systems.

MS-DOS/MS Windows systems:

standard (small memory model) library
large memory model library
dynamic link library for MS Windows
stubs for linking with applications that use db.dll


ECG Database Programmer's Guide (On systems that support GNU emacs, the Guide may be available on-line using emacs info; from within emacs, type control-H followed by i to find out. An HTML version may be installed on your system (in /usr/local/help/html/dbpg); the most recent version can be viewed at if you have Internet access.

The DB library can also be used with Fortran programs; see the Guide for details.


All functions that return an int indicate errors with negative values. Depending on context, zero returns may indicate success or failure. Positive values indicate success. Most errors other than EOF are accompanied by diagnostics on the standard error output.

Table of Contents