summaryrefslogtreecommitdiff
path: root/source/know/concept/fourier-transform/index.md
blob: 0bc849b0a76c09aeed7116b7d8d4631e15ab8311 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
---
title: "Fourier transform"
sort_title: "Fourier transform"
date: 2021-02-22
categories:
- Mathematics
- Physics
- Optics
layout: "concept"
---

The **Fourier transform** (FT) is an integral transform which converts a
function $$f(x)$$ into its frequency representation $$\tilde{f}(k)$$.
Great volumes have already been written about this subject,
so let us focus on the aspects that are useful to physicists.

The **forward** FT is defined as follows, where $$A$$, $$B$$, and $$s$$ are unspecified constants
(for now):

$$\begin{aligned}
    \boxed{
        \tilde{f}(k)
        \equiv \hat{\mathcal{F}}\{f(x)\}
        \equiv A \int_{-\infty}^\infty f(x) \exp(i s k x) \dd{x}
    }
\end{aligned}$$

The **inverse Fourier transform** (iFT) undoes the forward FT operation:

$$\begin{aligned}
    \boxed{
        f(x)
        \equiv \hat{\mathcal{F}}^{-1}\{\tilde{f}(k)\}
        \equiv B \int_{-\infty}^\infty \tilde{f}(k) \exp(- i s k x) \dd{k}
    }
\end{aligned}$$

Clearly, the inverse FT of the forward FT of $$f(x)$$ must equal $$f(x)$$
again. Let us verify this, by rearranging the integrals to get the
[Dirac delta function](/know/concept/dirac-delta-function/) $$\delta(x)$$:

