How to modify FFT equation in Matlab?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
ailbeildce
le 1 Fév 2018
Modifié(e) : madhan ravi
le 18 Nov 2018
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 commentaires
David Goodmanson
le 1 Fév 2018
Modifié(e) : David Goodmanson
le 1 Fév 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?
Réponse acceptée
David Goodmanson
le 2 Fév 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.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Frequency Transformations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!