  Power line interference may severely corrupt neural recordings at 50/60 Hz
and harmonic frequencies. In this paper, we present a robust and
computationally efficient algorithm for removing power line interference from
neural recordings. The algorithm includes four steps. First, an adaptive notch
filter is used to estimate the fundamental frequency of the interference.
Subsequently, based on the estimated frequency, harmonics are generated by
using discrete-time oscillators, and then the amplitude and phase of each
harmonic are estimated through using a modified recursive least squares
algorithm. Finally, the estimated interference is subtracted from the recorded
data. The algorithm does not require any reference signal, and can track the
frequency, phase, and amplitude of each harmonic. When benchmarked with other
popular approaches, our algorithm performs better in terms of noise immunity,
convergence speed, and output signal-to-noise ratio (SNR). While minimally
affecting the signal bands of interest, the algorithm consistently yields fast
convergence and substantial interference rejection in different conditions of
interference strengths (input SNR from -30 dB to 30 dB), power line frequencies
(45-65 Hz), and phase and amplitude drifts. In addition, the algorithm features
a straightforward parameter adjustment since the parameters are independent of
the input SNR, input signal power, and the sampling rate. The proposed
algorithm features a highly robust operation, fast adaptation to interference
variations, significant SNR improvement, low computational complexity and
memory requirement, and straightforward parameter adjustment. These features
render the algorithm suitable for wearable and implantable sensor applications,
where reliable and real-time cancellation of the interference is desired.
