You said: "Not slower or faster, but more — I want to learn more about the Fourier." Here it is. The whole idea fits in one sentence, and then takes a lifetime to use: every complicated sound is secretly made of simple waves added together. This page lets you add them, hear them, and take them back apart.
Nothing here autoplays. Every sound has a Play and a Stop, and the volume is kept deliberately low. Move a slider and the drawing changes immediately — that is the point: you are not reading about waves, you are steering them.
Start with the simplest sound there is: a sine wave. It has only two things you can change — how fast it wiggles and how big the wiggle is.
Period T = 1/f = 1/220 s = 4.545 ms · the window above is 20 ms wide, so you should see about 4.4 cycles
Here is the entire mechanism, and it is almost insultingly simple: adding waves means adding heights at every moment in time. At each instant, take wave 1's height, plus wave 2's height, plus wave 3's — that sum is the new wave. Nothing more clever is happening.
A B C — the three parts, drawn small
A + B + C — the sum, which is the sound that actually reaches your ear
Tip: set A and B to almost the same frequency and listen. The slow throbbing is called beating — the two waves drift in and out of step. Beat rate = the difference in Hz.
Real instruments never make a single sine wave. They make a fundamental (the note you name) plus harmonics — extra sine waves at exactly 2×, 3×, 4×… the fundamental frequency. Same note, different harmonic recipe, completely different instrument. That recipe is what we call timbre.
Same note, different harmonics → different timbre. That is why a flute and a violin playing the same A both sound like A, and yet you would never confuse them. The flute is nearly a pure fundamental with a whisper of 2f. The violin is a bonfire of harmonics — a bow scraping a string re-excites it hundreds of times a second, and every one of those kicks pours energy into the higher multiples.
Notice what the odd harmonics only preset looks like: it starts squaring off. Keep adding odd harmonics with amplitude 1/n and you converge on a perfect square wave. That is a Fourier series, built by hand, by you.
Adding waves is easy. The hard direction — the one that has a mathematician's name on it — is going backwards: here is a messy wave, what simple waves is it made of? Try it. A mystery sound is hiding below, built from harmonics of 200 Hz. Move your guess sliders until your wave matches it.
mystery your guess
match: —
Every one of these works by moving into the frequency domain, doing something easy there, and coming back. That move is the trick. The thing you do in the middle is usually almost trivial.
Your photo is cut into 8×8 pixel blocks — 64 numbers. A DCT (the Fourier transform's close cousin, built from cosines only) turns those 64 numbers into 64 coefficients: how much flat grey, how much slow gradient, how much fine checkerboard. Nothing is lost yet. 64 in, 64 out, perfectly reversible.
Then comes the only lossy step in the entire format: divide each coefficient by an entry in a quantisation table, and round to a whole number. In the standard table the divisors run from 16 in the top-left corner (flat, slow stuff — where your eye is fussy) to 99 in the bottom-right (finest checkerboard — where your eye is not). A fine-detail coefficient of 40, divided by 99, rounds to 0. Gone, permanently. Drag the quality slider down and every divisor is scaled up, so more of the block rounds to zero — and long runs of zeros compress to almost nothing.
Which is the point worth carrying out of this whole section: the transform is not the compression. The transform is what makes the throwing-away safe to do. Same move every time — go to the frequency domain, do something almost trivial, come back.
Up to now the recipe was always handed to you. Here it is the other way round: you draw any shape you like, and the page works out the ingredients. Drag your finger or mouse across the pad below and scribble. Anything — a ramp, a spike, your initials, nonsense. The bars underneath are the answer to "what sines is that made of", computed the honest slow way (a discrete Fourier transform, 256 samples, no shortcuts).
what you drew rebuilt from the first 24 harmonics only
FREQUENCY DOMAIN — the strength of each harmonic of 220 Hz, measured from your drawing
recipe: —
Watch the red curve while you draw. It is not a copy of your line — it is only the first 24 sine waves, added up. Where your drawing is smooth, red sits right on top of black. Where you drew a sharp corner or a vertical cliff, red wobbles and refuses to keep up. That gap is the entire story of this page: sharp things need high frequencies, and 24 of them is not enough for a cliff.
Draw a narrow spike and look at the bars: almost every harmonic lights up, all at similar heights. Draw one slow smooth hump and only the first two or three bars survive. A spike in time is spread out in frequency; a spread-out thing in time is a spike in frequency. That trade is not a coincidence — it is a theorem, and physicists meet it again as the uncertainty principle.
Note on what "play what you drew" actually does: it fires up one sine oscillator per bar, at the height of that bar, and ignores phase entirely. Your ear barely hears phase, so it still sounds like your drawing — but the red curve on the pad does use phase, which is why it matches your shape so much better than a phase-free rebuild would.
Fourier's claim was that any repeating shape can be written as a sum of sines. A square wave is the rudest possible test of that claim: it is flat, then it jumps, instantly. Sines are the smoothest things in mathematics. Watch them do it anyway.
the target shape your partial sum the overshoot band
—
The recipes, exactly. Every number below is a fraction, not an approximation:
Slide the terms up and listen as well as look. The square and the sawtooth both fall off as 1/n — slowly — which is why they still sound bright and buzzy at 30 terms. The triangle falls off as 1/n², four times faster per octave, and sounds almost as soft as a flute. How fast the harmonics die tells you how sharp the shape is. A jump gives you 1/n. A corner gives you 1/n². Something perfectly smooth dies faster than any power of n.
The interesting part
Push the square wave up to 30 terms and look hard at the corner. The wiggles get narrower — they crowd in towards the jump and vanish everywhere else. But the height of the first wiggle does not shrink. It parks at about 8.95% of the jump and stays there. Ten terms, a thousand terms, a billion: still 8.95%.
This is the Gibbs phenomenon, and it caught out very good people. The physicist Albert Michelson built a mechanical harmonic analyser in the 1890s, fed it a square wave, and got the overshoot on paper. He assumed his machine was faulty. It was not — the mathematics really does that. Josiah Willard Gibbs explained it in 1899. (Henry Wilbraham had already found it in 1848 and been ignored, which is its own kind of lesson.)
The exact number is not 9% by coincidence. The partial sum's peak converges to (2/π)·Si(π) = 1.178980 times the half-jump, where Si is the sine integral. Overshoot above the target = 0.178980 of the half-jump = 8.9490% of the full jump. The readout above measures it live from the actual partial sum, so you can watch it settle onto that number rather than take my word for it.
Now switch the target to triangle and try to make it overshoot. You cannot. A triangle has corners but no jump — the shape never teleports — and the overshoot lives entirely at jumps. The partial sum climbs towards the triangle from underneath and never passes it. Same mathematics, different shape, completely different behaviour: that is the kind of thing worth asking "what assumption changed?" about.
Practical bite: Gibbs is why over-sharpened photos get bright halos at hard edges, and why a clipped, brutally filtered audio signal can "ring" around a transient. Real engineers do not defeat it, they dodge it — they smooth the recipe (window it) and accept a slightly blurrier edge in exchange for no ringing.
Everything you just built by hand is this line:
Reading it left to right, in English:
The claim Fourier actually made is bolder than the equation looks: any repeating wave — no matter how jagged — can be written this way, with the right list of aₙ. Not approximately. Given infinitely many terms, exactly.
And the sequel, which is where computers come in: finding the aₙ from a recorded wave naively costs about N² multiplications. For N = 44,100 samples — one second of CD audio — that is roughly two billion operations, per second of sound. There is an algorithm called the FFT (Fast Fourier Transform) that does the same job in about N·log₂N ≈ 700,000. That is a factor of ~2,800 — and it is why your phone can do this in real time while you walk. Same mathematics, different cost. You have met this shape of argument before, in Amdahl: the interesting question is rarely "can it be done" but "what does it cost, and where does the cost hide".
FFT is the next module. Everything you just did by hand is what it does, quickly.
Five questions with no answer key. Not homework. Pick whichever one annoys you most, go read, and bring what you find.
Bring one of these to your next session. The rule stays the same: don't just learn the rule — ask what assumption makes the rule true, and whether that assumption can be changed.
Everything here is a repeating wave built from whole-number harmonics, because that is the clean case. Real sounds start, change and stop — a plucked string's harmonics fade at different rates, and that fading is most of what makes it sound plucked. Handling sounds that change over time needs a bigger tool (short-time Fourier transforms, spectrograms, wavelets). This page is the honest first floor of that building, not the whole building.
Three more things it cannot show you, now that you have section 6 and 7 in hand. One: the drawing pad measures only 24 harmonics from 256 samples — with 256 samples the most you could ever resolve is 128, and past that the transform starts reporting high frequencies as low ones (aliasing). Nothing on this page will warn you when that bites. Two: the pad assumes your drawing repeats forever, seamlessly. If your left edge and right edge do not meet at the same height, you have secretly drawn a jump, and the spectrum will honestly report the harmonics of that jump — which you did not think you drew. Three: the convergence section adds terms one at a time and lets you watch, which is a lie about speed. A real FFT does not converge towards an answer; it computes all the coefficients at once, exactly, and the picture of "watching it get better" has no counterpart inside the algorithm.