8 ms·
An Interactive Guide to the Fourier Transform
- analog31 10mo agoMy only quibble is that the article is about the discrete Fourier transform.
- shash 10mo agoIt’s usually easier to explain the dft. and easier to do a periodic function than a totally arbitrary sequence.
- krackers 10mo agoI've actually found the opposite, it's easier to conceptually understand the continuous FT, then analyze the DTFT, DFT, and Fourier Series as special cases of applying a {periodic summation, discrete sampling} operator before the FT.
- kuharich 10mo agoPast comments: https://news.ycombinator.com/item?id=38652794 https://news.ycombinator.com/item?id=38652794
- constantcrying 10mo ago>The Fourier Transform is one of deepest insights ever made. No, it is not. In fact it is quite a superficial example of a much deeper theory, behind functions, their approximations and their representations.
- fedsocpuppet 10mo agoThe Fourier transform predates functional analysis by a century. I don't see the point in downplaying its significance just because 'duh it's simply a unitary linear operator on L2'.
- NewsaHackO 10mo agoBut is it the deepest insights ever made?
- badlibrarian 10mo agoThe Fourier Transform isn't even Fourier's deepest insight. Unless we're now ranking scientific discoveries based on whether or not they get a post every weekend on HN. The FFT is nifty but that's FINO. The Google boys also had a few O(N^2) to O(N log N) moments. Those seemed to move the needle a bit as well. But even if we restrict to "things that made Nano Banana Pro possible" Shannon and Turing leapfrog Fourier.
- lispisok 10mo ago>Unless we're now ranking scientific discoveries based on whether or not they get a post every weekend on HN. Glad I'm not the only one who noticed there is a weekly (or more) post on what Fourier transform is.
- chemotaxis 10mo agoIt's really getting in the way of all the daily AI opinion pieces I come here to read. More seriously, there are tens of thousands of people who come to HN. If Fourier stuff gets upvoted, it's because people find it informative. I happen to know the theory, but I wouldn't gatekeep.
- zkmon 10mo agoIt is more about the duality between the amplitude and frequency spaces and conversion between them. A bit similar to Hadamard gate for transforming a quantum state from computational basis to diagonal basis.
- kens 10mo agoIf you're dealing with computer graphics, audio, or data analysis, I highly recommend learning Fourier transforms, because they explain a whole lot of things that are otherwise mysterious.
- biophysboy 10mo agoMy favorite application of the Fourier transform is converting convolution into pointwise multiplication. This is used to speed up multiple sequence alignment in bioinformatics.
- squidgyhead 10mo agoWhat is the bioinformatic application? Could you point me towards some programs that use this?
- biophysboy 10mo agoI was thinking about mafft in particular. You should know though that there are many different MSA tools out there.
- seam_carver 10mo agoIf anyone wants to learn about the 2D DFT, the best explanation I've ever read was the relevant chapter in Digital Image Processing by Nick Efford. If anyone wants to see my favorite application of the 2D DFT, I made a video of how the DFT is used to remove rainbows in manga on Kaleido 3 color eink on Kobo Colour: https://youtu.be/Dw2HTJCGMhw?si=J6dUYOj2IRX1nPRF https://youtu.be/Dw2HTJCGMhw?si=J6dUYOj2IRX1nPRF
- brad0 10mo agoIn the video you show a 2D mask to blur diagonal lines. How is that mask applied to the DFT? Is the mask also converted to a DFT and the two signals get combined?
- seam_carver 10mo agoJust remove anything under the mask basically, similar to a low pass filter.
- dmd 10mo agoThe absolute best teaching of the Fourier transform I've ever encountered is the extremely bizarre book "Who is Fourier?" https://www.amazon.com/Who-Fourier-Mathematical-Transnational-College/dp/0964350408 https://www.amazon.com/Who-Fourier-Mathematical-Transnationa...
- calebm 10mo agoThis was my first exposure to the Fourier transfer. I also highly recommend this book. It was recommended to me by the head of the math department at university.
- freshtake 10mo agoIf you're only interested in the gist of the concept and how it can be applied to compression, without the mathematical rigor, here is my go to: https://bertolami.com/index.php?engine=blog&content=posts&detail=the-fourier-colada-analogy https://bertolami.com/index.php?engine=blog&content=posts&de...
- arialdomartini 10mo agoBrilliant! I would just suggest the author to replace the sentence “99% of the time, it refers to motion in one dimension” with “most of the time” since this is a mathematical article and there’s no need to use specific numbers when they don’t reflect actual data.
- devanshp 10mo agoIt's quite interesting that our ears implement a better-than-Fourier-like algorithm internally: https://arxiv.org/pdf/1208.4611 https://arxiv.org/pdf/1208.4611
- gsf_emergency_6 10mo agoArticle on how this might work (nonlinearity) https://jontalle.web.engr.illinois.edu/Public/AllenSpeechProc08.pdf https://jontalle.web.engr.illinois.edu/Public/AllenSpeechPro... Note the two electric circuit models figs 3.2 & 3.8
- geokon 10mo agoOn thing that is often overlooked but should be emphasized is that the considered frequencies are fixed values while the phase shifts are continuous values. This creates tons of downstream problems If your underlying signal is at frequency that is not a harmonic of the sampling length, then you get "ringing" and it's completely unclear how to deal with it (something something Bessel functions) Actually using DFTs is a nightmare .. - If I have several dominant frequencies (not multiples of the sampling rate) and I want to know them precisely, it's unclear how I can do that with an FFT - If I know the frequency a priori and just want to know the phase shift.. also unclear - If I have missing values.. how do i fill the gaps to distort the resulting spectrum as little as possible? - If I have samples that are not equally spaced, how am I supposed to deal with that? - If my measurements have errors, how do I propagate errors through the FFT to my results? So outside of audio where you control the fixed sample rate and the frequencies are all much lower than the sample rate... it's really hard to use. I tried to use it for a research project and while the results looked cool.. I just wasn't able to backup my math in a convincing way (though it's been a few years so I should try again with ChatGPT's hand-holding) I recommend people poke around this webpage to get a taste of what a complicated scary monster you're dealing with https://ccrma.stanford.edu/~jos/sasp/sasp.html https://ccrma.stanford.edu/~jos/sasp/sasp.html
- NL807 10mo agoSomewhat related field, compressive sensing, attempts to answer some of those questions (particularly missing data, uneven sampling and errors) using a L1 minimisation technique.
- amarant 10mo agoI've decided math isn't my thing. The first part of the article I couldn't stop thinking "how the hell would you construct a banana filter?" And the entire smoothie metaphor seemed to describe nothing at all. Then there was something about circles and why do some people call them some other silly thing? So far, so utterly meaningless, as far as I could tell. just seemed like meaningless babble to make even a kindergartner feel comfortable with the article, but it didn't seem to have communicated much of anything, really. Then there were circles. Some of them were moving, one of them had a sinus wave next to it and some balls were tracing both in sync, indicating which part of the sinus wave equalled which part of the circle I guess? I understood none of it. I asked chat gpt to explain to me, i think it has read this article cause it used the smoothie analogy as well. I still don't understand what that analogy is meant to mean. Then finally I found this: If someone plays a piano chord, you hear one sound. But that sound is actually made of multiple notes (multiple frequencies). The Fourier Transform is the tool that figures out: which notes (frequencies) are present, and how loud each one is That, finally, makes sense.
- dsego 10mo agoI wonder if my approach would help with your understanding? https://dsego.github.io/demystifying-fourier/ https://dsego.github.io/demystifying-fourier/
- amarant 10mo agoYes, I could understand almost all of this actually! Thanks for explaining Fourier so well! I really don't have any mathematics in my background, so you lost me towards the very end when the actual math came in, but I can't fault your Fourier explanation for not also explaining imaginary numbers: even I can see they're out of scope for this post!
- dsego 10mo agoImaginary numbers are strange, basically i * i = -1. So it's a square root of negative one. It's imaginary because well, you need some imagination to come to terms with this. But they are useful to show things on a 2d plane, one axis is the real numbers -1 to 1, and the other -i to i. And then multiplying by number i will rotate in circles: i × i = -1, -1 × i = -i, -i × i = 1, 1 × i = i. And then there is this wonderful property that e ^ iπ = -1, which somehow combines the euler constant, number pi and the imaginary number, and it somehow works. And then also the related formula e^ix=cosx+i sinx, and so to rotate by x you just multiply with e^ix, where x = 2π × frequency. It somehow all fits in neatly, even though none of it is essential for the mechanism described. At least that's my uneducated understanding (my math background is also not that great, that's why I tried to explain this to myself with a more intuition based approach).
- hasley 10mo agoI have not read the whole article. But, what is shown at the beginning is not the Fourier Transform, it is the Discrete Fourier Transform (DFT). Though the DFT can be implemented efficiently using the Fast Fourier Transform (FFT) algorithm, the DFT is far from being the best estimator for frequencies contained in a signal. Other estimators (like Maximum Likelihood [ML], [Root-]MUSIC, or ESPRIT) are in general far more accurate - at the cost of higher computational effort.
- casparvitch 10mo agoNot a particularly fair comparison, the DFT is a non-statistical operation.
- hasley 10mo agoWhy do you think, that it is not fair? You can even use these algorithms with a single snapshot (spatial smoothing).
- casparvitch 10mo agoStatistical algorithms always make more concrete assumptions of the signal. DFT / Fourier transforms are great as they are a direct mathematical operation, that maps neatly to (basic) equations. There's a lot you can do, and easily grok, with FTs. Once you get statistical, a lot of things are harder :) If you want pure performance, and understand the underlying statistical processes, then sure I totally agree with you.
- roflmaostc 10mo agoCan you provide more details please? The FFT is still easy to use, and it you want a higher frequency resolution (not higher max frequency), you can zero pad your signal and get higher frequency resolution.
- hasley 10mo agoZero-padding gives you a smoother curve, i.e., more points to look at. But it does not add new peaks. So, if you have two very close frequencies that produce a single peak in the DFT (w/o zero-padding), you would not get two peaks after zero-padding. In the field, were I work, resolution is understood as the minimum distance between two frequencies such that you are able to detect them individually (and not as a single frequency). Zero-padding helps you to find the true position (frequency) of a peak in the DFT-spectrum. So, your frequency estimates can get better. However, the peaks of a DFT are the summits of hills that are usually much wider than compared to other techniques (like Capon or MUSIC) whose spectra tend to have much narrower hills. Zero-padding does not increase the sharpness of these hills (does not make them narrower). Likewise the DFT tends to be more noisy in the frequency domain compared to other techniques which could lead to false detections (e.g. with a CFAR variant).
- mohas 10mo agoWill I ever be able to learn the Fourier transform?
- rkomorn 10mo agoYes! Step 1 is forgetting about the name so it doesn't feel as daunting. Disclaimer: I've not actually done step 1, but I have more faith in you than in myself.
- vismit2000 10mo agoThis is the best content on this topic - a 2023 video by Reducible: https://www.youtube.com/watch?v=yYEMxqreA10 https://www.youtube.com/watch?v=yYEMxqreA10
- HPsquared 10mo agoI'd never thought about it in this way before but the idea of writing a number as a decimal (or other) string of numerals, bears some resemblance to a Fourier transform. Think of the components of a written number: ones, tens, hundreds etc which have a repeating pattern. Digits are inherently periodic. Not too far from periodic basis functions. Both involve breaking something down into periodic components, and reversing the process by adding up the components.
- IAmBroom 10mo agoClever, but only really appropriate for the most significant digit. The one's digit gives info about parity (odd/even), but nothing else.
- stevenjgarner 10mo agoThis is great! I would love to see this method extended to the full Pasterski–Strominger–Zhiboedov (PSZ) triangle, where Fourier transforms are the binding relationships tying together soft theorems and memory effects. Such an extended guide would be a powerful interaction encompassing also vacuum transitions and Ward's identities. A "smoothie" combining the theory of relativity, quantum field theory and quantum gravity might make those subjects more accessible.