There are three common parameterizations of a Fourier series. First is amplitude–phase form with A_n and \phi_n:
Using \sin(\alpha+\beta)=\sin\alpha\cos\beta+\cos\alpha\sin\beta , each term expands as
so the cosine–sine coefficients are a_n=A_n\sin\phi_n and b_n=A_n\cos\phi_n, yielding
Finally, the same series can be written using complex exponentials e^{i2\pi n t} with coefficients c_n:
where the conversions are c_n=\frac{1}{2}(a_n-i b_n) and c_{-n}=\frac{1}{2}(a_n+i b_n) for n>0.
These checkboxes affect how the waveform is visualized and analyzed.
Normalize RMS. Rescales the waveform to a target root-mean-square level so that changes in coefficient magnitude do not immediately cause large swings in perceived amplitude. This uses \mathrm{RMS}=\sqrt{\frac{1}{M}\sum_{i=1}^{M} f(t_i)^2} .
Auto-scale plot. Automatically scales the main waveform so it fits vertically in the plot area, which makes small-amplitude changes easier to see.
Derivative view. Displays the derivative series by transforming coefficients:
Each preset is a standard Fourier series with a specific pattern of harmonic coefficients. These patterns control the smoothness, symmetry, and sharpness of the waveform.
Pure tone. A single harmonic produces a sinusoid at one frequency, for example:
Square wave. Odd harmonics only, with amplitudes that decay as A_n=\frac{4}{\pi n} for odd n, and zero for even harmonics.
Sawtooth. All harmonics appear with alternating sign:
Triangle. Odd harmonics only with faster decay, producing a smoother signal:
Spike (Dirichlet-ish). Equal-strength harmonics approximate a narrow impulse train, concentrating energy at many frequencies. This uses roughly constant amplitudes, which makes the partial sum resemble a Dirichlet kernel:
As N grows, the main lobe narrows while side lobes persist, so the signal looks like a spike repeated once per period.
Random phase with decay. Same as clicking Randomize phases in Apply to All: uses the current power-law decay p so that A_n\propto 1/n^p, then randomizes phases to produce a noisy but structured waveform.
These settings shape the entire series before you edit any individual harmonic.
Max harmonics (N). Sets how many terms are used in the series. Larger N resolves sharper features but increases complexity.
a0. Sets the DC offset a_0/2, shifting the waveform up or down.
Time shift t0. Rotates coefficients in phase. The transformed coefficients are:
Even / Odd harmonics. Keeping only even or only odd n isolates symmetry and changes the waveform’s structure.
Partial sums help visualize convergence and show how the waveform builds as harmonics are added.
Show partial sum. Compares the truncated series S_{N_{\text{partial}}}(t) with the full reconstruction.
Show convergence ladder. Overlays S_5, S_{10}, S_{20}, S_N to show how the series builds.
You can edit coefficients directly or via amplitude and phase.
a/b mode. Directly edit a_n and b_n.
A/φ mode. Edit amplitude and phase where:
Harmonic selector. Chooses which n you are editing at a time.
These tools modify all harmonics at once to shape the spectrum quickly.
Power-law decay. Sets A_n\propto 1/n^p across all harmonics.
Randomize phases. Uses the current Power-law decay p to set each amplitude to A_n = 1/n^p, then assigns a random phase \phi_n in [-\pi,\pi] to each harmonic. So the spectrum bars follow the decay you chose, and only the phases (purple dots) are randomized. Use the decay slider above to control how amplitudes fall off before clicking.
Low-pass, band-pass, high-pass. Zero coefficients outside the selected band to sculpt the spectrum. The app uses fixed bands based on the current N:
The footer bar lets you hear the current Fourier series as a periodic sound. The shape of the waveform (and thus the timbre) is completely determined by your set of amplitudes A_n and phases \phi_n; nothing in the audio bar changes that shape.
Play / Stop. Click Play to start playback of the waveform defined by your current coefficients. The same series you see in the Waveform plot is sent to the Web Audio API as a periodic wave: the harmonic coefficients a_n and b_n (after any time shift) are used to build the sound. The button toggles to Stop; click again to stop playback. Changing coefficients, presets, or sliders updates the sound in real time while it is playing.
f0 (Hz). The fundamental frequency in Hertz: how many times per second that one-period shape is repeated. It does not change A_n or \phi_n; it only sets the pitch. The period is 1/f_0 seconds, so higher f_0 means a higher note. Harmonic n is played at n f_0 Hz.
Volume. Master gain for playback (0–1). Does not change the waveform shape, only its loudness.
Remove DC. When checked, the DC term a_0/2 is set to zero in the audio output. This avoids a constant offset in the signal, which can cause clicks when starting/stopping or unwanted low-frequency rumble. The Waveform plot still shows the full series including DC.