Top
Best
New

Posted by rbanffy 9/4/2025

What Is the Fourier Transform?(www.quantamagazine.org)
474 points | 205 commentspage 2
stackbutterflow 9/5/2025|
> Fourier argued that the distribution of heat through the rod could be written as a sum of simple waves.

How do you even begin to think of such things? Some people are wired differently.

ndriscoll 7 days ago||
I don't know/remember the historical derivation, but the story you might get in a class goes something like:

Energy can't be created or destroyed, so it follows a continuity equation: du/dt + dq/dx = 0. Roughly, the only way for energy to change in time is by coming from somewhere in space. There are no magic sources/sinks (a source or sink would be a nonzero term on the right).

Then you have Fourier's law/Newton's law of cooling: heat flows proportional to temperature difference, from high to low: q = -du/dx.

Combining these, you get the heat equation: du/dt = d^2 u/dx^2.

Now if you're very fancy, you can find deeper reasons for this, but otherwise if you're in engineering analysis class, just guess that u(t,x)=T(t)X(x). i.e. it cleanly factors along time/space.

But then T'(t)X(x)=X''(x)T(t), so T'(t)/T(t) = X''(x)/X(x). But the left and right are functions of different independent variables, so they must be constant. So you get X''= λX for some lambda. But then from calc1, X is sin/cos.

Likewise T' = λ T so T is e^-λt from calc 1.

Then since it's a linear differential equation, the most general solution (assuming it splits the way we guessed) is a weighted sum of any allowable T(t)X(x), so you get a sum of exponentially decaying (in time) waves (in space).

AIPedant 9/5/2025|||
It didn't come completely out of nowhere, Euler and Bernoulli had looked at trigonometric series for studying the elastic motion of a deformed beam or rod. In that case, physical intuition about adding together sine waves is much more obvious. https://en.wikipedia.org/wiki/Euler%E2%80%93Bernoulli_beam_t...

Other mathematicians before Fourier had used trigonometric series to study waves, and physicists already understood harmonic superposition on eg a vibrating string. I don't have the source but I believe Gauss even noted that trigonometric series were a solution to the heat equation. Fourier's contribution was discovering that almost any function, including the general solution to the heat equation, could be modelled this way, and he provided machinery that let mathematicians apply the idea to an enormous range of problems.

HelloNurse 9/5/2025||
I think he was very familiar with differential equations and series expansions and the "wild west" stage of calculus in general. The frontier of cool and interesting mathematics has moved a lot in 200 years.
jaccola 9/5/2025||
Also these stories are "storified" over time, the reality is always messier (same with startup founding stories etc..).

A common mistake I see in people reading mathematics (or even computer science papers) is to think the proof set out in the paper is the thought process that lead to the interesting insight. It is almost always an ex post facto formalisation.

tzury 9/5/2025||
This is a great playlist by 3b1b about the subject:

https://www.youtube.com/watch?v=spUNpyF58BY&list=PL4VT47y1w7...

stared 9/5/2025||
Speaking of the Fourier transform, I recommend these visual explorable explanations: https://injuly.in/blog/fourier-series/index.html and https://www.jezzamon.com/fourier/
lovelearning 9/5/2025||
Applying FT to images is a great way to see the world very differently, as if through an alien's eyes (or Geordi's visor from ST TNG!). A kind of stimulated out-of-the-box thinking. Dense features like fur or hair manifest as high-frequency components and eventually you start to develop an intuition for their patterns in the magnitude / power spectrums.
pcfwik 9/4/2025||
To add another suggestion for understanding the Fourier transform, personally the first explanation that ever clicked with me was the Aho/Hopcroft/Ullman algorithms textbook.

Rather than talking about sine and cosine waves, they motivate the Fourier transform entirely in terms of polynomials. Imagine you want to multiply two polynomials (p(x) and q(x)). The key is to recognize that there are two ways to represent each polynomial:

1. "Coefficient form," as a set of coefficients [p_0, p_1, p_2, ..., p_d] where p(x) = p_0 + p_1x + p_2x^2 + ... + p_dx^d, OR

2. "Sample form," as a set of sampled points from each polynomial, like [(0, p(0)), (1, p(1)), (2, p(2)), ..., (d, p(d))]

Now, naive multiplication of p(x) and q(x) in coefficient form takes O(d^2) scalar multiplications to get the coefficients of p(x)q(x). But if you have p(x) and q(x) in sample form, it's clear that the sample form of p(x)q(x) is just [(0, p(0)q(0)), (1, p(1)q(1)), ...], which requires only O(d) multiplications!

As long as you have enough sample points relative to the degree, these two representations are equivalent (two points uniquely defines a line, three a quadratic, four a cubic, etc.). The (inverse) Fourier transform is just a function that witnesses this equivalence, i.e., maps from representation (1) to representation (2) (and vice-versa). If the sample points are chosen cleverly (not just 1/2/3/...) it actually becomes possible to compute the Fourier transform in O(d log d) time with a DP-style algorithm (the FFT).

So, long story short, if you want to multiply p(x) and q(x), it's best to first convert them to "sample" form (O(d log d) time using the FFT), then multiply the sample forms pointwise to get the sample form of p(x)q(x) (O(d) time), and then finally convert them back to the "coefficient" form (O(d log d) using the inverse FFT).

alberto_balsam 4 days ago|
Great explanation, thanks for sharing
Salgat 9/4/2025||
Always blew my mind that every signal can be recreated simply by adding different sine waves together.
incognito124 9/4/2025||
Back in my uni days I did not get why that works. Why are sine waves special?

Turns out... they are not! You can do the same thing using a different set of functions, like Legendre polynomials, or wavelets.

MontyCarloHall 9/4/2025|||
>Turns out... they are not! You can do the same thing using a different set of functions, like Legendre polynomials, or wavelets.

Yup, any set of orthogonal functions! The special thing about sines is that they form an exceptionally easy-to-understand orthogonal basis, with a bunch of other nice properties to boot.

nestes 9/4/2025||||
To be maximally pedantic, sine waves (or complex exponentials through Euler's formula), ARE special because they're the eigenfunctions of linear time-invariant systems. For anybody reading this without a linear algebra background, this just means using sine waves often makes your math a lot less disgusting when representing a broad class of useful mathematical models.

Which to your point: You're absolutely correct that you can use a bunch of different sets of functions for your decomposition. Linear algebra just says that you might as well use the most convenient one!

MontyCarloHall 9/4/2025||
>They're eigenfunctions of linear time-invariant systems

For someone reading this with only a calculus background, an example of this is that you get back a sine (times a constant) if you differentiate it twice, i.e. d^2/dt^2 sin(nt) = -n^2 sin(nt). Put technically, sines/cosines are eigenfunctions of the second derivative operator. This turns out to be really convenient for a lot of physical problems (e.g. wave/diffusion equations).

cjbgkagh 9/4/2025|||
Another place where functions are approximated is in machine learning which use a variety of non-linear functions for activations, for example the ReLU f(x)= max(0,x)
kingstnap 9/4/2025|||
It makes more sense when you approach it from linear algebra.

Like you can make any vector in R^3 `<x,y,z>` by adding together a linear combination of ` <1,0,0> `, ` <0,1,0> `, ` <0,0,1> `, turns out you can also do it using `<exp(j2pi0/30), exp(j2pi0/31), exp(j2pi0/32)>`, `<exp(j2pi1/30), exp(j2pi1/31), exp(j2pi1/32)>`, and `<exp(j2pi2/30), exp(j2pi2/31), exp(j2pi2/32)>`.

You can actually do it with a lot of different bases. You just need them to be linearly independent.

For the continuous case, it isn't all that different from how you can use a linear combination of polynomials 1,x,x^2,x^3,... to approximate functions (like Taylor series).

nomel 9/4/2025|||
Taking the concept to a 2d path: https://www.myfourierepicycles.com

And, with your own drawing: https://gofigure.impara.ai

spaceywilly 9/5/2025|||
I swear I read in a text book once that Fourier discovered this while a boat. He looked out at the waves on the ocean and saw how there were many different sized waves combining to make up the larger waves. I could never find it again, but that visual helped me understand how the Fourier transform works.
esafak 9/4/2025||
Only if it is band-limited.
anvuong 9/4/2025|||
You are being confused with #samples needed for perfect reconstruction, i.e. Nyquist sampling frequency. Fourier series/transforms work regardless of the bandwidth of the signal, as long as the integral exists, i.e. it must vanish at infinity.

Essentially it's just projection in infinite-dimensional vector spaces.

esafak 9/4/2025||
That's what is commonly understood by reconstruction: perfect reconstruction. And for that you need a band-limited signal. Otherwise he would have said approximate- or lossy reconstruction.
nomel 7 days ago||
> And for that you need a band-limited signal.

Luckily, we live in a physical universe, where such mathematical oddities, like infinite bandwidth signals, cannot exist, so this isn't an actual issue. Any signal that that contains infinite bandwidths only exists because it has sampling artifacts. You would, necessarily, be attempting to reconstruct errors. There are many "tricks" around dealing with such flawed signals. But yes, you can't fully reconstruct impossible signals with FFT.

ajross 9/4/2025||||
No, even functions with non-finite frequency representation. You just need a non-finite number of sines. Nyquist speaks only to a finite number of samples.
CamperBob2 9/4/2025|||
And of infinite duration, if you want to split hairs.
femto 9/4/2025|||
Same thing! :-) In the purest sense, finite bandwidth requires infinite duration and finite duration requires infinite duration.

