I have an exponentially decaying function that I want to Fourier transform. My question is why I am not getting the same result with the analytical form and the computational one with np.fft
?
I have a function r(t)
defined as follow:
import numpy as np
fs =5e6
f0 = fs/2/102
dt = 1./fs
t = np.arange(0,0.0021544,dt)
tau = 30e-6
r = lambda t : (1/tau)*np.exp(-t/(tau))
that I want to Fourier-transform. According to the definition of the Fourier transform of this function r
I am expecting:
tp =t[0:102] # so half of a period
freq = np.fft.fftfreq(np.size(tp), d = dt)
Rf_def = np.divide(1,1+1j*2*np.pi*freq*tau) # This is the analytical definition of the fourier transform of my function r(tp)
But when I do :
Rf = np.fft.fft(r(tp))
I don't get the same result as the analytical FFT that I defined above. Why is that ?
This is a plot of the analytical form of the fourier transform so plt.plot(Rf_def)
.
This is a plot of the compututional fourier transfrom so plt.plot(Rf)
.