During the fault transient process, the accurate extraction of power-frequency components is affected by the decaying dc and other transient components existing in the transient voltage and current signals. This paper proposes a novel filtering algorithm to extract the accurate fundamental and integer harmonic frequency component by means of a set of linear equations, which is transformed from a non-linear equation representing the error in discrete Fourier transform affected by decaying dc. Meanwhile, by analyzing the discrete integral error, a correctional scheme is proposed. Extractions from several typical signals and analysis of the frequency response characteristics prove that the proposed algorithm is accurate and stable and has the anti-interference ability for non-integer harmonic frequency component. Extensive tests of fault location show that the algorithm can efficiently improve the precision of fault location during the transient process.