A common problem in signal processing
is to determine the shape of a recurring waveform in the presence of noise.
If the waveform recurs periodically (for example, once per second) the
signal can be divided into segments of an appropriate length (one second
in this example), and the segments can be averaged to reduce the amplitude
of any noise that is uncorrelated with the signal. Typically, noise is
reduced by a factor of the square root of the number of segments included
in the average. For physiologic signals, the waveforms of interest are
usually not strictly periodic, however. sigavg averages such waveforms
by defining segments (averaging windows) relative to the locations of waveform
annotations.

sigavg requires a WFDB record containing any number of signals
to be averaged, and an annotation file containing markers (fiducial points)
that define a fixed point in the averaging window for each waveform. By
default, all QRS (beat) annotations for the specified annotator are included
in an average that begins 50 ms before the annotation and ends 50 ms after
the annotation. The output is in text form, with times (in seconds, relative
to the annotations) of each sample in the first column, and averages for
each signal in the remaining columns.