Message Boards Message Boards

GROUPS:

Improve numerical Fourier transformation on interpolation function?

Posted 6 months ago
614 Views
|
1 Reply
|
1 Total Likes
|

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:

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

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract