All The Stuff You Wished You Knew About Fourier Transforms But Were Afraid To Ask

The Fourier transform underpins so much of our technological lives, in most cases probably without our realising it. The ability to mathematically split a waveform into its frequency components and vice versa underpins much of the field of digital signal processing, and DSP has become an essential part of many electronic devices we take for granted.

But while most of us will know what a Fourier transform is, fewer of us will know anything of how one works. They are a function called from a library rather than performed in themselves. Even when they are taught in schools or university courses they remain something that not all students “get”, and woe betide you if (as your scribe did) you have a sub-par maths lecturer.

The video below the break then is very much worth a look if Fourier transforms are a bit of a mystery to you. In it [Grant Sanderson] explains them through a series of simple graphical examples in a style that perhaps may chalk-and-talk mathematics teachers should emulate. You may still only use Foruier transforms through a library, but after watching this video perhaps some of their mysteries will be revealed.

The occasional mathematical piece makes it way onto these pages, in the past we’ve brought you an examination of the same process when summing sine waves.

Via Hacker News.

51 thoughts on “All The Stuff You Wished You Knew About Fourier Transforms But Were Afraid To Ask

  1. Our linear algebra professor explained the Fourier transform to us in our first year as a base transform of the complex function space with a special orthogonal base. After she had written those three lines to the blackboard, she went on with another base transform example.

    It being defined like that really helped a few years later when the Fourier transform was introduced as a tool in the signal processing lecture.

        1. That might happen if you study in the wrong country.
          At our local university it’s currently 1674€ a year if you take too long to get your degree and only 674€ a year if you are still in time.

        2. LOL, I have no passion for anything. Sadly I have to live so I became an engineer. If I’d have taken your advice I’d be a bigger drain on society than all those people getting degrees in subjects that have no job prospects.

          I envy people as ignorant and arrogant as you.

        3. Unfortunately for you that either reads as, “I’m not the one paying for my education”, or “I’m stinking rich, I don’t have to worry about money”. Nice if you can get it, but for the real world people we owe money to don’t accept “passion” as a form of payment. In other words WE do have to worry about our profession generating an income and hence what degrees we go for.

          1. Right… or the objective becomes “Hunt the Wumpus” for real strange different crazy subsidized (thankfully was making ~$75K and billions, if not millions) disabled not overpaid ineffective intentional false pretense trying to look and act official.

        4. I knew a guy who got his degree in English and made more money mowing grass. Whats the point of getting a degree (and possibly getting into a large debt) if you can’t make a living wage with your “passion” based degree? That seems like it should be a hobby at that point.

  2. Nice description. When I took the signals classes in my undergrad EE curriculum, I was always frustrated by the Fourier transform- actually doing it, got even more frustrated when I got to Laplace transforms and how it was useful, but then in a graduate DSP class the z transform (the discrete time version of the Laplace) is what made it all fit together. While it is a pretty specialized path to go down, I hope 3Blue1Brown will get to a discussion of the z- that’s where shit gets done!

    1. The Z-Transform should ALWAYS be discussed in parallel with (if not soon after) an introduction to Linear Time-Invariant (LTI) Systems! This is especially true today where digital signal processing is so important. But that’s still not the way it is done in the formal University system. Much of the problem has to do with the horrible way hugely over-priced university-level text books are sold and controlled. Online education CAN help with this problem, but in most-part the online content does NOT deviate. Online content still tries to mirror the broken and out of date in-classroom practices in formal university systems. Case in-point is this video introduction to the Fourier Transform.

  3. “The ability to mathematically split a waveform into its frequency components”

    That is incorrect.

    Waveforms are not made up as a series of sine waves, waveforms can be represented as a series of sine waves. Waveforms can just as easily be represented as a series of square waves or triangular waves or any periodic waveform you care to use.

    Sine waves are easy, that is why we use them but making the statement that all waveforms ARE a series of sine waves leads to confusion..

      1. Just semantics. The sine wave is the simplest one, containing the least amount of information. It’s spectrum consists of just one frequency component, so it’s natural to consider other waveforms to consist of sine waves rather than the other way around.

        Of course you can construct any waveform by combining any other waveforms, but when you actually do the math, you find that you’re really adding and subtracting sine waves.

        For example, the continuous mathematical expression for a square wave is:

        https://wikimedia.org/api/rest_v1/media/math/render/svg/0bcc48dbe98962e42f637f24dcaf4ecd71bd2af5

        Which is an sum of an infinite number of sine waves.

        1. Good explanation. I’d add that I say “this force is a vector,” what’s the point of arguing that the force isn’t REALLY a vector, we just represent it as one mathematically? It’s a pointless philosophical debate.

        1. More specifically, look at the article “Walsh Functions: A Digital Fourier Series” in the Sept. 1977 BYTE magazine (also reprinted in The BYTE Book of Computer Music). In it, he simulates a sine wave using simple digital logic and some carefully calculated resistor values. Both the article and the book are available online.

          1. @rsmilward said:

            “More specifically, look at the article “Walsh Functions: A Digital Fourier Series” in the Sept. 1977 BYTE magazine (also reprinted in The BYTE Book of Computer Music).”

            And here are the missing links (if the HaD post Editor doesn’t mangle them):

            WALSH FUNCTIONS – DIGITAL FOURIER SERIES, Byte Magazine Volume 02 Number 09 – Music and Computers, Sept. 1977, Pg.-190 WALSH FUNCTIONS: A DIGITAL FOURIER SERIES, Author: Jacoby:

            https://archive.org/details/byte-magazine-1977-09

            .pdf download, 137MB (other formats incl. epub available at link above):

            https://archive.org/download/byte-magazine-1977-09/1977_09_BYTE_02-09_Music_and_Computers.pdf

    1. There is no difference between saying it can be represented by a series of sine waves and saying it can be split into its frequency components. In fact, the second is a clearer description when one considers possible signal processing. Nothing said about square waves or triangular waves contradicts that. If it looks like a duck and walks like a duck, it is a duck. (And that does not exclude it at the same time being something else.)

    2. The sentence you quoted doesn’t refer to sine waves. It says “frequency components” which could refer to the frequency of any periodic waveform, including the others you mentioned. Why are you objecting to a statement the writer doesn’t make?

    3. Oh dear, an entire career using Fourier transforms to split waveforms into frequency components was based upon a lie told to me during my electronic engineering degree course. Whatever shall I do!

      Most mathematical and scientific concepts have several layers of lies-to-the-children. Newton’s Laws to explain All Of Physics, for example. Good enough to explain most things and allow you to do your stuff. That there are more advanced explanations for more advanced learners doesn’t change their ability to be useful at the level they are used.

      1. Not to worry. Whatever topic anyone brings up, there will always be some smarty-pants who throws a metaphoric Cherry bomb into the metaphoric fire, telling everyone else why they’re all wrong. Ever hear the claim “Scientists say bumblebees can’t fly”?

        It’s just an attention-getter, with no other redeeming virtue.

        1. I know the HaD.io environment is a little more supportive, but the main site’s user comments are not. at. all. After getting linked around 10 years ago, I always make sure to hide my published work on private forums (which are generally more supportive imho). But that is not what I come to HaD for these days anyway. I like the random fun read and learning a thing or two and seeing how fragile a person’s ego becomes after a 75k degree. I honestly feel bad for some of the folks that get linked without their knowledge on here and seeing them pop up in the comments. Oh well.

    4. @John,

      Using a set of waveform generators outputting square waves of related harmonics. Then using a summing circuit try to generate a signal that look like a sine wave with it. Good luck!

    5. Not just any series of periodic functions will do. First they have to be linearly independent. And if you to be able to calculate the coefficients easily then they need to be orthogonal to each other.

  4. “Waveforms can just as easily be represented as a series of square waves or triangular waves or any periodic waveform you care to use.”

    Not really. I’m just a EE, not a mathematician, so my explanation will probably imprecise, but I’ll try.

    Even if you used only sine waves of arbitrary frequency it would not be sufficient. That is why you also need to extract the phase or, equivalently, extract the cosine series as well. Without both, there are real waveforms that can’t be decomposed/reconstructed from that basis set. The most trivial example: if you have only sin waves and no phase information to work with, and your function is nonzero at x=0, it is impossible to represent because no matter which weighting of the sine waves you used because each one is zero at x=0.

    The real requirement is that whatever function set you are using, they need to for a complete basis. The fact that sin functions are all mutually orthogonal means that there is a unique representation, which is useful.

    1. yes, its all about having a basis of orthogonal functions. I was taught the fourier transform through linear algebra, where functions were just the logical conclusion to vectors, this seemed to make it all easier to understand than when I was taught it in calculus

  5. WONDERFUL!!!! Many years ago, my major professor asked me to look at how we could use a computer to explain knotty concepts in math. Like, for example, how the derivative of a function derives from a divided difference, as time interval shrinks to zero.

    We’re talking about the 50’s here, so we’d have to create a movie rather than an interactive graphics display.

    But this tutorial proves beyond a shadow of a doubt that the technology my prof dreamed of has arrived. I am _SO_ impressed!!

  6. Nice video. Why all the pedants saying its incorrect to say you can split out the frequency components? It’s a great tool for doing exactly that.

    I studied maths and electronics for 4 years as then worked in this field for 15 years designing vector signal test equipment

    When you truly understand it you won’t be offended by these types of explanations.

  7. Great visual representation of the graphical data in qualitative and simple quantitative ways. The best video detail I’ve watched so far on FT’s. Even better can be elaborating on the various types of FT’s. I was thinking Jerobeam Fenderson “Oscilloscope Music Tutorial 4” was the best I’ve watched for explaining visually really basic sine and cosine waves, though he is only going into phase of a sine and cosine wave.

  8. This is really nice. How are the graphics done?

    One common way to look at the FT has been as a collection (infinite collection) of correlations of the signal of interest with the individual spectral frequencies. Then the DFT is a finite collection of components you intend to use or plot. IIRC the first big applications for FT were in Quantum Mechanics, then in optics and synthetic aperture systems. (That’s aside from much earlier applications in the theory of differential equations.) Now it is used in everything from medical imaging to radio.

    This visualization from 3Blue1Brown with the circle spinning term and the vector magnitude term (and phase) I think is really much better for communications and SDR and all kinds of signal processing. In SDR the square wave switching method of detection is amazing, and watching a HackRF on the computer I have doing super smooth 64K DFT is pretty dang mind boggling. It all uses these concepts, often reduced to crazy simple hardware. This FT visualization should make understanding how this all works much more accessible. It would be great to follow up on how many people make a personal math breakthrough as a result.

    Now I have to watch all the videos.

  9. IMHO, this is the most interesting thing ever published on HaD (and I’ve been around a while). Now I’m off to find a way to also make it the most useful (by using it to perfect cold fusion or something).

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.