$$\begin{aligned}
    \hat{\mathcal{F}}^{-1}\{\hat{\mathcal{F}}\{f(x)\}\}
    &= A B \int_{-\infty}^\infty \exp(-i s k x) \int_{-\infty}^\infty f(x') \exp(i s k x') \dd{x'} \dd{k}
    \\
    &= 2 \pi A B \int_{-\infty}^\infty f(x') \Big(\frac{1}{2\pi} \int_{-\infty}^\infty \exp(i s k (x' - x)) \dd{k} \Big) \dd{x'}
    \\
    &= 2 \pi A B \int_{-\infty}^\infty f(x') \: \delta(s(x' - x)) \dd{x'}
    = \frac{2 \pi A B}{|s|} f(x)
\end{aligned}$$

Therefore, the constants $$A$$, $$B$$, and $$s$$ are subject to the following
constraint:

$$\begin{aligned}
    \boxed{\frac{2\pi A B}{|s|} = 1}
\end{aligned}$$

But that still gives a lot of freedom. The exact choices of $$A$$ and $$B$$
are generally motivated by the [convolution theorem](/know/concept/convolution-theorem/)
and [Parseval's theorem](/know/concept/parsevals-theorem/).

The choice of $$|s|$$ depends on whether the frequency variable $$k$$
represents the angular ($$|s| = 1$$) or the physical ($$|s| = 2\pi$$)
frequency. The sign of $$s$$ is not so important, but is generally based
on whether the analysis is for forward ($$s > 0$$) or backward-propagating
($$s < 0$$) waves.


## Derivatives

The FT of a derivative has a very useful property.
Below, after integrating by parts, we remove the boundary term by
assuming that $$f(x)$$ is localized, i.e. $$f(x) \to 0$$ for $$x \to \pm \infty$$:

$$\begin{aligned}
    \hat{\mathcal{F}}\{f'(x)\}
    &= A \int_{-\infty}^\infty f'(x) \exp(i s k x) \dd{x}
    \\
    &= A \big[ f(x) \exp(i s k x) \big]_{-\infty}^\infty - i s k A \int_{-\infty}^\infty f(x) \exp(i s k x) \dd{x}
    \\
    &= (- i s k) \tilde{f}(k)
\end{aligned}$$

Therefore, as long as $$f(x)$$ is localized, the FT eliminates derivatives
of the transformed variable, which makes it useful against PDEs:

$$\begin{aligned}
    \boxed{
        \hat{\mathcal{F}}\{f'(x)\} = (- i s k) \tilde{f}(k)
    }
\end{aligned}$$

This generalizes to higher-order derivatives, as long as these
derivatives are also localized in the $$x$$-domain, which is practically
guaranteed if $$f(x)$$ itself is localized:

$$\begin{aligned}
    \boxed{
        \hat{\mathcal{F}} \Big\{ \dvn{n}{f}{x} \Big\}
        = (- i s k)^n \tilde{f}(k)
    }
\end{aligned}$$

Derivatives in the frequency domain have an analogous property:

$$\begin{aligned}
    \dvn{n}{\tilde{f}}{k}
    &= A \dvn{n}{}{k}\int_{-\infty}^\infty f(x) \exp(i s k x) \dd{x}
    \\
    &= A \int_{-\infty}^\infty (i s x)^n f(x) \exp(i s k x) \dd{x}
    = \hat{\mathcal{F}}\{ (i s x)^n f(x) \}
\end{aligned}$$


## Multiple dimensions

The Fourier transform is straightforward to generalize to $$N$$ dimensions.
Given a scalar field $$f(\vb{x})$$ with $$\vb{x} = (x_1, ..., x_N)$$,
its FT $$\tilde{f}(\vb{k})$$ is defined as follows:

$$\begin{aligned}
    \boxed{
        \tilde{f}(\vb{k})
        \equiv \hat{\mathcal{F}}\{f(\vb{x})\}
        \equiv A \int_{-\infty}^\infty f(\vb{x}) \exp(i s \vb{k} \cdot \vb{x}) \ddn{N}{\vb{x}}
    }
\end{aligned}$$

Where the wavevector $$\vb{k} = (k_1, ..., k_N)$$.
Likewise, the inverse FT is given by:

$$\begin{aligned}
    \boxed{
        f(\vb{x})
        \equiv \hat{\mathcal{F}}^{-1}\{\tilde{f}(\vb{k})\}
        \equiv B \int_{-\infty}^\infty \tilde{f}(\vb{k}) \exp(- i s \vb{k} \cdot \vb{x}) \ddn{N}{\vb{k}}
    }
\end{aligned}$$

In practice, in $$N$$D, there is not as much disagreement about
the constants $$A$$, $$B$$ and $$s$$ as in 1D:
typically $$A = 1$$ and $$B = 1 / (2 \pi)^N$$, with $$s = \pm 1$$.
Any choice will do, as long as:

$$\begin{aligned}
    \boxed{
        A B
        = \bigg( \frac{|s|}{2 \pi} \bigg)^{\!N}
    }
\end{aligned}$$

<div class="accordion">
<input type="checkbox" id="proof-constants-ND"/>
<label for="proof-constants-ND">Proof</label>
<div class="hidden" markdown="1">
<label for="proof-constants-ND">Proof.</label>
The inverse FT of the forward FT of $$f(\vb{x})$$ must be equal to $$f(\vb{x})$$ again, so:

$$\begin{aligned}
    \hat{\mathcal{F}}^{-1}\{\hat{\mathcal{F}}\{ f(\vb{x}) \}\}
    &= A B \int \exp(- i s \vb{k} \cdot \vb{x})
    \int f(\vb{x}') \exp(i s \vb{k} \cdot \vb{x}') \ddn{N}{\vb{x}'} \ddn{N}{\vb{k}}
    \\
    &= (2 \pi)^N A B \int f(\vb{x}')
    \Big( \frac{1}{(2 \pi)^N} \int \exp(i s \vb{k} \cdot (\vb{x}' - \vb{x})) \ddn{N}{\vb{k}} \Big) \ddn{N}{\vb{x}'}
    \\
    &= (2 \pi)^N A B \int f(\vb{x}')
    \Big( \prod_{n = 1}^N \frac{1}{2 \pi} \int \exp(i s k_n (x_n' - x_n)) \dd{k_n} \Big) \ddn{N}{\vb{x}'}
\end{aligned}$$

Here, we recognize the definition of the Dirac delta function again,
leading to:

$$\begin{aligned}
    \hat{\mathcal{F}}^{-1}\{\hat{\mathcal{F}}\{ f(\vb{x}) \}\}
    &= (2 \pi)^N A B \int f(\vb{x}')
    \Big( \prod_{n = 1}^N \delta(s(x_n' - x_n)) \Big) \ddn{N}{\vb{x}'}
    \\
    &= \frac{(2 \pi)^N A B}{|s|^N} \int f(\vb{x}') \: \delta(\vb{x}' - \vb{x}) \ddn{N}{\vb{x}'}
    = \frac{(2 \pi)^N A B}{|s|^N} f(\vb{x})
\end{aligned}$$

</div>
</div>

Differentiation is more complicated for $$N > 1$$,
but the FT is still useful,
notably for the Laplacian $$\nabla^2 \equiv \idv{ {}^2}{x_1^2} + ... + \idv{ {}^2}{x_N^2}$$.
Let $$|\vb{k}|$$ be the norm of $$\vb{k}$$,
then for a localized $$f$$:

$$\begin{aligned}
    \boxed{
        \hat{\mathcal{F}}\{\nabla^2 f(\vb{x})\}
        = - s^2 |\vb{k}|^2 \tilde{f}(\vb{k})
    }
\end{aligned}$$

<div class="accordion">
<input type="checkbox" id="proof-laplacian"/>
<label for="proof-laplacian">Proof</label>
<div class="hidden" markdown="1">
<label for="proof-laplacian">Proof.</label>
We insert $$\nabla^2 f$$ into the FT,
decompose the exponential and the Laplacian,
and then integrate by parts (limits $$\pm \infty$$ omitted):

$$\begin{aligned}
    \hat{\mathcal{F}}\{\nabla^2 f\}
    &= A \int \big( \nabla^2 f \big) \exp(i s \vb{k} \cdot \vb{x}) \ddn{N}{\vb{x}}
    \\
    &= A \int \Big( \sum_{n = 1}^N \pdv{ {}^2 f}{x_n^2} \Big) \Big( \prod_{m = 1}^N \exp(i s k_m x_m) \Big) \ddn{N}{\vb{x}}
    \\
    &= A \sum_{n = 1}^N \bigg[ \pdv{f}{x_n} \exp(i s \vb{k} \cdot \vb{x}) \bigg]
    - A \sum_{n = 1}^N i s k_n \int \pdv{f}{x_n} \exp(i s \vb{k} \cdot \vb{x}) \ddn{N}{\vb{x}}
\end{aligned}$$

Just like in 1D, we get rid of the boundary term
by assuming that all derivatives $$\idv{f}{x_n}$$ are nicely localized.
To proceed, we then integrate by parts again:

$$\begin{aligned}
    \hat{\mathcal{F}}\{\nabla^2 f\}
    &= - A \sum_{n = 1}^N i s k_n \int \pdv{f}{x_n} \Big( \prod_{m = 1}^N \exp(i s k_m x_m) \Big) \ddn{N}{\vb{x}}
    \\
    &= - A \sum_{n = 1}^N i s k_n \bigg[ f \exp(i s \vb{k} \cdot \vb{x}) \bigg]
    + A \sum_{n = 1}^N (i s k_n)^2 \int f \exp(i s \vb{k} \cdot \vb{x}) \ddn{N}{\vb{x}}
\end{aligned}$$

Once again, we remove the boundary term
by assuming that $$f$$ is localized, yielding:

$$\begin{aligned}
    \hat{\mathcal{F}}\{\nabla^2 f\}
    &= - A s^2 \sum_{n = 1}^N k_n^2 \int f \exp(i s \vb{k} \cdot \vb{x}) \ddn{N}{\vb{x}}
    = - s^2 \sum_{n = 1}^N k_n^2 \tilde{f}
\end{aligned}$$

</div>
</div>



## References
1.  O. Bang,
    *Applied mathematics for physicists: lecture notes*, 2019,
    unpublished.