Where does the Fourier transform come from?

(fasterik.net)

56 points | by fasterik 18 hours ago ago

42 comments

  • prewett 14 hours ago ago

    This is a strange explanation, compared to the standard explanation that a Fourier transform converts time-domain to frequency domain (that is, the x-axis goes from time to freq), and it comes from the observation that a (possibly infinite) sum of sin/cosines of different frequencies can make any curve. A discrete Fourier transform would change the integral into a summation.

    I guess you could consider the sines as basis functions and use matrices, but I suspect that a series of sines varying only by frequency and amplitude aren’t orthogonal basis functions, although linear algebra isn’t my strong suite.

    • 2muchcoffeeman 14 hours ago ago

      A lot of the explanations I’ve seen on HN of Fourier transforms are strange. The standard explanation is by far the most intuitive and simple with the right examples. Though maybe you would need more math to be able to manipulate things. But certainly not to understand what’s happening.

    • geokon 14 hours ago ago

      The problem is that "frequency domain" is a vague conecept - and in some respects a bit deceptive. I'm not an expect, but I think it's worth for instance pointing out that you have a fixed set of orthogonal frequencies, meanwhile phases are smooth and continuous. You could argue it's like time steps are fixed and amplitudes are continuous, but it just creates all sorts of strange knock-on effects. When you start thinking "what happens if I have an input frequency that is not one in the orthogonal set?" the answers are not obvious (something something bessel functions) and it's not obvious how to deal with them. You can think of plenty of other "issues" like amplitude/frequency modulation that don't have intuitive explanation in a "frequency domain"

      • magimas 13 hours ago ago

        I think you're mixing up quite a few things here?

        The actual Fourier transform has a continuous frequency domain and the basis functions are orthogonal in the generalized sense of orthogonality of functions

        int_-inf^inf exp(i.w.t) exp(-i.w'.t) dt = 2.pi.delta(w-w')

        It seems like you're mixing in some properties of the discrete fourier series and DFT?

    • fasterik 13 hours ago ago

      The two views are equivalent. We can start with linear algebra and see sines and cosines as arising naturally from matrices, or we can start with calculus and see how matrices naturally arise from local linear approximations. I thought it would be interesting to see how we get the Fourier transform without calculus, and how to motivate it from physical principles. Plus, linear algebra is simpler than calculus, and in my opinion more fundamental. But judging from the comments, I probably should made more of an effort to relate this to the standard explanation.

      • garyfirestorm 7 hours ago ago

        I’d argue a transform and its kernel are simply trying to fit an input to an output, which can be easily explained using sine and cosine waves to explain frequency decomposition of a sound wave - because sound waves are made of sines and cosines. It can’t get any easier than that. You went into 2D instead of starting in 1D.

    • VygmraMGVl 13 hours ago ago

      Iirc you can't use sines as a basis because sin(0)=0. You can use cosines and a basis, see the Discrete Cosine Transform as an example.

      You also don't need to vary amplitude for the basis, as linear combinations of the basis handle any changes in amplitude you need. E.g. if your basis is x and y, your basis spans ax + by for all real a,b.

    • duped 11 hours ago ago

      My favorite FT joke is "it's just a change of basis" which is as alien a term to non mathematicians as "infinite length orthogonal transform" or "eigenvalues of a shift matrix."

      There's precisely one confusing part of teaching the FT integral to non-practitioners and its "what the fuck is e and j doing there"

      • fasterik 11 hours ago ago

        It may be a joke, but "it's just a change of basis" is actually what demystified it for me. I never understood the motivation behind summing sines and cosines, or why that would be relevant to so many seemingly unrelated fields.

  • SyzygyRhythm 12 hours ago ago

    I found the explanation interesting, but it was quite alien compared to the usual one. I value seeing alternate explanations and motivations for things. It helps gain perspective. I'd not made the connection before with the cyclic shift matrix before, and now I wonder if there's a connection with the e^D operator (the exponential of the derivative), which can act as a shift operator for continuous functions.

    That said, I'd argue that "where X comes from" is a factual claim about the history, and it doesn't seem like this is what motivated Fourier or others. They started with the idea/observation that functions could be decomposed into a sin/cos basis. It didn't arise as a side effect of the eigenvalues of a shift matrix.

    • fasterik 12 hours ago ago

      Fair point about the historical motivations. But to me "comes from" can also mean: what is the simplest/most fundamental settting in which something arises? That was my starting point, at least.

      Interesting observation about e^D, I had not considered that! Apparently e^aD is precisely the translation operator T_a that I define in the last section. I'm still learning these areas myself, and I'm sure there are a lot more interesting connections here related to groups and symmetry.

      • SyzygyRhythm 5 hours ago ago

        Yes, e^D is fun and interesting! I've thought though a couple ways that it can be justified: one is just the "interest rate" definition of e, which applied here gets you (1 + D/n)^n. So it adds a fraction of the derivative a bunch of times. Each step then looks like f(x+h) = f(x) + h*f'(x), which of course is just the definition of the derivative. A bunch of tiny shifts add to one big shift.

  • bananaflag 14 hours ago ago

    > Everything we’ve covered so far has been linear algebra, which is the theory of finite-dimensional vector spaces. The generalization of this theory to infinite dimensions is known as functional analysis.

    I've seen this a lot of times and I don't like it. Linear algebra means you just study vector spaces (over arbitrary fields). Functional analysis means you study Banach or Hilbert spaces and generalizations thereof. In both cases the spaces can be finite or infinite dimensional.

    • fasterik 13 hours ago ago

      Well, it's a question of semantics. Sheldon Axler, for one, defines linear algebra as limited to finite dimensions, and anything with infinite dimensions as functional analysis:

      https://math.stackexchange.com/questions/1877766/what-is-the...

      • nextaccountic 7 hours ago ago

        However, you don't always need to use analysis to work with infinite dimensional vector spaces. Indeed the usual definition of vector spaces (the axioms of vector spaces) is not limited to finite dimensions

        What he appears to be saying is that if you have infinite dimensions, you probably want to bring analysis into your toolbox, or at least you have no reason not to (in math you don't gain points by handicapping yourself, or well, at least not unless you are doing reverse mathematics)

    • 11 hours ago ago
      [deleted]
  • anigbrowl 15 hours ago ago

    The best resource for understanding Fourier transforms is https://www.dspguide.com, a free textbook that is now >20 years old.

    • stochastician 14 hours ago ago

      I never found dspguide helpful when i was a kid, I found it somehow too colloquial and imprecise. I think the beauty of textbooks is that everyone can find their right "niche", so let me make a plug for Oppenheim and Willksy's now classic, "Signals and Systems"

      I loved this book so much I spent a lot of my career doing signal processing, and I love that this is a calc-first (no linear algebra) book. It also is precise but not pedantic with notation. By that I mean there's no analysis or measure theory (it is the text for MIT's sophomore-year 6.003 course, after all) but also that the authors spent a lot of time thinking about proper, pedagogically-precise notation, and are incredibly consistent with it.

      I'm so grateful for this book, and signal processing was the first formal applied mathematical topic I ever really "mastered" (and even would go on to teach sometimes at UChicago when I was CS faculty). So if the linear algebra puts you off, or if you like a slower introduction, or if you want something really fun to get into over the holidays, I really recommend this book!

      But maybe others can reply with their favorite signal processing books.

    • nextaccountic 7 hours ago ago

      I love the chapter on Benford'd law https://www.dspguide.com/ch34.htm

      I also like the approach of this book of completely forgoing complex numbers (and introducing them only at the end), which might make the book more accessible. I myself never had trouble with complex numbers in high school but I know people that have

  • pugfugly 8 hours ago ago

    Short answer: L^2(G, mu_Haar) has an orthonormal basis of characters (G a locally compact abelian group).

    • roadbuster 8 hours ago ago

      oh, yes, of course, now I understand.

  • couchridr 11 hours ago ago

    A nice explanation from 3blue1brown is https://youtu.be/spUNpyF58BY

  • novia 13 hours ago ago

    Beautiful visualizations. Anyone know how they were made?

    • fasterik 13 hours ago ago

      Vibe coded in JavaScript with HTML canvas and some SVG. The KaTeX library does the LaTeX typesetting.

  • Choad_20261104 11 hours ago ago

    I'll take z-plane over Fourier any day

  • constantcrying 17 hours ago ago

    I do not want to be mean, but this is one of the worst explanations of the Fourier transform I have ever seen.

    The central insight is that what the Fourier transform computes how similar to a oscillation a given function is.

    • fasterik 16 hours ago ago

      Thanks for the feedback. The article is about where the Fourier transform comes from, and I guess it's subjective what counts as an answer to that. Personally, I don't find "computing how similar to an oscillation a given function is" to be a satisfying answer, although it is certainly a part of it and I probably could have done a better job emphasizing it.

      • z4lis 12 hours ago ago

        It comes from Fourier’s analysis of the heat equation, where he notes that 1. sines and cosines form an eigenbasis of the laplacian so give you explicit solutions 2. most functions can be approximated by sines and cosines, so armed with the basis expansion of your initial condition in the eigenbasis, you can solve the equation

        So I don’t think your post is at all a silly approach, much less the worst ever! :)

    • ndriscoll 15 hours ago ago

      Well, the central insight is about linearity + translation invariance, and that more generally given some linear system that's invariant under some group G, it is a decomposition of some representation (e.g. the regular representation, which is tied to convolution) of G into irreducible representations of G. That idea ties together various "Fourier-like" transforms like Fourier series, DTFT, DFT, Mellin transform, and wavelet transforms.

      If you want to know "what it is," then yeah, waves. If you want to know "why it is" and why it keeps appearing, then there's more of a story to tell about symmetry.

      • FartyMcFarter 15 hours ago ago

        As a layman, I find the explanation that functions can be expressed as a sum of sine waves to be quite clear, even if I don't fully understand the details of how the transform is calculated.

        Isn't that the central insight behind the Fourier Transform? Once that is accepted, the tricky part is understanding how to transform functions back and forth.

        • srean 13 hours ago ago

          > Isn't that the central insight behind the Fourier Transform?

          Depends on how central you want the insight to be.

          The Fourier transform idea works in domains other than nice functions on the real line. Consider Hadamard-Walsh transforms of digital signals. No sine or cosine waves there but they behave very much the way a Fourier transform is expected to behave. So why does the space of digital signals admit such Fourier like decompositions ? The answer to that is in the comment that you are responding to.

          Group theoretic invariance is the vital underlying pattern that makes Fourier transforms possible in various domains and is the common thread that ties these different Fourier transforms where they are not the usual sine and cosine waves. It is simpler if the group is commutative but can work on non commutative groups also

        • TheOtherHobbes 13 hours ago ago

          The simplest not-quite-but-close-enough explanation is that the integral is a frequency sweep used a as a test signal, put through a correlation function which tells you how much the test function matches the function you're analysing at each infinitesimal point.

          The output function defines that set of correlations - which gives you a graph of the correlation result at each input frequency.

          The minor complication is that the input and output are complex, so the output is of the form sin(th) + icos(th). Or - if you prefer - amplitude + phase.

          So it's a little more complex (ha...) than "sum of sines at different levels."

          But not much.

          Sum of sines gives you audible overtones in music DSP, but it won't necessarily give you the shape of an input function because the phases also have to be correct for that. (Famously, we can't hear relative phase when it's static.)

          The DFT is just the same with discrete samples.

          The FFT is a clever and efficient way to do a DFT, eliminating some of the redundancies in a naive brute force DFT.

          And yes - you can use the same idea for other transforms. As long as you can "test" your input with a probe function and get some output, and you can either sweep your probe or apply a linear set of discrete probes, you'll get... something that may be useful.

          The nice thing about the most useful set of these transforms is that the operation works in either direction.

    • dang 15 hours ago ago

      > I do not want to be mean, but

      What you posted was, in fact, mean. Disclaimers of meanness don't negate that—in practice they facilitate it.

      Your comment would have been just fine without that first sentence, and if you had expanded on your (quite interesting) second sentence it would have been even better.

    • hirako2000 16 hours ago ago

      Like most concepts in math, rigorous explanations are terrible. Unless one is already comfortable with the prerequisites.

      Here: Linear algebra (vectors, matrices, basis, change of basis, inverses). Eigenvectors/eigenvalues and diagonalization. Polynomials and roots (Fundamental Theorem of Algebra). Complex numbers (polar form, conjugation, Euler's formula, roots of unity), and some basic calculus/integrals.

      • aleph_minus_one 16 hours ago ago

        > Unless one is already comfortable with the prerequisites.

        > Here: Linear algebra (vectors, matrices, basis, change of basis, inverses). Eigenvectors/eigenvalues and diagonalization. Polynomials and roots (Fundamental Theorem of Algebra). Complex numbers (polar form, conjugation, Euler's formula, roots of unity), and some basic calculus/integrals.

        This is all taught (depending on the curriculum) in the 1st or 2nd semester when one studies basically any arbitrary STEM subject at a university. So, this all can very easily be assumed.

      • fasterik 16 hours ago ago

        Yes, and those are prerequisites someone would have before they first encountered the Fourier transform in, say, a differential equations class. This article is probably not as approachable for someone who hasn't seen those concepts before, though I did try to provide brief explanations of the key ideas so that interested readers would know what to Google.

        • hirako2000 15 hours ago ago

          I think you did, and nicely, mention all the necessary concepts.

          My comment was rather arguing that any math explanation, or book even, can be deemed poorly written. The problem is what is reader assumed to be comfortable with. The problem isn't on you.

        • nextaccountic 7 hours ago ago

          Something to note is that many people that come in contact with the Fourier transform for the first time is using them for other stuff, like signal processing

    • pantulis 17 hours ago ago

      I think the article is a great explanation of a use case for FTs, but only if you already know what the FT is.

    • s-zeng 12 hours ago ago

      I strongly disagree. I think this is one of the best explanations of the Fourier transform I have ever seen. Too many have left me with a vague feeling of "huh, I guess frequency domain or something?" Intuitive, but hard to figure out how to apply. As someone who has studied linear algebra, and has seen tons of those "intuitive" Fourier explanations, this is the first one where it finally feels like it teaches something real and draws real connections between areas of math. The story of starting from the shift operator and it's eigenvectors to building insight to why it's an inescapable part of translation invariance in general, is simply chef's kiss

    • quantadev 14 hours ago ago

      If you take the FFT of two different signals, then yes you end up with two waveforms that "line up" (being in the frequency domain) and can be compared to see how well they match, and thus how "similar" the frequencies in the two signals were. But FFT itself has nothing to do with comparing two wave forms. All FFT is doing is determining what frequencies are in a given single signal. Whether you compare that to the FFT (frequency domain) of some other signal is totally separate from FFT itself.