Message Boards Message Boards

Improve numerical Fourier transformation on interpolation function?

GROUPS:

I want to do a Fourier transformation of an interpolation function that is the result of NDsolve along one variable. Currently I am using the following approach, which numerically integrates the kernel

fourier[f_,t_,t1_,t2_,Nt_,w0_,T0_,w_]:=Module[{h=(t2-t1)/Nt,f2=f*Exp[I*(w-w0)*t*T0]},
1/Sqrt[2*\[Pi]]* h/2*(N[f2/.t->t1]+N[f2/.t->t2]+2*Sum[N[f2/.t->t1+j*h],{j,1,Nt-1}])
]

In the end, this is trapezoidal rule (example code is attached). Is there any approach which can do faster numerical integration on interpolation functions?

Attachments:
POSTED BY: Markus Schmidt
Answer
4 months ago

Maybe using NSum instead of Sum will give a speed boost. Worth a try.

POSTED BY: Daniel Lichtblau
Answer
4 months ago

Group Abstract Group Abstract