MATLAB File Help: rdsamp | View code for rdsamp | WFDB Contents

rdsamp

    function varargout=rdsamp(varargin)

     [tm,signal,Fs]=rdsamp(recordName,signaList,N,N0,rawUnits,highResolution)

        Wrapper to WFDB RDSAMP:
             http://www.physionet.org/physiotools/wag/rdsamp-1.htm

     Reads a WFDB record and returns:

     signal
           NxM matrix (doubles) of M signals with each signal being N samples long.
           Signal dataype will be either in double int16 format
           depending on the flag passed to the function (according to
           the boolean flags below).

     tm
           Nx1 vector of doubles representing the sampling intervals
           (elapsed time in seconds).

     Fs    (Optional)
           1x1 Double, sampling frequency in Hz of the first signal in signalList
           (default =1).

     Required Parameters:

     recorName
           String specifying the name of the record in the WFDB path or
           in the current directory.

     Optional Parameters are:

     signalList
           A Mx1 array of integers. Read only the signals (columns)
           named in the signalList (default: read all signals).
     N
           A 1x1 integer specifying the sample number at which to stop reading the
           record file (default read all = N).
     N0
           A 1x1 integer specifying the sample number at which to start reading the
           record file (default 1 = first sample).

     rawUnits
           A 1x1 integer (default: 0). Returns tm and signal as vectors
           according to the following values:
                   rawUnits=0 -returns tm and signal as integers in samples (signal is in DA units )
                   rawUnits=1 -returns tm and signal in physical units with double precision
                   rawUnits=2 -returns tm and signal in physical units with single precision (less memory requirements)
                   rawUnits=3 -returns tm and signal as 16 bit integers (short)
                   rawUnits=4 -returns tm and signal as 32 bit integers (long)

     highResolution
          A 1x1 boolean (default =0). If true, reads the record in high
          resolution mode.

     Written by Ikaro Silva, 2013
     Last Modified: January 15, 2014
     Version 1.1

     Since 0.0.1

     %Example 1- Read a signal from PhysioNet's Remote server:
    [tm, signal]=rdsamp('challenge/2013/set-a/a01',1,1000);
    plot(tm,signal(:,1))

    %Example 2-
    [tm,signal,Fs]=rdsamp('mghdb/mgh001', [1 3 5],[],1000);

    %%Example 3- Read single precision data
    [tm,signal,Fs]=rdsamp('mghdb/mgh001', [1 3 5],[],100,2);

     See also WFDBDESC, PHYSIONETDB