12 Comments
author
Apr 7·edited Apr 8Pinned

PS #1: Apologies to all the folks who signed up for this after the xz article and didn't realize what's coming!

PS #2: Here's a person experimenting with Walsh-Hadamard for image compression: http://rotormind.com/blog/2019/hadamard-days-night/

Plus, some technical details about the spectrograms shown at the bottom. They were calculated with DCT and WHT from a 44.1 kHz mono audio file. Input sample window was 512 with a transform stepover of 1, producing an output array with dimensions around 512 x 485k. Pixel intensities correspond to normalized absolute values with a gamma of around 0.4 (i.e., pixel = fabs(orig_value / window_size) ^ 0.4)). The image was then resized with Lanczos resampling, and rendered with a linear black - sky blue - white colormap.

Expand full comment

In the classical FFT, the result includes real *and* imaginary parts, so...

Expand full comment

I want to get this straight in my head for future reference (it's been a while since I thought precisely about this type of thing). As someone coming from a chemistry background, I've worked with the frequency domain (though my hands-on with low-level implementations is limited, I did have some spectroscopy research projects where I had to use Fourier transforms more explicitly rather than just clicking a button). In general, we see it often in spectroscopy, or looking at electrons and atoms in molecules, reciprocal space and wave functions in crystallography and quantum chemistry, and more. Going a little deeper, things like electron spin behavior come to mind. Even lower, we know of the role of complex numbers and probability densities in quantum mechanics. But I see your point that in many cases we impose these constructs to make sense of signals analytically. Is that what you're saying, and am I looking at it through a similar lens to you? Does the claim that frequency domain space is just a construct hold up in more "fundamental" fields like chemistry and physics in your view? What does this say about our understanding of the world? I have some thoughts about this in relation to AI and human-computer interaction, and how theories shape our beliefs and how this might end up with us living in a world with coercive AI but that's for another post :) thanks for the gentle and intuitive post!

Expand full comment

This is a great article, but for future ones, could you use Rust instead of C for any code? Rust is now the preferred programming language for code examples.

Expand full comment

A better question than the title of this piece would be "What other transforms can we imagine that help us understand things for which the DFT is of little help?" That we could choose other transforms and calculate them easily isn't all that interesting until we see the insights that those other transforms open for us.

Expand full comment