The real world is somewhere in between. It must involve quantum mechanics (in a way I don't really understand), as maximum bandwidth/minimum wavelength bump up against limits such as the Planck length and virtual particles in a vacuum.

CamperBob2 9/5/2025|||
Related, but not quite the same thing. Band-limiting is needed to avoid aliasing. The infinite-duration part (or perfect phase continuity at the boundaries, or a window function...) is needed to avoid Gibbs ringing.

An interesting anecdote from Lanczos[1] claims that Michelson (of interferometer fame) observed Gibbs ringing when he tried to reconstruct a square wave on what amounted to a steampunk Fourier analyzer [2]. He reportedly blamed the hardware for lacking the necessary precision.

1: https://math.univ-lyon1.fr/wikis/rouge/lib/exe/fetch.php?med...

2: https://engineerguy.com/fourier/pdfs/albert-michelsons-harmo...

femto 9/5/2025||
Can we agree that a fun thing about the Fourier Transform is the many different ways such a simple idea (a liner combination of basis functions) can be viewed and the many subtle implications it has?

For example, one viewpoint is that "Gibbs ringing" is always present if the bandwidth is limited, just that in the "non-aliased" case the sampling points have been chosen to coincide with the zero-crossings of the Gibbs ringing.

I find that my brain explodes each time I pick up the Fourier Transform, and it takes a few days of exposure to simultaneously get all the subtle details back into my head.

CamperBob2 9/5/2025||
For sure. As I understand it, though, the Gibbs phenomenon arises due to the sinc kernel's infinite support (sinc in Fourier domain = rectangular window in time domain, equivalent to no window at all.)

No amount of precision, no number of coefficients, no degree of lowpass filtering can get around the fact that sin(x)/x never decays all the way to zero. So if you don't have an infinitely-long (or seamlessly repeating) input signal, you must apply something besides a rectangular window to it or you will get Gibbs ringing.

There is always more than one way to look at these phenomena, of course. But I don't think the case can be made that bandlimiting has anything to do with Gibbs.

ndriscoll 9/5/2025|||
The Heisenberg uncertainty principle in quantum mechanics comes about precisely because position and momentum are a Fourier transform pair.
femto 9/5/2025|||
In that vein, I've always wondered whether the fact that we live in a fundamentally quantum universe is just a mathematically consistent side effect of the Fourier transform and the Universe's limited extent in space-time. Is the Planck time just the point at which we can't determine the difference in frequency of two signals because the wavelength of their beat frequency has to fit inside the Universe? It's fun to think about.
cycomanic 9/5/2025|||
And you can essentially "observe" the Heisenberg principle when looking at a moving object. If you are observing a plane for example to more accurately know its velocity you will need to observe over a longer time, but if you do this you loose accuracy about its position. This does affect radar systems, who can either send short pulses to accurately pin down the position or long pulses to measure the speed.
Blackthorn 9/4/2025|||
Are the dirac or kronecker delta functions infinite duration? I guess it depends on the proof whether you can shorten them or not.
astrange 9/5/2025||
> A compression algorithm can then remove high-frequency information, which corresponds to small details, without drastically changing how the image looks to the human eye.

I slightly object to this. Removing small details = blurring the image, which is actually quite noticeable.

For some reason everyone really wants to assume this is true, so for the longest time people would invent new codecs that were prone to this (in particular wavelet-based ones like JPEG-2000 and Dirac) and then nobody would use them because they were blurry. I think this is because it's easy to give up on actually looking at the results of your work and instead use a statistic like PSNR, which turns out to be easy to cheat.

HarHarVeryFunny 9/5/2025||
Well, there are use cases for lossy compression as well as non-lossy, and nobody is saying they are the same. If you really need to heavily compress to reduce file size or transmission bandwidth then you'll likely need to use a lossy CODEC, so the question then becomes how can you minimize the reduction in perceived quality of whatever you are compressing (photos, video, audio), which comes down to how these various human sensory/perceptual systems work.

For vision we are much more sensitive to large scale detail (corresponding to low frequency FFT components) than fine scale detail (corresponding to high frequency components), so given the goal of minimizing reduction in perceived quality this is an obvious place to start - throw away some of that fine detail (highest frequency FFT components), and it may not even be noticeable at all if you are throwing away detail at a higher level of resolution than we are able to perceive.

It turns out that human vision is more sensitive to brightness than color (due to numbers of retinal rods vs cones, etc), so compression can also take advantage of that to minimize perceptual degradation, which is what JPEG does - first convert the image from RGB to YUV color space, where the Y component corresponds to brightness and the U,V components carry the color information, then more heavily compress the color information than brightness by separately applying FFT (actually DCT) to each of the Y,U,V components and throwing away more high frequency (fine detail) color information than brightness.

But, yeah, there is no magic and lossy compression is certainly going to be increasingly noticeable the more heavily you compress.

astrange 7 days ago||
> large scale detail (corresponding to low frequency FFT components)

This isn't true in practice - images are not bandlimited like audio so there aren't really visual elements of images corresponding to low frequency cosine waves. That's why the lowest frequency DCT coefficient in a JPEG image is 16x16 pixels, which is hardly large scale.

But you do quantize all components of the DCT transform, not just the highest ones.

Actually in the default JPEG quantization matrix it's the coefficient to the upper-left of the last one that gets the most quantization: https://en.wikipedia.org/wiki/Quantization_(image_processing...

HarHarVeryFunny 7 days ago||
Sure, but quantization is just another level of lossiness once you've already decided what information to throw away.

In terms of understanding how JPEG compression works, and how it relates to human perception, I'd say that in order of importance it's:

1) Throw away fine detail by discarding high frequency components

