Sunteți pe pagina 1din 4

Fourier Transforms: Discrete and Continuous

Jake VanderPlas
vanderplas@astro.washington.edu
September 4, 2014
1. Continuous Fourier Transforms
For an n-dimensional function g(x), we can dene the Fourier Transform
1
g(

k) =

d
n
xg(x)e
ix

k
(1)
The corresponding inverse Fourier Transform is
g(x) =

d
n
k
(2)
n
g(

k)e
i

kx
. (2)
From these, we can see that the n-dimensional Dirac delta function can be written

n
D
(x x

) =
1
(2)
n

d
n
ke
i

k(xx

)
(3)
such that
d
n
xf(x)
n
D
(x x

) = f(x

) (4)
Note that the fourier transform convention in eqns ??-?? is useful in that it leads to a
particularly simple form of the convolution theorem, without any gratuitous factors of

2:
h(x) =

d
n
x

f(x

)g(x x

)

h(

k) =

f(

k) g(

k) (5)
2. Discrete Fourier Transform
For computational purposes, it is more useful to consider the discrete fourier transform.
It is helpful to dene some notation to make the following expressions more compact. First
1
for mathematica users, this fourier transform convention corresponds to the option
FourierParameters->{1,1}.
2
let an element of the n-dimensional array G
j
1
,j
2
jn
be written G
j
, where j is understood to
be an n dimensional vector of integers, with 0 j
i
< N
i
. Well also dene the multiple sum

N
1
1

j
1
=0
N
2
1

j
2
=0

Nn1

jn=0
(6)
Using this notation, we can write the n-dimensional discrete fourier transform as

G
k
=

j
G
j
e
(2i/N)jk
, 0 k
m
< N
m
(7)
The corresponding inverse discrete fourier transform is given by
G
j
=

m
1
(N
m
)
n

G
k
e
(2i/N)jk
, 0 j

< N

(8)
From this, we see that the Kronecker delta function can be written

n
jj
=

m
1
(N
m
)
n

k
e
(2i/N)k(jj

)
(9)
such that
G
j
=

n
jj
G
j
(10)
The expressions in equations ?? and ?? can be quickly computed using the Fast Fourier
Transform algorithm.
3. The Relationship Between Discrete and Continuous Fourier Transforms
Often it is desirable to approximate a continuous fourier transform given a discrete
sampling of the function. Here we will work in one dimension, though the generalization to
multiple dimensions is straightforward.
Consider a continuous function g(x), which is sampled at N equal intervals G
j
= g(x
j
)
with x
j
x
0
+ jx, 0 j < N. Assuming that g(x) 0 outside the range x
0
x
(x
0
+ Nx), we can approximate the integral in equation ?? as
g(t) =

dxg(x)e
ixt
x
N1

j=0
g(x
j
)e
ixt
3
x
N1

j=0
g(x
j
)e
it(x
0
+jx)
(11)
We would like to sample the fourier transform g(t) at N equally spaced intervals in t. To
this end, let t
k
= t
0
+ kt such that,
g(t
k
) x
N1

j=0
g(x
j
)e
i(t
0
+kt)(x
0
+jx)
(12)
Now to make this look like equation ??, we let t = 2/(Nx) and rearrange to nd
1
x
g(t
k
)e
i(t
k
t
0
)x
0

N1

j=0
g(x
j
)e
it
0
x
j
e
2ijk/N
(13)
We see that this matches equation ?? with
G
j
g(x
j
)e
it
0
x
j

G
k

e
ix
0
t
0
x
g(t
k
)e
ix
0
t
k
(14)
Thus the continuous fourier transform can be approximated using a discrete sampling and
an FFT, by using the appropriate exponential weighting of the sampled functions. The
extension of this to multiple dimensions follows by applying the correct transformation along
each dimension.
Note that when using the FFT and IFFT routines in, e.g. tpack, the choice of t
0
is
not necessarily free (though by exploiting the periodic boundary conditions implicit in an
FFT, any range in t can be calculated). The ducial t range is symmetric about t = 0, so
that t
0
= (N/2)t = /x.
4. A More Correct Form
In many cases, the discrete sampling of the previous section is not simply the value of
g(x) at each point x
j
, but an average over a range x
j
x/2 < x < x
j
+ x/2. To be
correct in this situation, we need to recognize that our sampled values at position x
j
are an
estimator of a dierent quantity, namely
g
W
(x
j
) =

dxg(x)W
j
(x
j
x) (15)
4
with
W
j
(x) =

1/x, |x x
j
| < x/2
0, otherwise
(16)
By the convolution theorem, we can write
g(t) = g
W
(t)/

W
j
(t) (17)
Where the fourier transform of the window function is given by

W
j
(t) =
sin(tx/2)
tx/2
(18)
Thus we can compute g(t) correctly by applying the FFT approach from the previous section
to compute g
W
(t) from the sampled values, then dividing by the Fourier transorm of the
pixel window in equation ??.
At rst glance, it seems that there might be a problem, because 1/W
j
(t) diverges for
tx = 2n, with n a non-zero integer. It turns out that the limits of the t save us here:
we showed above that t
k
= (k N/2)t = (2k/N 1)/x, with 0 k < N, so that that
we are limited to the domain tx < , which lies safely within the nite range. The
result does not change the smaller wave numbers, but weights the larger wave-numbers by
an increasing factor of up to 1.5.

S-ar putea să vă placă și