How to modify FFT equation in Matlab?

3 views (last 30 days)
Instead of
exp(-2pi*i/n*k*j) in FFT sum (see https://www.mathworks.com/help/matlab/ref/fft.html#buuutyt-6 ), I want to have
exp(-2pi*i/R*k*j) for some arbitrary R. It's a radial Fourier basis. How can I do this with Matlab? Since I don't have access to source, I can't modify it (I don't even know if that 1/n is an essential part of FFT algorithm so maybe it cannot be changed without screwing up the algorithm).
Thank you
  4 Comments
David Goodmanson
David Goodmanson on 1 Feb 2018
Edited: David Goodmanson on 1 Feb 2018
are you using the fft to approximate the fourier integral of a continuous function, where the function is very small at the upper and lower ends of its domain?
ailbeildce
ailbeildce on 1 Feb 2018
Edited: ailbeildce on 1 Feb 2018
I think I understand what you are referring to, if then the answer is no. Here's my problem: In the paper given this link: http://ishiilab.jp/member/skibbe-h/publications/Fourier%20Harmonics_en.pdf , see Eqn 18. blm(r) is just the signal x in fft(x). w_K^R(r) is given in Eqn 8. I think you are referring to something related to spherical bessel transforms maybe? Or hankel?

Sign in to comment.

Accepted Answer

David Goodmanson
David Goodmanson on 2 Feb 2018
Hi ailbeildce
This is just a matter of setting a scale for the problem. The paper's eq. (8) shows the functions W in the fourier expansion, where k is an integer. I do not think that is good notation so I replaced k with m. If you ignore the factor of 1/sqrt® for the moment, they will later be fourier expanding any g(r) which is an arbitrary function of radius as
g(r) = sum{m} a_m * exp(2*pi*i*m*r*/R)
Here r is a continuous variable, and you want to approximate it by using an ifft. Divide R into N segments and let
delr = R/N, r = n*delr for n = 0 to N-1 **
Plugging that into the expression above gives
g(n) = sum{m = 0 to N-1} a_m*exp(2*pi*i*m*n*/N)
where it is understood that g(n) is the function at the location n*delr. This is the ifft,
g(n) = ifft(a)
and going back the other direction with the fft, will give you the coefficients a_m.
Then there is the issue of normalization. In Matlab the fft has no factors in front of the sum and the ifft has a factor of 1/N in front. They want a factor of 1/sqrt® in front of the ifft which I believe leads to
g = N/sqrt(R) ifft(a)
a = sqrt(R)/N fft(g)
although you would have to check that carefully to make sure it agrees with what they are doing. But whatever the factors in front of fft and ifft, if their product equals one then doing g = ifft(a) and going back with a = fft(g) is sure to give you what you started with.
** Since Matlab cannot use 0 for an index, everything ends up being shifted over by one, but the basic idea is correct.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!