2) More heavily compress/discard color than brightness detail (using YUV)

3) Quantize the frequency components you are retaining

astrange 5 days ago||
> 1) Throw away fine detail by discarding high frequency components

The reason it works is that fine detail is almost completely correlated across colors, so if you only keep the Y plane at full resolution it still stores it.

You couldn't just throw it out in RGB space because eg text would be unreadable.

goalieca 9/5/2025||
You might be surprised to learn that videos and many images are broken down into brightness + color vectors. Brightness is typically done near the resolution of the image (eg 4K) but color is often 1/4 of that. That’s literally blurring the picture.
astrange 9/5/2025||
…Why would you write a comment like this assuming I don't know what 4:2:0 is when I know what a wavelet is?

It doesn't have the same effect because the original high frequency details are correlated and so they're preserved in the Y channel.

zkmon 9/5/2025||
The most shocking thing for me was the realization that frequency and wavelength are kind of dual forms. Ofcourse, every concept and thing that comes into existence does so only in the context of it's opposite or dual form. But recognizing that form is genius. 3b1b video goes a bit deeper.

Also a related fact is that the rate of change of a sine wave is itself shifted by pi/2, while the exponential curves need no shifting. I'm not a professional in these matters, but I guess there is a deeper connection between the rate of change and the static world.

niemandhier 9/5/2025||
The Fouriertransform is a change of bases in infinite dimensional space.

That sounds complicated but if you look at the integral the exponential kernel is essentially a continuous “matrix” and the function you are integrating over that kernel is a continuous vector.

This observation on can be a guide to better understand infinite dimensional Hilbert spaces ( inner product space + stuff) and is one of the core observations in quantum mechanics where it’s part of the particle-wave concept as it transforms location space -> momentum space.

prameshbajra 9/5/2025|
I love the content here but the website hijacks my default mouse highlight and it does not allow me to right click and save highlights which is mildly annoying. Only me?
More comments...