1
votes

Why is the amplitude I compute far, far away from original after fast Fourier transform (FFT)?

I have a signal with 1024 points and sampling frequency of 1/120000. I apply the fast Fourier transform in Python with scipy.fftpack. I normalize the calculated magnitude by number of bins and multiply by 2 as I plot only positive values.

As my initial signal amplitude is around 64 dB, I get very low amplitude values less then 1.

Please see my code.

Signal = well.ReadWellData(SignalNDB)
y, x = Signal.GetData(numpy=np)
N = y.size      # Number of sample points 1024 ...
T = 1/120000    # sampling frequency (sec)
x = np.linspace(0.0, N*T, N)

yf = abs(fft(y)) # Perform fft returning Magnitude
xf = np.linspace(0.0, 1.0/(2.0*T), N//2) # Calculatel frequency bins

freqs = fftfreq(N, T)    

ax1=plt.subplot(211) 
ax1.plot(x,y)
plt.grid()
ax2=plt.subplot(212) 
yf2 = 2/N * np.abs(yf[0:N//2]); # Normalize Magnitude by number of bins and multiply by 2
ax2.semilogy(xf, yf2) # freq vs ampl - positive only freq    
plt.grid()    
ax1.set_title(["check"]) 
#ax2.set_xlim([0,4000])

plt.show()

Please see my plot:

My plot

EDIT:

Finally my signal Amplitude after fft is exactly what I expected. What I did.

First I did fft for signal in mV. Then I converted the results to dB as per the formula: 20*log10(mV)+60; where 60 represents 1 mV proveded by the tool manufacturer.Therefore dB values presented on a linear scale format @ the bottom plot rather than on the log format.

Please see the resulting plot below. Results

1

1 Answers

1
votes

Looks good to me. The FFT, or the Fourier transform in general, gives you the representation of your time-domain signal in the frequencies domain.

By taking a look at your signal, you have two main components : something oscillating at around 500Hz (period of 0.002s) and an offset (which corresponds to freq = 0Hz). Looking at the result of the FFT, we can see mainly two peaks : one at 0Hz and the other one could be at 500Hz (difficult to be sure without zooming on the signal).

The only relation between the intensities is defined by the Parseval's theorem, but having a signal oscillating around 64dB doesn't mean its FFT should have values close to 64dB. I suggest you take a look here.