Re: Numerical Differentiation using Fourier Transform

• To: mathgroup at smc.vnet.net
• Subject: [mg32948] Re: Numerical Differentiation using Fourier Transform
• From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
• Date: Thu, 21 Feb 2002 02:07:00 -0500 (EST)
• Organization: Universitaet Leipzig
• References: <a4vgmt\$r4b\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

Hi,

you really know that you dont mix up continuous and discrete
Fourier transforms ? For a discrete to discrete Fourier transform
you have sampled the values of  the 2Pi periodic function f with
N points x[k]=2Pi*k, k=0,1,..,N-1 and f[k]=f[x[k]] and with the
DFT you calculate a[j] with

f[k]=Sum[a[j]*Exp[2Pi*I*j*k/N],{j,0,N-1}]/N

Can yo tell me what you mean with the continuous derivative ?
of the discrete f[k] ? This ist simply not defined because k can
have only discrete values.

You can use a discrete approximation to a derivative (f[i+1]-f[i-1])/2
and interprete this as a convolution

test = Table[Sin[2Pi*x/20], {x, 0, 20, 20/511}];;

fkernel = Fourier[
RotateLeft[
Drop[Table[
If[Abs[i] <= 1, -i, 0]/2, {i, -Length[test]/2,
Length[test]/2}],
-1],
Length[test]/2]
];

dfftest = InverseFourier[Chop[fkernel*Fourier[test]]];

But is is up to you, to use a higher order approximation of the
first derivative (f[i-2] - 8*f[i-1] + 8*f[i+1] - f[i+2])/12

Regards
Jens

Mike wrote:
>
> Hi
>
> I need to differentiate a function that i only know numerically and
> for various reasons I have been asked to do this via a Fourier
> Transform Method.  Before doing it on the horrible function I am
> dealing with, I thought I would get to grips with the method using
> much easier functions.
>
> So say I want to differentiate
>
> E^(-x^2)
>
> w.r.t x using Fourier Transforms : analytically i could proceed as
> follows
>
> FourierTransform[E^(-x^2), x, w]] = 1/(Sqrt[2]*E^(w^2/4))
>
> multiply this by I*w and taking the inverse Transform yields
>
> (-2*x)/E^x^2
>
> as expected so i am along the right lines here.  Now I assume that I
> only know this function numerically and see if i can reproduce this
> result.  First I made a table of values :
>
> test = Table[E^(-x^2), {x, 0.01, 20, 0.01}];
>
> and find it's DFT using
>
> Fourier[test]
>
> now in order to find the derivative I need to multiply this by I*w and
> take the inverse transform.  My problem is how to do this?  what are
> my values of w?  The DFT looks very different to the one I found
> analytically and to be honest I don't have a clue of whats going on.
> Any help would be appreciated - Thanks
>
> Mike

• Prev by Date: Re: Fourier coefficients
• Next by Date: RE (2): Position within a list
• Previous by thread: Re: Numerical Differentiation using Fourier Transform
• Next by thread: Re: Re: Numerical Differentiation using Fourier Transform