I have a sinusoidal current that I am sampling at about 357k SPS. The current signal is about 3A pk-pk @ 750hz (top figure). I am wondering why when I take the fft using numpy/scipy's fft function, the amplitude of the fundamental frequency doesn't match.
I have a sample size of 8000 so I divided the fft by 8000 and multiplied by 2 to get the results below.
Current and fft calculation:
# current sense
df['current'] = (df['Viout'] - 2.5)/20/0.003
df['current_ft'] = np.fft.fft(df['current']) / 8000 * 2
Plot:
plt.subplot(211)
plt.title('current')
plt.xlabel('time [s]')
plt.ylabel('current [A]')
plt.plot(df.t_1, df.current)
plt.subplot(212)
plt.title('current fft')
plt.xlabel('frequency [Hz]')
plt.ylabel('|F(f)| / 8000 * 2')
plt.plot(df.freqz, np.abs(df.current_ft), 'o')
plt.xlim(-ax, ax)
plt.tight_layout()
plt.show()