The invention relates to a filtering unit (100) for compensating baseline drift in electrocardiographic real-time applications, which comprises a finite impulse response filter unit (106) configured to generate and provide a filtered digital electrocardiographic signal, and having an impulse response h[n] consisting of a finite sequence of between 900 and 160000 consecutive Kronecker delta pulses δ[n]. The impulse response is formed by at least three consecutive sets of consecutive scaled Kronecker delta pulses, all scaled Kronecker delta pulses within a respective set having a respective constant amplitude, wherein a modulus of the sum of the amplitudes of every Kronecker delta pulse pulses is smaller than 0.1. A number of the scaled Kronecker delta pulses of at least one of the sets of Kronecker delta pulses is equal to or higher than a minimum number of samples resulting from multiplying the sampling frequency by a time span of 10-2 seconds.