3 ms·
Here's Weierstrass in Python: https://scipython.com/blog/the-weierstrass-function https://scipython.com/blog/the-weierstrass-function I wonder what they sound
by thomassmith65 2y ago
Here's Weierstrass in Python: https://scipython.com/blog/the-weierstrass-function https://scipython.com/blog/the-weierstrass-function
I wonder what they sound like as audio.
Edit: apparently it sounds like this https://youtu.be/vWmZnlPQK14 https://youtu.be/vWmZnlPQK14
- waveBidder 2y agohonestly less terrible than I was expecting
- thomassmith65 2y agoWhat piqued my interest is that the illustration in the article looks a lot like a typical organic audio waveform. That's unusual. At a lower pitch, with some variation in pitch and amplitude, it probably sounds nicer.
- emmanueloga_ 2y agoAt some frequencies sounds like a more (or less) chip-crushed church organ.
- praptak 2y agoAudio spectrum is bounded, so we are only hearing the first few terms of the series that make up the function (the coefficient under sine grows exponentially with n). You could even replace the audible part with Chopin (or anything else, even f(x)=0) to get a Weierstrass-like function which sounds like Chopin (or silence) but is still not differentiable anywhere.
- emmanueloga_ 2y agoMy attempt at nice looking TS version: function sum(f: (x: number) => number, upper = 500) { let sum = 0; for (let n = 0; n < upper; n++) sum += f(n); return sum; } const weierstrass = (x: number, a = 0.5, b = 3) => sum(n => a ** n * Math.cos(b ** n * x));