Next: WRANN(1) Up: WFDB Applications Guide Previous: WFDBWHICH(1)On This Page


wqrs - single-channel QRS detector based on length transform


wqrs -r record [ options ... ]


wqrs attempts to locate QRS complexes in an ECG signal in the specified record. The detector algorithm is based on the length transform. The output of wqrs is an annotation file (with annotator name wqrs) in which all detected beats are labelled normal; the annotation file will also contain optional J-point annotations if the -j option (see below) is used.

wqrs can process records containing any number of signals, but it uses only one signal for QRS detection (signal 0 by default; this can be changed using the -s option, see below). wqrs is optimized for use with adult human ECGs. For other ECGs, it may be necessary to experiment with the sampling frequency as recorded in the input record’s header file (see header(5) ), the detector threshold (which can be set using the -m option), and the time constants indicated in the source file.

wqrs optionally uses the WFDB library’s setifreq function to resample the input signal at 120 or 150 Hz (depending on the mains frequency, which can be specified using the -p option). wqrs performs well using input sampled at a range of rates up to 360 Hz and possibly higher rates, but it has been designed and tested to work best on signals sampled at 120 or 150 Hz.

Options include:

Dump the raw and length-transformed input samples in text format on the standard output, but do not detect or annotate QRS complexes.
-f time
Begin at the specified time in record (default: the beginning of record).
Print a brief usage summary.
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).
Find and annotate J-points (QRS ends) as well as QRS onsets.
-m threshold
Specify the detection threshold (default: 100 microvolts); use higher values to reduce false detections, or lower values to reduce the number of missed beats.
-p frequency
Specify the power line (mains) frequency used at the time of the recording, in Hz (default: 60). wqrs will apply a notch filter of the specified frequency to the input signal before length-transforming it.
Resample the input at 120 Hz if the power line frequency is 60 Hz, or at 150 Hz otherwise (default: do not resample).
-s signal
Specify the signal (number or name) to be used for QRS detection (default: 0).
-t time
Process until the specified time in record (default: the end of the record).
Verbose mode: print information about the detector parameters.


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


To mark QRS complexes in record 100 beginning 5 minutes from the start, ending 10 minutes and 35 seconds from the start, and using signal 1, use the command:
   wqrs -r 100 -f 5:0 -t 10:35 -s 1

The output annotations may be read using (for example):
   rdann -a wqrs -r 100

To evaluate the performance of this program, run it on the entire record, by:
   wqrs -r 100

and then compare its output with the reference annotations by:
   bxb -r 100 -a atr wqrs

See Also

bxb(1) , ecgpuwave(1) , rdann(1) , setwfdb(1) , sqrs(1)

Zong W, Moody GB, and Jiang D. A robust open-source algorithm to detect onset and duration of QRS complexes. Computers in Cardiology 30:737-740 (2003).


Wei Zong ( and 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