logoalt Hacker News

XKCD and Fourier

75 points • by surprisetalk • last Tuesday at 1:00 PM • 25 comments • view on HN

Comments

bmacho • today at 10:43 AM

> First, of course, was a smile of recognition. Then came a “wait a minute” as you realized that the Gibbs phenomenon doesn’t get smaller as you add more terms to the Fourier expansion;

Actually, it gets. Gibbs phenomenon is an artifact of a very specific algorithm. It doesn't say nothing on "approximation" in general, and arguably, it doesn't appear meaningfully in any types of approximation.

You can approximate a square wave with sine waves with arbitrary precision in most approximations (L1, L2, pointwise etc). What you can't do is to have the largest error less than half the jump at discontiunity, but it is because sum of sine waves is continuous. There is no overshoot or Gibbs of any sort.

nukanse • today at 10:25 AM

Sin cos are exponentials. There is a shorter way to create a square wave function: take a tiny base 0<b<1, and any initial function 0<f(x)<1 Iterate b^f(x), and it produce a square wave with smooth corners

TeMPOraL • today at 9:16 AM

If you've ever used an oscilloscope to look at a square wave in electronics, or did any audio synthesis, you look at the ending of the post and raise an eyebrow (in the way Spock does it), and note that yes, this is what square waves are in real life. The corner wobble is normal.

➕ show 1 reply
tristanj • today at 6:27 AM

In order for this to work, you'd need to know the direction of the observer you're targeting, since the relative phases/amplitudes of gravitational waves would only cancel out in some directions and not others.

➕ show 1 reply
josselex • today at 8:20 AM

If you low pass filter, which any detector will do, it should go away.

➕ show 2 replies
arbasli2 • today at 8:03 AM

but still the joke is very funny and not too far from correct.

pyrale • today at 9:39 AM

related xkcd: https://xkcd.com/356/

➕ show 1 reply
amelius • today at 10:04 AM

You will surprise more than just a bunch of astronomers if you manage to move black holes like that.

mrheosuper • today at 6:46 AM

You just need to add more black holes, ideally infinite.

➕ show 1 reply
normalperverts • today at 7:24 AM

Alternatively, you can just mess with the measuring device's precision until the corners are imperceptible.

But if that's still hard, then we can still achieve it with sufficient, or perhpas too much, alchool. Just avoid a particular amount of blood alchool, the scientist will instantly call your black holes out.

seanhunter • today at 7:13 AM

As they say “Explaining a joke is like dissecting a frog: you may learn a lot but something dies.”

➕ show 3 replies
cobychapple • today at 7:01 AM

if you can arrange infinitely many black hole binaries at odd harmonic frequencies, a 9% overshoot at the corners feels like an acceptable tolerance.

bonus: also related very early xkcd https://xkcd.com/26/

stuaxo • today at 9:36 AM

Eh, looks square wave enough for me