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

Recent changes

This section contains a brief summary of changes to the WFDB library and to this guide since the first printing of the tenth edition of this guide in June, 1999. See `NEWS', in the top-level directory of the WFDB Software Package distribution, for information on any more recent changes that may not be described here.


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

Changes in version 10.4.0

Version 10.4.0 and later versions of the WFDB library are intended to be compiled using ANSI/ISO C (and C++) compilers only; previous versions also supported the use of traditional (K&R) C compilers. The most obvious change resulting from this decision is in the use of prototypes in function declarations, an innovation of ANSI C that permits better error-checking by compilers. The ANSI/ISO C standard is now more than 15 years old, and it has been over 10 years since a C compiler that does not support function prototypes was used for development of the WFDB library. Code in `wfdbio.c' that provides limited support for compilers that do not provide an ANSI/ISO C library has been retained for now, and `wfdb.h' still includes a set of K&R C function declarations; both of these features are deprecated, however, and may be removed in future versions of the WFDB library. Users who still need to use a K&R C compiler to compile the library itself may find 'unprotoize' (included in the GNU gcc distribution) to be helpful.

The mapping of lowest expressible sample values to WFDB_INVALID_SAMPLE performed by getframe() (in `lib/signal.c') did not work properly for signal formats 80 and 160 (in which samples are recorded as unsigned integers); this has now been corrected.

The symbol WFDB_GVPAD is newly defined in `<wfdb/wfdb.h>'. It may be added to WFDB_HIGHRES or WFDB_LOWRES and given as input to setgvmode(). The effect of doing so is that missing samples, and samples recognized as invalid, are replaced by getframe(), getvec(), and sample() with the most recently read valid values rather than by the special value WFDB_INVALID_SAMPLE. This behavior allows applications such as digital filters to remain ignorant of missing data without significant performance penalties.

sample() now checks that its signal number input is valid, and returns WFDB_INVALID_SAMPLE if not. In previous versions, sample returned a sample from signal 0 if the requested signal was unavailable.

sample_valid() now returns -1 in the case of a signal that becomes unavailable before the end of the record (previous versions returned 1 in this case).

The FIR filter example (see section Example 7: A General-Purpose FIR Filter) now works properly. The previous version always began processing the input at sample 0, regardless of start time specified in its argument list.


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

Changes in version 10.3.17

This version is the first to support reading variable-layout records (multi-segment records in which the number, arrangement, gains, and baselines of the signals may vary from one segment to the next; see section Multi-Segment Records).

Rounding errors in the WFDB library's mstimstr function have been reduced. Previous versions did not always round appropriately when the sampling frequency was much less than 1 Hz.

The maximum length for a record name (WFDB_MAXRNL, defined in `wfdb.h') has been increased from 11 to 20.

A new constant, WFDB_INVALID_SAMPLE, is now defined in `wfdb.h'. It is used to identify padding inserted to fill in for missing data. When writing in any format that uses fewer than 16 bits per sample, putvec maps WFDB_INVALID_SAMPLE to the lowest (most negative) value expressible in that format; when reading a signal file in such a format, getframe performs the inverse mapping, so that missing data can be identified regardless of the data format.

A side effect of this change is that (for example) any samples that had the most negative value (for example, -2048 in a format 212 signal file) are now flagged as invalid. To treat such samples as invalid is reasonable, however, since these occur only when the input level falls below the working range of the analog-to-digital converter.


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

Changes in version 10.3.16

Benjamin Moody has added an interface between the WFDB library and libcurl as an alternative to the existing libwww interface, and has updated `configure' and `conf/*.def' to search for and use libcurl if it is available. The primary advantages of libcurl over libwww are that libcurl is smaller and faster, it supports access to password-protected files, and it is actively maintained. Both libraries are freely available on all popular platforms.

Isaac Henry has updated configure to support building a native MS-Windows version of the WFDB library using either Cygwin gcc or MinGW gcc.

A number of minor changes, mostly involving conditional use of `malloc.h', `stdlib.h', and `string.h', were made to eliminate warnings from gcc 4.x.


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

Changes in version 10.3.15

Rules for generating the binary tarball for MS-Windows have been fixed so that the Cygwin DLLs are now included with correct permissions.

Installation of shared libraries under GNU/Linux requires an extra step if SELinux is enabled (as under Fedora Core 2 and later); this has been incorporated into `conf/linux-slib.def'.


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

Changes in version 10.3.14

Guido Muesch reported that getspf() did not always return correct results if the frame frequency does not have an exact representation as a double precision floating point number. This problem has now been corrected.


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

Changes in version 10.3.13

Using an indirect WFDB path (i.e., setting the WFDB environment variable to a value such as `@FILE', where `FILE' contains the desired path) was broken in WFDB library versions 10.3.9 through 10.3.12; it now works again, thanks to a patch contributed by Fred Geheb.


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

Changes in version 10.3.12

Okko Willeboordse pointed out an incompatibility between the native MS-Windows API and the ANSI/ISO C library function mkdir, which is used by the WFDB library. This does not present a problem when compiling the WFDB library using the supported Cygwin/gcc compiler under MS-Windows, nor does any related problem occur on any other platform. It should now be a little easier to compile the WFDB library using unsupported compilers, thanks to a new MKDIR macro that hides the incompatibility (see `lib/wfdblib.h0').

Piotr Wlodarek initiated a discussion about memory leaks in the WFDB library, citing as an example the 'trivial example program in C' from this Guide, which does not free memory it allocates in isigopen() when reading the signal specifications. This problem can be avoided by invoking wfdbquit() in the example program, just before exiting. Further discussion of this point has been added to this Guide following the presentation of the 'trivial example', and in the description of wfdbquit.


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

Changes in version 10.3.11

In `signal.c', several bugs have been identified and fixed. Thanks to Piotr Wlodarek, who found a buffer overrun in isigopen. Also, isgsettime sometimes performed incorrect seeks on multifrequency records that had been opened in high-resolution mode; this has been fixed, together with a related bug that caused the value returned by strtim("e") to be calculated incorrectly in some such cases.


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

Changes in version 10.3.10

In version 10.3.9, the functions setannstr, setanndesc, and setecgstr did not contain necessary checks to avoid invoking strcmp with a NULL argument. These checks have been added in version 10.3.10. Thanks to Thomas Heldt for reporting this problem.


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

Changes in version 10.3.9

The WFDB library functions setwfdb, setannstr, setanndesc, and setecgstr now copy their input string arguments, so that it is no longer necessary for WFDB applications to keep these strings valid. If you have created applications that rely on being able to modify these strings, it will be necessary to invoke the corresponding functions again before such changes will take effect within the WFDB library.

Previous versions of the WFDB library function putinfo did not flush their output until either a new header file was created (via setheader or newheader) or the process exited. This has now been corrected, and putinfo output is now flushed before putinfo returns. Thanks to Jonas Carlson for reporting this problem.


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

Changes in version 10.3.8

The WFDB library function setbasetime() now properly accepts arguments specifying midnight (e.g., `0:0:0'), which previous versions rejected, and the function setheader() records such times correctly in the `.hea' files it creates.

(WFDB library version 10.3.7 was identical to 10.3.6.)


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

Changes in version 10.3.6

The fix applied in isigclose() in 10.3.5 was incomplete but is now (really!) fixed. Applications that use sample() should call wfdbquit() to be certain that sample's buffer is freed before exiting.

Some long-standing problems in the code (in `lib/wfdbio.c') that handles http range requests for NETFILES-enabled versions of the library have been partially addressed. The underlying issue is that http servers do not always return the range of bytes requested; when this happens, it is not difficult to determine that there is a problem, but it is tricky to figure out what to do about it. Based on experiments with several different http servers, the strategy for handling such problems within the WFDB NETFILES code has been improved substantially, but there may be further room for improvement.


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

Changes in version 10.3.5

Fixed a bug in WFDB library function isigclose() (in `lib/signal.c') that had caused sample()'s buffer to be freed inappropriately when switching segments in a multi-segment record. Thanks to Dave Schaffer for the bug report and for a test case that illustrated the bug.

(WFDB library versions 10.3.3 and 10.3.4 were identical to 10.3.2.)


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

Changes in version 10.3.2

Fixed a WFDB library bug that caused annotation sorting to fail if a new header file had been written. Thanks to Winton Baker for reporting this problem and for providing an example that illustrated the bug.

(WFDB library version 10.3.1 was identical to 10.3.0.)


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

Changes in version 10.3.0

Fixed bugs in `lib/signal.c' that caused improper accounting of signal group numbers when reading from two or more records at the same time (as in `nst'), a bug that caused a segfault in `nst', and a bug that referenced uninitialized memory in newheader if nsig = 0.

The WFDB Software Package has been ported to Mac OS X (Darwin), version 10.2 (the port should also work under 10.1 but this has not been tested and will not be supported).

It is now possible to generate a shared WFDB library (DLL) under MS-Windows using Cygwin/gcc.

Added functions sample and sample_valid to the WFDB library (in `lib/signal.c'). sample(s, t) returns the sample at time (sample number) t from signal s, handling all necessary buffering internally and allowing the caller to treat the signal file as a virtual array of randomly accessible samples. sample_valid can be invoked to check if the most recent value returned by sample was valid (e.g., to see if the end of the input was reached). For an example of the use of these functions, see `app/wqrs.c'.


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

Changes in version 10.2.9

Fixed a bug in example 9 in this guide (introduced in version 10.2.0).

Updated `lib/wfdbdll.def' and the `Makefile.dos' files in several directories. These have not been tested in recent years and may need further revisions; feedback is welcome.

Corrected persistent problems with generating PDF versions of the manuals for the desired page size, and added hyperlinks to the PDF version of this guide.

(WFDB library version 10.2.8 was identical to 10.2.7.)


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

Changes in version 10.2.7

Added a workaround to wfdb_fclose (in `lib/wfdbio.c') so that closing stdin after using freopen doesn't trigger a core dump.

If out-of-order annotations were written and automatic annotation sorting was suppressed, the warning produced by oannclose (in `lib/annot.c') once again includes the correct sortann command needed to put the annotations into order. (This feature was broken by a previous revision.)


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

Changes in version 10.2.6

The new functions setifreq and getifreq allow an application to choose any convenient sampling frequency for reading input signals. Samples read from signal files using getvec are buffered, resampled, and delivered to the calling application as if the original signals had been sampled at the desired frequency. Times expressed in sample intervals passed to or from other WFDB library functions (getann, putann, mstimstr, timstr, and strtim) are rescaled as needed to match intervals corresponding to the chosen frequency. Thanks to Pat Hamilton for the inspiration!

The WFDB library now records the base time with millisecond precision (previous versions did so with one-second precision), and `xform' provides starting times to the library function setbasetime with millisecond precision. Thanks to Allavatam Venugopal for providing examples that illustrated the need for these features.

Fixed deskewing buffer initialization in getframe, broken by the 10.2.0 update, which introduced an infinite loop when reading a record that requires skew correction starting at sample 0. Thanks to Andrew Walsh for finding an example that triggered this bug.

Fixed rounding errors in adumuv, muvadu, and physadu. Previous versions rounded negative values toward zero; to obtain consistent conversions, however, it is necessary to round all values down (e.g., from -1.5 to -2 rather than up to -1).

Fixed a memory leak in wfdb_fclose (in `lib/wfdbio.h'). Thanks to Ion Gaztañaga.


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

Changes in version 10.2.5

Additions and fixes in `wfdbf.c' (the Fortran wrappers for the WFDB library).


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

Changes in version 10.2.4

Code in `wfdbio.c' that required the use of the string header to identify a header file has been revised so that the standard hea is now usable for this purpose in all cases.


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

Changes in version 10.2.3

Portability fixes in `wfdblib.h'. (WFDB library version 10.2.2 was identical to 10.2.1.)


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

Changes in version 10.2.1

Most users will no longer need to set the WFDB path explicitly, as a result of several minor changes in the default path and in the installer for the WFDB Software Package.

The environment variable WFDBNOSORT was replaced by WFDBANNSORT, and the environment variable WFDBGVMODE was introduced (see section Annotation Order, and see section Multi-Frequency Records, for details).


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

Changes in version 10.2.0

There are no longer any fixed limits on the numbers of signals or annotation files that can be opened simultaneously, or on the number of samples per signal per frame. In previous versions of the WFDB library, the symbols WFDB_MAXSIG, WFDB_MAXANN, and WFDB_MAXSPF (all defined in `<wfdb/wfdb.h>') specified limits on these parameters that could be modified only by recompiling the WFDB library. These symbols are still defined for compatibility with older applications that use them (typically to determine the size of static arrays).

Since version 10.1.1, record names may include path information (see the notes for version 10.1.1 below), but if such names are used to generate names of WFDB output files, the user has been required to ensure that the target directory exists. This requirement is eliminated in version 10.2.0. If an output file is specified to be located in a non-existent directory, the WFDB library will attempt to create the directory (including, if necessary, any non-existent parent directories). This feature simplifies the use of record names that include directory information, as is common when reading data from a CD-ROM or a web server such as PhysioNet. For example, using the WFDB path (`. http://www.physionet.org/physiobank/database'), if the current directory, `.', does not contain a subdirectory named `mitdb', the command:

 
sqrs -r mitdb/100

will read its input from http://www.physionet.org/physiobank/database/mitdb/, will create a directory named `mitdb' within the current directory, and will write its output annotation file (`100.qrs') into this newly-created directory. If we then use the command:

 
rdann -r mitdb/100 -a qrs

the header file is still read from the remote directory, but the annotation file is read from `./mitdb'. (The programs `sqrs' and `rdann' are standard applications that use the WFDB library; see the WFDB Applications Guide for details.)

Also new is the WFDB test suite (located in the `checkpkg' directory of the WFDB source tree, at the same level as the `lib' directory containing the WFDB library sources). This set of programs can be used to help verify that a newly-installed version of the WFDB library behaves properly.


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

Changes in version 10.1.6

The WFDB library requires that the record name specified in the first line of a header file must match the name of the record with which the header file is associated (this is done in order to detect corrupted or erroneously renamed header files). Version 10.1.6 requires that only the final portion of the record name (stripped of any path information) must match.


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

Changes in version 10.1.5

More changes in the `make' description files, for Cygwin compatibility.


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

Changes in version 10.1.4

The symbol WFDB_NETFILES replaces the old NETFILES.


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

Changes in version 10.1.3

More changes in the `make' description files, to support a configuration script.


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

Changes in version 10.1.2

Changes in the `make' description files.


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

Changes in version 10.1.1

Record names may contain (absolute or relative) path information as a prefix, and if (as a result) an input file is found in a location that does not appear explicitly in the WFDB path, that location is appended to the end of the WFDB path. For example, if the WFDB path is `. http://www.physionet.org/physiobank/database', and the record name `mitdb/100' is supplied to wfdbinit, the WFDB library will find the header file at http://www.physionet.org/physiobank/database/mitdb/100.hea, and will then add http://www.physionet.org/physiobank/database/mitdb/ to the end of the WFDB path so that the signal file (specified as `100.dat' in the header file) can be found.


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

Changes in version 10.1.0

Version 10.1.0 supports a new signal file format (311), and contains numerous minor changes in the NETFILES support code introduced in 10.0.1.


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

Changes in version 10.0.1

Beginning with version 10.0.1, the WFDB library supports reading not only local files, but also remote files made available by web (HTTP) or FTP servers. To make use of this feature, link your application with both the WFDB library and the libwww library (freely available for all versions of Unix, and for most recent versions of MS Windows, from http://www.w3.org/Library, or from http://www.physionet.org/physiotools/libwww/). (In some cases, notably under GNU/Linux, libwww is linked together with the dynamically-loaded version of the WFDB library, so that you do not need to link libwww explicitly.) All access to remote files is read-only. If you do not wish to allow access to remote files, or if libwww is not available for your OS, simply do not define the symbol NETFILES when compiling the WFDB library. For further details, see `wfdbio.c' in the WFDB library sources.

The WFDB environment variable may now contain whitespace (space, tab, or newline characters) as path component separators under any OS. Multiple consecutive whitespace characters are treated as a single path component separator. Use a `.' to specify the current directory as a path component when using whitespace as a path component separator. A semicolon (`;') is also acceptable as a path component separator under any OS. A colon (`:') is still acceptable as a path component separator under Unix (Linux, etc.), provided only that the colon is not immediately followed by `//'.

If the WFDB path includes components of the forms `http://somewhere.net/mydata' or `ftp://somewhere.else/yourdata', the sequence `://' is explicitly recognized as part of a URL prefix (under any OS), and the `:' and `/' characters within the `://' are not interpreted further. Note that the MS-DOS `\' is not acceptable as an alternative to `/' in a URL prefix. To make WFDB paths containing URL prefixes more easily (human) readable, use whitespace for path component separators.

Previous versions of the WFDB library that were compiled for environments other than MS-DOS used file names in the format type.record. This file name format is no longer supported.


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

Changes in version 10.0.0

Beginning with version 10.0.0, the name of the library is WFDB. All earlier versions were named DB. All library symbols have been similarly renamed, with WFDB and wfdb replacing DB and db everywhere, in names of library functions, constants, type and structure definitions, library source file names, and names of environment variables (e.g., the DB environment variable is now the WFDB environment variable).

Version 10.0.0 of the WFDB library is functionally identical with the final release (version 9.7.4) of the DB library, except for the name changes. It should be possible to recompile existing applications written for DB library version 9.x without modification, and to link them with WFDB library version 10.0.0. This is possible because two sets of #include files are provided with the WFDB library. The first set, accessible via #include <wfdb/...>, works with applications written as described in this guide. The alternate set, accessible via #include <ecg/...>, is compatible with DB 9.x applications as described in previous editions of this guide.


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

George B. Moody (george@mit.edu)