Recently I do simulation on Lorentzian Function with FFT
Lorentzian Function is 2a/(x**2+a**2)
import numpy as np
from scipy import fft
import matplotlib.pyplot as plt
a =1
N = 500
x =np.linspace(-30,30,N)
lorentz = (2*a) * (1/(a**2 + x**2))
fourier = (fft.fft(lorentz))
fig, (ax1) = plt.subplots(nrows=1, ncols=1)
ax1.loglog(abs(fourier[0:int(N/2)]),basey=np.e)
ax1.grid(True)
plt.show()
According to contour integration, it's supposed to be exp(-|k|*a)
It's supposed to be linear,when I plot it on log
scale.
But there are some oscillation on it.
when I extend my points till
x = np.linspace(-100,100,N)
The oscillation seems postpone.
I could not figure out the reason of oscillation.