So I have a (visually) very noisy time series signal and I have applied the fast Fourier transform using numpy's fft function. I am wondering why I am seeing the magnitude of the coefficient for the first frequency very large, actually equal to the number of samples ( 256 samples ) in the data, and the rest of the coefficients very low.

I am assuming this means there there is no periodic signal being extracted from the data, but I wanted to get a second opinion about it. How do I interpret this result? Maybe I am doing something wrong.

Input Signal: Input Signal

Frequency Coefficients: Picture of Frequency Coefficients

Zoomed Picture: Zoomed Picture

  • $\begingroup$ That's not particularly noisy. You have just zoomed in a lot. $\endgroup$ – mathreadler Nov 30 '19 at 15:31

That's correct. It's simply a property of your signal: your signal has very small "wiggles" with a very large mean value. Your mean value is about 1 and your wiggles are around 0.01 we would expect the first frequency to be about 100 times larger then all the frequencies.

The first frequency represents the DC component (at 0 Hz), it's simply the sum of the signal.

  • $\begingroup$ I see, so it would probably be better to center the data around zero before applying the transform then? I will try it but would you expect this to change the output from the transform besides this first frequency? $\endgroup$ – jeffery_the_wind Nov 30 '19 at 15:42
  • 2
    $\begingroup$ That would depend on how you define center. For example, if you subtract a constant value from your signal, that would affect only the first (0Hz) frequency. If you high pass filter the signal, the first several bins may be affected, depending on the filter characteristics. $\endgroup$ – Dan Szabo Nov 30 '19 at 15:46
  • 1
    $\begingroup$ @jeffery_the_wind: subtracting the mean will force the first frequency to be zero. Whether this is the "best" thing to do really depends on your specific application and requirements $\endgroup$ – Hilmar Nov 30 '19 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.