I am new at signal processing. I am trying to compute and plot FFT of a given dataset. The dataset corresponds to vibration signals captured using accelerometer.
The problem that I am facing is when I try to take FFT of the data, it does not provide peaks in the data. There are random peaks, I am unable to understand why such random peaks are generating. The code I am using is given below.
output
from scipy.fft import fft
import scipy.fftpack
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
excel_file_path = 'file.xlsx'
a1 = pd.read_excel(excel_file_path)
N = a1.size # data size
T = 1.0 / 100 # inverse of sampling rate
x = np.linspace(0.0, N*T, N)
y = a1.values
y= y - np.mean(y)
yf = np.abs(fft(y))
#xf = scipy.fftpack.fftfreq(a1.size, d=T)
x = scipy.fftpack.fftfreq(yf.size, 1 / 100)
fig, ax = plt.subplots()
# ax.plot(np.abs(xf), np.abs(yf))
ax.plot(x[:x.size//2], abs(yf)[:yf.size//2])
plt.show()
link to the dataset:
https://www.dropbox.com/scl/fi/33mwe0esekdbfmlo0x8be/dataset.xlsx?rlkey=lq4frtwcja09iauwnifnt3o0u&st=bov1e0uy&dl=0
Snehal Shende is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.