I have a couple of datasets that show a peak around the 50-60 Hz range (mostly around 55Hz and in some cases at their harmonics i.e. 100-120Hz.) In some datasets the spike is significant in comparison with other frequencies.

Before I analyse the data, I need to ensure that these spikes are not interfering with my analysis.

I was wondering what filters would be suitable especially at a larger frequency bandwidth/range (50-60 Hz.)

  • 2
    $\begingroup$ The power line frequency should be rather exact, and a deviation of a few tenths of Hz will cause the power grid to shut down for safety reasons, so a spike at 55 Hz is probably not related to power line interference. $\endgroup$ Jun 24, 2021 at 8:29
  • $\begingroup$ Adding to @SimonRichter, unless you live right on the border of two countries (or in the centre of Japan) it would be at one or the other, 50 or 60 Hz. $\endgroup$
    – pipe
    Jun 24, 2021 at 9:21
  • $\begingroup$ I thought so too, but there is no other explanation as one of the iterations is control but has a peak at 56Hz. After some investigation, I ASSUME that the following reasons are why it varies. First, the experiment uses US manufactured apparatus (i.e. designed for 60 Hz) in a country that has a power frequency of 50 Hz. Also, the experiment is run over a considerable time so some variation in peaks and leakage around a nominal peak is expected as power frequency fluctuates by up to 0.5%. If my assumptions are incorrect I'll go back to the drawing board but I don't see any other explanation. $\endgroup$
    – user58033
    Jun 24, 2021 at 11:47

2 Answers 2


Well, if I were doing this from scratch, I would do this with biquad notch filters with very high Q and adjustable coefficients. Two or three of them with frequencies that are harmonically locked. An algorithm could be measuring the difference between the notches and a "wire" and very slowly adjust the fundamental frequency and maximize that difference. probably you could put a control loop on that.


RBJ's answer is a good suggestion but can potentially result in significant phase distortion. If that's a problem, here is an alternative approach:

  1. Use a PLL to track the line frequency. Since line frequency only varies slowly over a very small amount, a fairly simple PLL will do
  2. Track amplitude and phase of the major harmonics through a running least square error fit or pseudo Fourier Transform
  3. Reconstruct the line noise and subtract it from your signal

This minimizes the "damage" to the original signal and if the line noise doesn't vary too quickly (which it typically doesn't) you can retain most of the original signal even at the line frequencies.

  • $\begingroup$ Hilmar, the phase distortion happens around the notch, where there is also big-time amplitude distortion. $\endgroup$ Jun 24, 2021 at 14:21
  • $\begingroup$ also, the higher the Q of the notch filters means the less phase distortion everywhere except right next to the notch. the notch filter has a pair of zeros smack-dab on the unit circle and a pair of poles right next to those zeros and slightly inside the unit circle. except at the notch and immediately adjacent to it, whatever the poles do to either amplitude or phase response, the zeros will nearly exactly undo. $\endgroup$ Jun 24, 2021 at 16:32

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.