[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void setgvmode(int *mode) |
This function sets the mode used by getvec
when reading a
multi-frequency record (see section 5.4 Multi-Frequency Records). If mode is
WFDB_LOWRES
, getvec
decimates any signals sampled at multiples of
the frame rate, so that one sample is returned per signal per frame (i.e., the
oversampled signals are resampled by simple averaging of the samples for each
signal within each frame). If mode is WFDB_HIGHRES
, each sample
of any oversampled signal is returned by successive invocations of
getvec
, and each sample of any signal sampled at a lower frequency is
returned by two or more successive invocations of getvec
(i.e., the less
frequently sampled signals are resampled using zero-order interpolation).
getvec
operates in WFDB_LOWRES
mode by default.
WFDB_LOWRES
and WFDB_HIGHRES
are defined in `<wfdb/wfdb.h>'.
In WFDB library version 9.6 and later versions, setgvmode
also affects
how annotations are read and written. If setgvmode(WFDB_HIGHRES)
is
invoked before using annopen
, wfdbinit
, getvec
,
sampfreq
, strtim
, or timstr
, then all WFDB_Time
data (including the time
attributes of annotations read by getann
or written by putann
) visible to the application are in units of the
high-resolution sampling intervals. (Otherwise, WFDB_Time
data are in
units of frame intervals.)
Version 10.4 and later versions of the WFDB library support two modes
of handling invalid or missing samples. By default, getframe
,
getvec
, and sample
return the special value
WFDB_INVALID_SAMPLE
in such cases. If mode is
WFDB_GVPAD
+ WFDB_LOWRES
or
WFDB_GVPAD
+ WFDB_HIGHRES
,
however, these functions replicate the previous
valid sample whenever they encounter an invalid or missing sample,
which may simplify the design of applications such as digital filters.
The constant WFDB_GVPAD
is defined in `<wfdb/wfdb.h>'.