Next: WFDBCAT(1) Up: WFDB Applications Guide Previous: WFDB-CONFIG(1) | On This Page |
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 (see http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/matfile_format.pdf for details). 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:
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.
It may be necessary to set and export the shell variable WFDB (see setwfdb(1) ).
Please e-mail your comments and suggestions to webmaster@physionet.org, or post them to:
PhysioNetUpdated 28 July 2009