Next: NGUESS(1) Up: WFDB Applications Guide Previous: MRGANN(1)On This Page


mxm - ANSI/AAMI-standard measurement-by-measurement annotation comparator


mxm -r record -a reference-annotator test-annotator [ options ... ]


This program implements the measurement-by-measurement comparison algorithm specified in ANSI/AAMI EC38:1998, the American National Standard for ambulatory ECGs, for evaluating heart rate measurements. Its use is not restricted to comparisons of these particular types of measurements, however; if other types of measurements (e.g., HRV measurements) are available, they may be compared in the same way by mxm.

Input to this program consists of two annotation files associated with the same record. One of these is designated the reference annotation file, the other the test annotation file.

Options include:

-f time
Begin the comparison at the specified time (default: 5 minutes after the beginning of the record).
Print a usage summary.
-l file
Append a line-format report to file (see below).
-L file
Same as -l file.
-m n
Compare measurement type n (default: n = 0).
-s file
Append a standard-format report to file (see below).
-t time
Stop the comparison at the specified time (default: the end of the record if it is defined, the end of the reference annotation file otherwise; if time is 0, the comparison ends when the end of either annotation file is reached).
Calculate unnormalized RMS measurement error (see below).

mxm reads the annotation files, ignoring all annotations except for those with anntyp = MEASURE and subtyp = n (where n is the measurement type selected using the -m option). The measurements to be compared are extracted from the aux fields of these annotations, which should contain strings with the measurements in scanf(3) %lf format (e.g., ‘‘85’’, ‘‘-12.4’’, ‘‘1.2e3’’). A measurement error is calculated for each test measurement by comparing it with the reference measurement that is nearest in time. By default, mxm reports the normalized RMS measurement error (i.e., the square root of the sum of the squares of the differences between the test and reference measurements, divided by the sum of the reference measurements). If the -u option is given, mxm reports the unnormalized RMS measurement error (the square root of the sum of the squares of the differences between the test and reference measurements, divided by the number of test measurements); this may be useful if the measurement has a zero mean (or a mean value that is significantly smaller than the mean absolute value). The mean reference measurement that mxm reports is the mean of the reference measurements that are actually used in the comparison; since there is not necessarily a one-to-one correspondence between test and reference measurements, some reference measurements may not be included in the mean, and others may be included more than once.

If ‘-’ is given as a file argument, reports are written on the standard output. If no options are specified, mxm writes standard reports on the standard output (equivalent to using the option -s -). The output generated by selecting -l or -L includes column headings only if a file other than ‘-’ is specified, and only if the specified file does not already exist. In this way, mxm can be used repeatedly to build up a line-format table for multiple records, for further processing by sumstats(1) .


non-standard comparison selected
The -f, -t, and -u options modify the comparison in ways not permitted by the draft standard.
reference measurements have zero mean
Normalized RMS measurement error cannot be determined. Try using the -u option.


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

See Also

bxb(1) , ecgeval(1) , epicmp(1) , rxr(1) , setwfdb(1) , sumstats(1)
Evaluating ECG Analyzers (in the WFDB Applications Guide)
American National Standard ANSI/AAMI EC38:1998, Ambulatory Electrocardiographs; available from AAMI, 1110 N Glebe Road, Suite 220, Arlington, VA 22201 USA (


George B. Moody (


Table of Contents

Up: WFDB Applications Guide

Please e-mail your comments and suggestions to, or post them to:

MIT Room E25-505A
77 Massachusetts Avenue
Cambridge, MA 02139 USA

Updated 8 March 2019