# Incorrect dominant frequency from FFT

DATA source: Bearing vibration data FEMTO IEEE PHM 2012 challenge.

DATA context:

• Sample rate: 25.6 kHz
• Sample period: 0.1 Seconds (2560 points)
• Motor runs at 1800 rpm

Steps taken:

1. Low pass butter filter with fc=1000Hz
2. Apply hann window
3. Apply FFT (np.fft.fft)

Problem:

The dominant frequency is at ~60Hz which is incorrect it is supposed to be nearer to 30Hz since the motor is ran at 1800RPM.(Correct me if im wrong on this.) What went wrong? Please find the code below.

Fs = 25600  # Hz
sampling_period = 0.1
N = int(Fs * sampling_period)

fc = 1000  # Cut-off frequency of the filter
w = fc / (Fs / 2)  # Normalize the frequency
b, a = signal.butter(10, w)
filter_out = signal.filtfilt(b, a, bearing1_1["horiz_acc"])

f = np.fft.fftfreq(int(N), 1/Fs)
window = np.hanning(int(N))
X = 1/N * np.abs(np.fft.fft(filter_out * window)) * 2  # Multiply by 2 for hann window power correction?


What went wrong?

1. How do you know it's wrong? Could be that you have way more energy in the first harmonic than at the fundamental.
2. Debug rule #1: test the code first with a signal where you already know the answer (say a mixture of a few sine waves). Once you have made sure that your code produces the expected result EXACTLY you can move on to real world signals.
3. Your frequency resolution seems insufficient. You only have 10 Hz of resolution, that will not give a lot of detail at 30 Hz. Keep in mind that the energy at each particular frequency will be "smeared out" across a few neighboring FFT bins, so you want enough resolution to see that.
4. Your lowpass seems way to steep. Together with filtfilt you get a 20th order filter which will have enormous amount of time domain ringing which filtfilt() unfortunately truncates and the truncation can create significant errors
• 1. The data is collected at the start of the test when the machine is healthy. The dominant frequency would then be the operating frequency which should be around 30Hz. 3. The neighbourhood of supposedly correctly dominant frequency (30Hz) is pretty flat i doubt there is more information gained from increased resolution – zza Feb 22 '19 at 8:57
• 4. I have re-implemented with a few lower order filters but unfortunately the results remain similar – zza Feb 22 '19 at 9:04