# Using the discrete fourier transform to approximate the regular fourier transform

This may be an elementary question, but I'm not sure how DFT/FFT is used to approximate regular Fourier transforms.

Consider the radial distribution function $g(r)$. The structure factor is defined as $$S(q) = 1 + \rho \int_V d\vec{r} e^{-i\vec{q}\vec{r}} g(r)$$ and consider only the integral part of the above. The integral part is the Fourier transform of $g(r)$.

Now I don't know if there is any straightforward way to calculate that part using a DFT/FFT, what I would do is the following.

First convert to spherical coordinates, $$\int_V d\vec{r} e^{-i\vec{q}\vec{r}} g(r) = 2\pi \int_{-1}^{1}d\cos{\theta} \int_{0}^{r_{max}}dr r^2 e^{-iqr \cos\theta}g(r) = \frac{4 \pi}{q} \int_{0}^{r_{max}}dr r \sin{qr} g(r)$$ We can write this as, $$Im\left(\frac{4 \pi}{q} \int_{0}^{r_{max}}dr g(r)re^{iqr}\right)$$ Then, discretization gives, $$Im\left(\frac{4 \pi}{q} \sum_{n=0}^{k}\frac{r_{max}}{k} g(n\frac{r_{max}}{k})n\frac{r_{max}}{k}e^{iqn\frac{r_{max}}{k}}\right) = Im\left(\frac{4 \pi r_{max}^2}{k^2q} \sum_{n=0}^{k} n g_n e^{-i 2\pi \frac{q'}{k} n}\right)$$ Now if I haven't done any mistakes, the sum is the discrete Fourier transform definition, with $x_n = ng_n$ and I set $q' = \frac{qr_{max}}{2\pi}$. Now I can use DFT/FFT to calculate it.

As you see, it took quite a few calculations to arrive at the correspondence. The question thus is if there is any direct correspondence between regular Fourier transform and DFT/FFT so that the above intermediate steps can be avoided.

In two dimensions, you would have ended with a Hankel transform. There exists some techniques for fast Hankel transforms, which could also be applicable to your problem. One trick is to turn the problem into a convolution, for example by transforming to logarithmic coordinates. Then the FFT can be used for the convolution.

It seems that you arrived at a formulation of your problem which is even more directly accessible to an FFT approach.

Regarding your question about the direct correspondence between Fourier transform and DFT/FFT, you are mixing dimensions here. Why should a three dimensional radial symmetric Fourier transform have a direct correspondence with a one dimensional DFT/FFT? There are correspondences and the FFT can be used for fast evaluations, but of course these correspondences are not direct.