WFDB2MAT(1)

NAME
wfdb2mat - convert WFDB-compatible signal file to Matlab .mat file

SYNOPSIS
wfdb2mat -i record [ options ... ]

DESCRIPTION

This program converts the signals of any PhysioBank record (or one in any compatible format) into a record.mat file that can be read directly using any version of Matlab, and a short record.hea text file containing information about the signals (names, gains, baselines, units, sampling frequency, and start time/date if known). In addition, wfdb2mat writes a brief summary of this information to the standard output.

The .mat and .hea output files can also be read by any WFDB application as record RECm.

This program does not convert annotation files; for that task, rdann(1) is recommended.

The output .mat file contains a single matrix named val, containing raw (unshifted, unscaled) samples from the selected record. Using various options (below), one can select any time interval within a record, or any subset of the signals, which can be rearranged as desired within the rows of the matrix. Since .mat files are written in column-major order (i.e., all of column n precedes all of column n+1), each vector of samples is written as a column rather than as a row, so that the column number in the .mat file equals the sample number in the input record. If this seems odd, transpose your matrix after reading it!

This program writes version 4 MAT-file format output files, as documented in http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/matfile_format.pdf. The samples are written as 16-bit signed integers in little-endian format, or as 8-bit unsigned integers for records that contain only 8-bit unsigned samples. Although version 5 and newer versions of Matlab normally use a different (less compact and more complex) format, they can read these files without difficulty. The advantage of version 4 MAT-file format, apart from compactness and portability, is that files in these formats are still WFDB-compatible, given the .hea file constructed by this program.

Options for wfdb2mat include:

-f time
    Begin at the specified time. By default, wfdb2mat starts at the beginning of the record.

-h  Print a brief usage summary.

-H  Read the signal files in high-resolution mode (default: standard mode). These modes are identical for ordinary records. For multifrequency records, the standard decimation of oversampled signals to the frame rate is suppressed in high-resolution mode (rather, all other signals are resampled at the highest sampling frequency).

-l interval
    Limit the amount of output to the specified time interval (in standard time format; default: no limit). If both -l and -t are used, wfdb2mat stops at the earlier of the two limits.

-s signal-list
    Convert only the signals named in the signal-list (one or more input signal numbers or names, separated by spaces; default: print all signals). This option may be used to re-order or duplicate signals.

-S signal
    Search for the first valid sample of the specified signal (a signal name or number) at or following the time specified with -f (or the beginning of the record if the -f option is not present), and begin converting at that time.

-t time
    Stop at the specified time. By default, wfdb2mat stops at the end of the record.

  Example

To convert record mitdb/200, use this command:
    wfdb2mat -r mitdb/200

This works even if the input files have not been downloaded; in this case, wfdb2mat reads them directly from the PhysioNet server.

The output files are mitdb/200m.mat and mitdb/200m.hea. Note that if a subdirectory of the current directory named mitdb did not exist already, it would be created by wfdb2mat.

ENVIRONMENT

It may be necessary to set and export the shell variable WFDB (see setwfdb(1)).

AVAILABILITY
This program is provided in the convert directory of the WFDB Software Package. Run make in that directory to compile and install it if it have not been installed already.

SEE ALSO
a2m(1), edf2mit, snip(1), wav2mit(1), xform(1), wfdb(3), header(5)

AUTHOR
George B. Moody (george@mit.edu)

SOURCES
http://www.physionet.org/physiotools/wfdb/convert/wfdb2mat.c