next up previous contents
Next: WFDB_getframe Up: Reading and Writing Signals Previous: Reading and Writing Signals   Contents


WFDB_getvec

Usage: DATA = WFDB_getvec(NSIG);  
  DATA = WFDB_getvec(NSIG, NSAMP);  
  DATA = WFDB_getvec(NSIG, NSAMP, TSTART);  
Input: NSIG: number of signals  
  NSAMP: (optional) number of samples to read  
  TSTART: (optional) sample number of the first sample to read  
Output: DATA: sample value(s)  

This function reads samples from open input signals. Typically, we prepare to use this function by

    S = WFDB_isigopen(record);
    NSIG = length(S);
to open the signals for a record of choice, and to determine NSIG, the number of signals available in the record.

To read NSAMP samples of each signal, beginning at sample number TSTART:

   DATA = WFDB_getvec(NSIG, NSAMP, TSTART);
The first sample of each signal has sample number 0 (not 1!).

To read the next NSAMP samples of each signal:

   DATA = WFDB_getvec(NSIG, NSAMP);
This form returns up to NSAMP samples, from sample number T to sample number T+NSAMP-1, where T is the input pointer (initially 0). The input pointer is incremented by the number of samples that have been read, so that a subsequent use of WFDB_getvec returns the next NSAMP samples, etc. Use WFDB_isigsettime (see section 3.4) to set the input pointer directly.

If the record is not too long, read it all at once by:

   DATA = WFDB_getvec(NSIG);
Note that recordings can be arbitrarily long and are often much larger than available memory; also note that there may be a very long delay if an entire record is read from a remote web server over a slow link.


next up previous contents
Next: WFDB_getframe Up: Reading and Writing Signals Previous: Reading and Writing Signals   Contents
George B. Moody 2005-06-02