method and apparatus for removing baseline wander from an ecg signal . the ecg signal is filtered with a high - pass filter having a variable corner frequency . in response to finding low - frequency components in the output of the high - pass filter , its corner frequency is temporarily increased . the corner frequency may decrease according to a decay function or sensing the absence of a low - frequency component in the filter &# 39 ; s output . the corner frequency may be decreased in response to sensing ecg activity .