# Fourier transform to reciprocal space vs. time-frequency transform

조회 수: 5 (최근 30일)
L'O.G. 2022년 3월 23일
편집: Star Strider 2022년 3월 24일
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?

댓글을 달려면 로그인하십시오.

### 답변 (1개)

Star Strider 2022년 3월 23일
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없음 표시없음 숨기기
L'O.G. 2022년 3월 24일
편집: L'O.G. 2022년 3월 24일
@Star Strider I just realized in Eq. 1 they are vectors: , but not in Eq. 2. Also, I think Eq. 1 is therefore a triple integral. Is there a way to modify the code then to tackle Eq. 1?
Star Strider 2022년 3월 24일
편집: Star Strider 2022년 3월 24일
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.

댓글을 달려면 로그인하십시오.

### 카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

R2021b

### Community Treasure Hunt

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

Start Hunting!

Translated by