|
[Sponsors] |
May 18, 2001, 18:25 |
Anybody can help with DFFT?
|
#1 |
Guest
Posts: n/a
|
Hi, friends:
I have a question on Discrete FFT, it dogged me a whole day. I was trying to use pseudospectral method to solve a kdv equation as: du/dt+u*du/dx +d^3u/dx^3=0 where 0<x<L The domain [0,L] is discreted in to N points, N is power of 2,say N=1024. Then the FFT of u is FFT(u)=U(k)=SIGMA(u(j)*exp(-2pi*i*j*k/N),j=0,...,N-1) where k=0,...,N-1, i=sqrt(-1) This is ok, but to do the du/dx term, I used the following formular: du/dx=IFFT(k*i*FFT(u)) I let u=sin(2pi*x/32), put it into the upper equation, the results is the same form as cos(2pi*x/32), which is expected, but the magnitude is wrong. The corrected answer should be (2pi/32)cos(2pi*x/32). I think I must have doing something wrong in scaling. I looked some references, but can't find the problem, the FFT() routine I used is standard and should not have problems. What people usually do is scaling the domain [0,L] to [0,2pi], what's the point that they do so? I just want use FFT on the domain [0,L]. Can this cause problems? Thank you very much if you can point it out. Wen |
|
May 21, 2001, 15:32 |
Re: Anybody can help with DFFT?
|
#2 |
Guest
Posts: n/a
|
The FFT is for an angle that goes from 0 to 2 pi, so you better scale your problem accordingly.
O to 2 pi is periodic of period 2 pi. So your problem should also be periodic on the domain 0, L, of period L (otherwise you'll get the famous Gibbs oscillations; divergence of the Fourier series). Why don't you like to work from 0 to 2pi? Cheers. |
|
|
|