I was trying to perform an inverse Fourier transform using np.fft.ifft on a set of data, but I was confused about how to create the appropriate domains. I did one example about np.fft.fft where it transforms a function from time domain to (angular) frequency, here are the domains I built:
t = np.arange(-N,N)*dt # time domain
df = 1/(2*N*dt)
w = np.arange(-N,N)*df*2*np.pi # angular frequency domain
The reason why I multiplied 2pi here is because I think Python gives me output in f and w = 2*pi*f, and it all worked out correctly. However, I was confused when I was doing a ifft from k domain to r domain for a different physical problem(I'm assuming k here is wave number, and r maybe radial distance):
r = np.arange(-N,N)*dr # (radial) distance domain
dk = 1/(2*N*dk)
k = np.arange(-N,N)*dk # wave number domian
Here I did not multiply k with 2*np.pi since we don't have the relation as w and f do, but I got wrong result and apparently if I did multiply k by 2pi as I did with w then I have correct result. Can someone explain?
(The only reason I can think of to get a 2pi in there is the relation k = 2pi/lambda, but it doesn't really fit)