Understanding of Fourier Transform
This article distills the intuition I built while studying the Fourier series and the Fourier transform. Starting from the familiar idea of an inner product on vectors, we trace a single thread: inner product of functions → trigonometric series → complex exponential form → Fourier integral → Fourier transform → Discrete Fourier Transform (DFT).
In one line — the Fourier series / transform decomposes a function into a linear combination of mutually orthogonal (independent) sinusoidal basis functions. It is exactly the same logic as expressing a vector in an orthogonal basis. The only difference is that the basis is now an infinite-dimensional set of sinusoids.
1. Orthogonal Functions
The inner product originates with vectors, but we want to extend the same idea to functions.
1) Inner product of vectors
For two vectors \(\vec{u} = u_1 i + u_2 j + u_3 k\) and \(\vec{v} = v_1 i + v_2 j + v_3 k\):
The case \(\theta = 90^\circ\) (inner product = 0) is called orthogonality (independence).
2) Inner product of functions
For two functions \(f_1, f_2\) on an interval \([a, b]\), the inner product is defined as:
It is harder to picture geometrically, but if the two functions are independent then
Example. Take \(f_1(x) = x^2,\; f_2(x) = x^3\) on \([-1, 1]\): the integral vanishes, so they are orthogonal.
3) Orthogonal sets
A set of orthogonal functions (an infinite set) is defined as follows.
In other words, every pair of distinct functions in an orthogonal set is mutually orthogonal.
4) Norm
One more term we'll lean on is the norm.
For vectors, the inner product of a vector with itself gives its square norm. The same idea defines the norm of a function:
2. Vector Analogy — linear combination of functions
If the orthogonal functions are independent, their key feature is linearity. With an orthogonal (infinite) set as the basis, we should be able to superpose them to represent any function.
But how do we find the coefficients \(c_n\)? Borrow the trick from vectors.
In a 3-D Cartesian system:
If the basis vectors are mutually orthogonal, any vector is a linear combination of them. To find the coefficients \(c_1, c_2, c_3\), take inner products:
Now apply the same logic to (1). For functions, the inner product is continuous, so it becomes an integral (vectors are discrete):
By orthogonality every \(m \ne n\) term vanishes, and only the parallel term \(m = n\) survives:
3. Trigonometric Series — Fourier Series
According to Zill & Wright, 5th edition, Exercises 12.1 – 12, the following set is mutually orthogonal for every \(x\):
So we can expand an arbitrary function \(f(x)\) as a linear combination of these basis functions:
By convention, setting \(c_0 = a_0/2\), \(c_{2n-1} = a_n\), \(c_{2n} = b_n\) gives the cleaner form:
Finding \(a_0, a_n, b_n\)
Apply the vector analogy: take the inner product of both sides with each basis function.
A) \(a_0\) — inner product of \(f(x)\) with 1 over \([-p, p]\):
B) \(a_n\) — inner product of \(f(x)\) with \(\cos(m\pi x/p)\):
C) \(b_n\) — inner product of \(f(x)\) with \(\sin(m\pi x/p)\):
Equation (2) is the Fourier series of \(f(x)\); the coefficients from A), B), C) are the Fourier coefficients.
What does the Fourier series actually mean?
Back to the vector analogy — a 3-D vector is a linear combination of basis vectors and can represent any vector in 3-D space:
A function is the same — the point is that the linear combination can represent every \(f(x)\):
Two caveats follow.
- Like a Taylor series, a Fourier series is an infinite series, so convergence becomes an issue.
- Truncation introduces error, so the accuracy depends on where we stop.
Conditions for convergence
Even if \(f(x)\) is discontinuous, that's fine as long as the discontinuities are finite in number. Outside the discontinuities (piecewise continuous), if \(f\) and \(f'\) exist on \([-p, p]\), convergence is guaranteed even at the discontinuities themselves.
4. Expansion in a Fourier Series — a worked example
Expand the following function as a Fourier series.
Plug all coefficients into the Fourier series. The result is:
Interpretation. The index \(n\) plays the role that \(i, j, k\) play for vectors — it enumerates basis components. Here \(n\) runs over countably infinitely many basis functions. (In theory, \(f(x)\) is a linear combination of infinitely many sinusoidal basis functions on \([-\pi, \pi]\).)
At the discontinuity \(x = 0\), the convergence condition gives \(\dfrac{f(0+) + f(0-)}{2} = \dfrac{\pi + 0}{2} = \dfrac{\pi}{2}\).
Orthogonality holds only on \([-\pi, \pi]\), so the Fourier expansion is valid only inside that interval.
What happens outside \([-p, p]\)?
The shape on the orthogonal interval simply repeats periodically.
Equation (2) writes an arbitrary \(f(x)\) as a linear combination of orthogonal sinusoids with different fundamental periods. By analogy: a vector in 2-D \((i, j)\) is less expressive than one in 3-D \((i, j, k)\), which is less expressive than one in 4-D \((i, j, k, t)\). Higher dimension means we can represent more.
Among the sinusoids in the linear combination, the one with the longest period sets the overall period of \(f(x)\). For the form in (2), the orthogonality interval \([-p, p]\) of length \(2p\) becomes the period.
Sum of an orthogonal set of trigonometric functions
A linear combination of the basis functions above — orthogonal on \((-p, p)\) — converges to an arbitrary function as \(n \to \infty\).
Summary — the Fourier expansion of \(f(x)\) is a \(2p\)-periodic function on \((-p, p)\). \(2p\) is the fundamental period of the (linear-combination) sum.
Reference: in Zill & Wright (5th ed.), page 663, example graphs show that partial sums get closer to \(f(x)\) as \(n\) grows — moving \((a) \to (b) \to (c) \to (d)\) toward the target on \((-\pi, \pi)\). The Fourier series is itself periodic.
5. Complex (exponential) form of the Fourier series
For analyzing periodic signals, the complex form is more convenient. By Euler's formula:
Substituting into (2):
Each \(c\)-coefficient is computed the same way as before:
Tidying (3) gives the compact form:
\(n = 0, \pm 1, \pm 2, \pm 3, \dots\). At a discontinuity: \(\dfrac{f(x_+) + f(x_-)}{2}\). \(c_n\) is the per-basis weight; \(e^{\,i n\pi x/p}\) is the basis itself. This is essentially the same linear combination of sinusoids as (2), just compactly written.
6. Wave basics — period, frequency, wavelength
A quick refresher on wave terminology.
- Time for one cycle — period \(T = \text{time}/\text{cycle}\)
- Cycles per second — frequency \(f = \text{cycle}/\text{time}\)
- Distance per cycle — wavelength \(\lambda = \text{distance}/\text{cycle}\)
Wave speed is therefore:
Two ways to read it. ① Distance per time — one cycle covers \(\lambda\) in \(T\) seconds. ② Per cycle the distance is \(\lambda\), and there are \(f\) cycles per second.
Fundamental frequency
Back to the Fourier expansion:
The overall period of \(f(x)\) is set by the longest-period basis sinusoid in the expansion — that is, the one at \(n = 1\).
This is the fundamental period of the Fourier expansion. Hence:
Common confusion. Isn't the period \(T = 2p/n\)? — If it were written that way, that would describe the period of each individual basis function. The \(T\) and frequency above refer instead to the period and frequency of \(f(x)\) as a whole (the \(n = 1\) case).
The point is to identify \(f(x)\)'s own fundamental frequency and period, then re-express the Fourier expansion using those quantities so they're easy to read off.
If we use the circular convention, one cycle equals \(2\pi\,[\mathrm{rad}]\). The fundamental frequency in that convention is then called the fundamental angular frequency \(\omega\):
* Note: \(2\pi\,[\mathrm{rad}]\) is a dimensionless angle, not a distance. The distance per cycle (wavelength) is a separate concept — don't confuse "cycle" with "distance." Cycle is expressed in terms of distance or period, not equated with them.
7. Frequency spectrum
\(f(x)\) is a sum of many sinusoids (think of them in blue). Plotting the fundamental angular frequency on the \(x\)-axis and the amplitude (coefficient) on the \(y\)-axis gives the frequency spectrum.
What the frequency spectrum tells us — which sinusoids make up the time-domain function \(f(x)\), and with what amplitudes. The waveform is sinusoidal anyway, so frequency + amplitude is enough to characterize each component.
Aside: roughly, do high-frequency components tend to have small amplitudes?
These ideas are the core meaning of the Fourier series.
Amplitude and phase of \(c_n\)
Strictly, the amplitude is \(|c_n|\). Since \(c_n\) itself is complex (a vector in the complex plane), it can also shift phase:
\(\varphi\) is the phase shift.
Spectrum examples
Two simple examples.
- \(f(x) = e^{-x},\;(-\pi < x < \pi)\)
- \(f(x) = \begin{cases} 0, & -1 < x < 0 \\ 1, & 0 \le x < 1 \\ 0, & 1 \le x < 3 \end{cases}\)
Q. Express each function as a complex Fourier series and plot its frequency spectrum across \(n\).
Example 1) \(f(x) = e^{-x},\;(-\pi < x < \pi)\)
(using \(e^{\pm i n\pi} = \cos n\pi \pm i\sin n\pi = (-1)^n\))
Here \(n\omega\) is the fundamental frequency of each component sinusoid, and \(\omega\) is the fundamental frequency of the whole Fourier series. With \(\omega = 2\pi/T = 2\pi/2\pi = 1\), we get \(n\omega = n\).
8. Integral transform method — Fourier integral
Error function, Laplace transform, Fourier transform — all are integral transforms.
So far \(f(x)\) has been a sum of discrete sinusoidal components:
But the "missing" frequencies between, say, \(n = 1\) and \(n = 2\) can also be components. To account for them we need the continuous idea of integration:
From discrete to continuous
Plug the coefficients back in:
Why is \(p\) in the denominator? Because the Fourier expansion's period is \(2p\) (its longest fundamental period). To convert the sum into an integral, we need a differential \(d\alpha\) to fall out of \(\pi/p\).
What should that differential be? Since \(n\) controls the frequency of \(\cos, \sin\), mimicking a continuous change of frequency means using:
Stretch the domain to infinity (\(p \to \infty\)) and let the basis become continuous (\(\cos\alpha\,d\alpha\)):
This is the Fourier integral of \(f\) on \((-\infty, \infty)\). If \(f\) is even or odd, the form simplifies further.
Even / odd Fourier integral
For an even function:
For an odd function:
Complex form of the Fourier integral
The Fourier integral also has a complex form.
In \(\alpha\), \(\cos\) is even, so we can rewrite:
(The \(i\sin\alpha(t-x)\) term integrates to zero, since \(f(t)\) doesn't depend on \(\alpha\).)
Why does \(\sin, \cos\) integrate over \((0, \infty)\), while the complex form integrates over \((-\infty, \infty)\)? — In (6), (7) the \(\alpha\) inside \(A(\alpha), B(\alpha)\) ends up absorbed into the exponential, leaving \(f(t)\) alone. The resulting expression in \(\alpha\) is even, so extending the range to \((-\infty, \infty)\) is valid.
Complex form. \(e^{-i\alpha x}\) is the sinusoidal basis; \(C(\alpha)\) is the per-basis coefficient (like a vector weight). The integral form invites a more general framing — the integral-transform framework below.
9. Integral transforms & Fourier transform pairs
A transform pair is:
The pair always works together. The functions \(K(\alpha, x), H(\alpha, x)\) used to switch domains are called kernels. For the Laplace transform, for instance, \(K(s, x) = e^{-sx}\) and \(H(s, x) = e^{sx}/(2\pi i)\).
Fourier transform pair
Transforms for even / odd functions
Even function — Fourier cosine transform
Odd function — Fourier sine transform
Like the Laplace transform, the Fourier transform can solve differential equations: differentiation in the real domain pulls a factor onto the transformed function.
10. Example — solving the heat equation
Example 1. Solve the heat equation
Take the Fourier transform of both sides:
From the initial condition:
Question 1 — \(u(x, t)\) depends on both space and time, so why Fourier-transform only in space and leave \(t\) alone? Couldn't we do a 2-D Fourier transform?
A 2-D transform like \(F(\alpha, \beta) = \int\!\int f(x,y)\,e^{-i(\alpha x + \beta y)}\,du\,dv\) is in principle possible, and including \(t\) should still yield a result. But we usually peel \(t\) off separately, for two reasons:
- An \(n\)-dimensional Fourier transform that includes \(x, y, z, \dots\) all together (a first-order setup) is not always guaranteed to exist or be useful — \(x, y, z\) appear implicitly in each other, and orthogonality can break (a stability issue: in PDEs, elliptic problems are typically stable, while hyperbolic and parabolic ones can be unstable, depending on the regime).
- The PDE is first-order in \(t\), so as in Example 1 it makes physical and mathematical sense to separate \(t\) and solve sequentially.
Reading \(dU(\alpha, t)/dt\) intuitively (in a 2-D setting): the snapshots \(t_1, t_2, t_3\) are continuous moments in time. At each moment, \(k(\partial^2 u/\partial x^2 + \partial^2 u/\partial y^2)\) updates the Fourier-domain representation, and we step forward. In code, you can either store time inside an array or sweep it in an outer loop — either way, the time evolution lives on the \(t \times \alpha\) axis alongside the spatial transform.
Solving a PDE with Fourier means: move to the Fourier domain \((\alpha, \beta)\), solve there for a weak solution, then transform back to the real domain. Next we wrap up with the Discrete Fourier Transform (DFT) — a stepping stone toward spectral methods.
11. Discrete Fourier Transform (DFT)
The continuous form is:
To actually solve numerically, this continuous picture must be turned discrete.
Step 1 — bound the domain
Replace the infinite real line with the bounded interval \([0, 2p]\):
Step 2 — make the basis count countably infinite
Move from an uncountably infinite basis to a countably infinite (integer) one:
In theory the basis is countably infinite; in practice we truncate to \(N\) terms.
Step 3 — discretize \(x\) (sampling rate)
\(x\) is also uncountably infinite over \((0, 2p)\), so it too must be made finite — this is the heart of discretization: cover \(x\) with finitely many sample points.
We can't carry uncountably many points, so we sample. The spacing \(\Delta x = T\) between samples is the sampling rate.
Taking one cycle as \(2\pi\) (angular) and \(N\) samples per cycle:
The number of basis functions and the number of sample points are independent in principle, but we usually take them equal (it makes the matrix square, which is easier to solve). \(k\) and \(n\) don't strictly have to match.
Matrix form
Picturing what "solving with Fourier" means — start from a PDE in \(f(x)\), decompose into basis components, find the coefficients \(c_0, c_1, c_2, \dots, c_{N-1}\), and recombine to recover \(f(x)\). In matrix form, equation (4) becomes the linear system shown above.
Summary
- Vectors → functions: extending the inner product to an integral carries orthogonality, normalization, and linear combinations straight over to functions.
- Fourier series: decompose a \(2p\)-periodic function in the orthogonal basis \(\{1, \cos(n\pi x/p), \sin(n\pi x/p)\}\). Coefficients come from the vector-analogy inner product.
- Complex form: Euler's formula collapses the series to a single line \(\sum c_n e^{in\pi x/p}\); \(|c_n|\) is the amplitude and \(\arg c_n\) is the phase.
- Frequency spectrum: plot \(n\omega\) on the \(x\)-axis and \(|c_n|\) on the \(y\)-axis to read off, at a glance, which sinusoids make up the function.
- Fourier integral / transform: send \(p \to \infty\) so that the sum becomes an integral. With kernel \(K(\alpha, x) = e^{i\alpha x}\) we get the transform pair \(f(x) \leftrightarrow F(\alpha)\).
- Solving PDEs: differentiation maps to \((-i\alpha)^n F(\alpha)\), so a PDE becomes an ODE in \(\alpha\)-space — illustrated on the heat equation.
- DFT: replace the infinite integral with a finite sum, the uncountable basis with \(N\) discrete bases, and continuous \(x\) with samples at spacing \(T\). The result is an \(N \times N\) Vandermonde system in \(\omega_N = e^{i2\pi/N}\).