Compute Fourier cosine and sine coefficients for standard periodic waveforms.
The Fourier series represents a periodic function as a sum of sines and cosines: f(x) = a₀/2 + Σ[aₙcos(nx) + bₙsin(nx)]. This calculator provides exact coefficients for standard waveforms (square, sawtooth, triangle) and numerical coefficients via integration for custom functions on [-π, π].
Fourier series
f(x) = a₀/2 + Σ [aₙ·cos(nx) + bₙ·sin(nx)]
Coefficients
aₙ = (1/π)∫[-π,π] f(x)cos(nx)dx, bₙ = (1/π)∫[-π,π] f(x)sin(nx)dx
The square wave is an odd function, so all cosine (even) coefficients are zero. Only odd harmonics appear: b₁, b₃, b₅, ...
Smooth functions converge quickly (5-10 terms). Discontinuous functions like square waves converge slowly due to Gibbs phenomenon.