Discussion about this post

User's avatar
lcamtuf's avatar

PS #1: If you're curious about the reason the bit-twiddling Hadamard matrix construction method works, I explore it a bit more in the article on the Sierpiński triangle: https://lcamtuf.substack.com/p/sierpinski-triangle-in-my-bitwise/. There is a comment under the article that ties it back to Hadamard.

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
Megan Jones's avatar

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
7 more comments...

No posts