An easily implemented software digital filter is proposed for real-time monitoring of the heart. The filter performance has been tested for synthesised uncorrupted normal and abnormal electrocardiogram waveshapes and for a synthesised electrocardiogram, corrupted with two different kinds of noise respectively. The filter can also detect abnormal waveshapes in a noisy environment.