I try to code up an algorithm from a scientific paper where they solve a differential equation using Fourier transforms. In the paper, they use the FT convention $\rho(x_i) = \sum_{k=-m}^m r_k e^{i2\pi kx_i} $, where $x_i$ is the ith data point.

Numpy uses the convention described in the fft routine documentation.

Both of these should be completely equivalent (the negative $k$ in one convention correspond to the highest $k$ in the other convention).

Now, in the paper they frequently multiply $r_k$ with a function that depends on this $k$, i.e. $r_k f(k)$. This should be the same as if I wrote $A_k\cdot f(k)$ in Numpy's convention. And the $A_k$ are simply given by A[k] if A=numpy.fft(ρ, N). Is this correct?

I was confused by the statement

and A[n/2+1:] contains the negative-frequency terms

But this simply refers back to the other convention and should not change anything in the way I calculate $A_k\cdot f(k)$, shouldn't it?

  • $\begingroup$ Hi! check your formula please. It uses $\rho$ on both sides ? $\endgroup$
    – Fat32
    Nov 25 '19 at 1:00
  • $\begingroup$ Sorry, the $\rho_k^*$ is supposed to be the fourier amplitude. I should not have used the $*$ symbol. So left is $\rho$ in real space, right is in $k$ space. $\endgroup$ Nov 26 '19 at 21:37
  • $\begingroup$ please edit the question to reflect the change... $\endgroup$
    – Fat32
    Nov 26 '19 at 21:39
  • $\begingroup$ better like this $\endgroup$ Nov 26 '19 at 21:49
  • 1
    $\begingroup$ sorry but still not better. what's $x_i$ and whay cannot you use another letter for $\rho$ in one of the sides ??? $\endgroup$
    – Fat32
    Nov 26 '19 at 22:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.