A medical device is directed to techniques for removing polarization
artifacts from electrical activity signals in order to detect presence of
an evoked response. More specifically, a medical device receives a signal
that represents electrical activity within a heart of a patient following
delivery of a stimulation pulse to the heart and reconfigures a filter
state of a filter from an initial filter state to remove the polarization
artifact from the electrical activity signal in order to determine
whether a cardiac event, such as an evoked response has occurred. The
medical device may, for example, when the filter of the medical device is
a digital filter, recalculate the values of digital filter components
using the present input value of the electrical activity signal as a
direct current (DC) input value of the digital filter.