Fourier transform to reciprocal space vs. time-frequency transform
5 views (last 30 days)
Show older comments
I have been trying to take an FFT of a function in real space to calculate an analagous quantity in "reciprocal space". My understanding is this is the same as the regular FFT from the time to frequency domain. The calculation should be:
which often in physics is taken as a radial Fourier transform, i.e.,
where ρ is the density of the fluid. Attached is what and should look like in a model system. I imagine I can just follow Eq. 1. I have the data for for that model system, so I do the following:
nfft = 2^nextpow2(length(gr));
dt = r(2) - r(1);
df = 1/dt;
Freq = (df/2)*linspace(0,1,nfft/2+1);
sk = fft(gr,nfft)/length(gr);
And then I think I should take the one-sided FFT and the amplitude following Eq. 1, so I plot the following:
plot(Freq,1+rho*2*abs(sk(1:numel(Freq))))
But I get something radically different (attached) from the known case. Note k is interchangeable with q. So I'm doing something wrong, but any ideas what?
0 Comments
Answers (1)
Star Strider
on 23 Mar 2022
There appears to be a very high D-C (constant offset) component. That is equivalent to the mean of the signal, so subtracting it before taking the Fourier transform could help.
Perhaps:
sk = fft(gr - mean(gr),nfft)/length(gr);
will be closer to what you want.
Also, using the resample functon to resample the original ‘gr’ signal to a finer (higher) sampling rate might produce a smoother plot. Strictly optional.
.
2 Comments
Star Strider
on 24 Mar 2022
Edited: Star Strider
on 24 Mar 2022
I’m confused.
In Eq(1), r is the variable of integration. While k can be a vector, this simply means evaluating the integral in a loop (or using the 'ArrayValued' name-value pair in integral) for various values of k.
A triple integral requires the integrand to be a function of three variables (at least as I understand), however it is only a function of r.
I need to understand what you want the integration to do. Just now, I do not.
EDIT — (24 Mar 2022 at 19:52)
I am still not certain aboout the triple integral. However the fftn function will calculate N-dimensional fast Fourier transforms if you want to take them over more than one dimension.
See Also
Categories
Find more on Fourier Analysis and Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!