Linear phase filtering is proposed for the removal of baseline wander and power-line frequency components in electrocardiograms. In order to reduce the large number of computations involved in the digital filtering that are necessary, the desired filter spectrum was defined periodically. Making use of the property that the spectrum period is 50 Hz, the spectrum can be realized with a considerably reduced number of impulse response coefficients. This, in combination with the necessary impulse response symmetry, leads to a reduction in the number of multiplications per output sample by a factor of 10. A suitable impulse response is designed with a pass-band ripple of less than 0.5 dB and a high stop-band attenuation. The applicability is demonstrated by applying the filtering to exercise electrocardiograms.