[Math] Removing FFT peak at 0 Hz

fast fourier transformpython

I am taking a fft plot in python and getting the intended spike at the oscillation frequency. However, there is a large peak at 0 Hz.

I tried the following three methods with no impact:

  1. data – data.mean() – thus subtracting the mean from the data and then taking the fft
  2. signal.detrend(data, type = constant) – so detrending the original data and then taking fft
  3. sos = signal.cheby1(2, 1, 0.00001, 'hp', fs=fs, output='sos') – applying this high pass chebyshev filter at cutoff frequency 0.00001 Hz. This is not removing the peak at 0 Hz but removing the oscillation peak at 0.25 Hz.

Please let me know if there is something else that I can try to remove the peak at 0 Hz.

Best Answer

The frequency at 0 Hz is equal to the mean of the data.

So you can just discard that frequency if it does not interest you. Subtracting the mean before calculating the FFT has the same effect. If it doesn't then there is a calculation mistake.

Related Question