I have a time series sensor data. It is for a period of 24 hours sampled every minute (so in total 1440 data points per day). I did a fft on this to see what are the dominant frequencies. But what I got is a very noisy fft and a strong peak at zero. 1. I have already subtracted the mean to remove for the DC component at bin 0. But I still get a strong peak at zero. I'm not able to figure what could be the other reason or what should I try next to remove this. 2. The graph is very different from I have usually seen online as I was learning about fft. In the sense, I'm not able to see dominant peaks like how it is usually seen. Is my fft wrong? Attaching code that i tried and images:

import numpy as np
from matplotlib import pyplot as plt
from scipy.fftpack import fft,fftfreq
N = 1440
# sample spacing
T = 1.0 / 60
yf = fft(x)
yf_abs = abs(yf).tolist()
freqs = fftfreq(len(x), 60)

Amplitude vs Freq - FFT curve

Since I'm new to this, I'm not able to figure out where I'm wrong or interpret the results. Any help will be appreciated. Thanks! :)

  • $\begingroup$ I (probably we) cannot tell without looking at the data. When you remove the mean, the value at DC or zero should be zero (and seems to be from the graph). The magnitude spectrum does not look noisy either. $\endgroup$ Jun 13, 2020 at 16:14
  • $\begingroup$ If Dan Bochen's answer is correct (bin 0 has zero value) then this question as written has been answered. I think the larger question you need to ask -- separately -- is "why does my data have unexpectedly high low frequency content?". Show us what you've done, your FFT result, and the input data. Frankly, I'm suspecting that there's a trend in your data, or some daily variation. $\endgroup$
    – TimWescott
    Nov 10, 2020 at 21:20

1 Answer 1


You must be assuming you have a dominant peak at zero from only looking at the same graph you shared, but if you really did remove the mean, then value at bin 0 will be 0 (as bin 0 is directly proportional to the mean). Inspect the data carefully as their does not appear to be anything wrong with the code with respect to the FFT.

What is likely occurring is the bins close to bin 0 are non-zero, and these represent the lowest frequency fluctuations in your data. Each of these is zero-mean, but represent the slowest changing frequency components. In this case you are getting the exact results expected, representing what is in your actual data.


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.