[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
int wfdbgetskew(WFDB_Signal s) |
This function returns the skew (as recorded in the `hea'
file, but in frame intervals rather than in sample intervals) of the
specified input signal, or 0 if s is not a valid input signal
number. Since sample vectors returned by getvec
or
getframe
are already corrected for skew, wfdbgetskew
is
useful primarily for programs that need to rewrite existing
`hea' files, where it is necessary to preserve the previously
recorded skews. The following code fragment demonstrates how this can
be done:
char *record; int nsig; WFDB_Signal s; static WFDB_Siginfo *si; ... if ((nsig = isigopen(record, NULL, 0)) < 1) exit(1); si = (WFDB_Siginfo *)malloc(nsig * sizeof(WFDB_Siginfo)); if (si == NULL || isigopen(record, siarray, nsig)!= nsig) exit(1); for (s = 0; s < nsig; s++) { wfdbsetskew(s, wfdbgetskew(s)); wfdbsetstart(s, wfdbgetstart(s)); } setheader(record, siarray, (unsigned)nsig); |
Note that this function does not determine the skew between
signals; the problem of doing so is not possible to solve in the
general case. wfdbgetskew
merely reports what has previously been
determined by other means and recorded in the header file for the input
record. (This function was first introduced in WFDB library version 9.4.)