An FIR filter is being used to remove the DC of an ECG. The sampling rate is 500Hz. How many taps would said FIR filter require (theoretically and practically) to filter out the DC.

P.S. the filter would be a high-pass filter and would not remove the 1Hz fundamental frequency component of the ECG.


1 Answer 1


See How many taps does an FIR filter need?

In your case you'd need more than 1000 taps depending on the allowable ripple, as your cut-off frequency is less than fs/500.

Alternatives :

  1. use an IIR, a simple order-1 DC removal filter could work great

  2. Average your signal and subtract the average in order to remove the DC

  3. Rick Lyons proposes a clever implementation of an FIR DC removal filter using cascaded-integrator-comb filters here https://www.dsprelated.com/showarticle/58.php

  • 2
    $\begingroup$ Thanks Ben! I liked the link to Rick Lyons implementation. $\endgroup$ Commented Nov 21, 2019 at 3:58
  • 1
    $\begingroup$ I'm not an ECG expert, but I've been in similar conversations before. In general, any filter that rings is not a good filter to use with an ECG -- the filter ringing can generate artifacts that look like symptoms, or can mask symptoms. It's one of the places (I'm told) where an IIR filter is often best. $\endgroup$
    – TimWescott
    Commented Nov 22, 2019 at 0:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.