Skip to main content

Fourier Series Coefficients Calculator

Quick answer

This calculator computes a₀, aₙ, bₙ = (2/T)∫f·cos/sin: a square wave has bₙ = 4/(πn) for odd n — first harmonic amplitude 4/π ≈ 1.273.

  • Working shown.

Figures are estimates from this calculator’s standard formula — adjust the inputs in the tool below for your exact number.

How Fourier Coefficients Are Computed

a₀ = (2/T)∫f dt | aₙ = (2/T)∫f(t)cos(2πnt/T)dt | bₙ = (2/T)∫f(t)sin(2πnt/T)dt

A Fourier series rebuilds a periodic signal as a sum of sines and cosines at multiples of the base frequency 1/T. Each coefficient is an inner product: multiply the signal by the harmonic, average over one period. For the odd square wave of amplitude ±1 and period 2π, the cosine coefficients vanish (aₙ = 0) and integration by parts yields bₙ = 4/(πn) for odd n only: b₁ = 4/π ≈ 1.273, b₃ = 4/(3π) ≈ 0.424, b₅ ≈ 0.255. Partial sums converge with the characteristic overshoot near discontinuities — the Gibbs phenomenon, about 9% of the jump regardless of term count. The calculator evaluates the integrals for standard waveforms (square, sawtooth, triangle, pulse), lists coefficients and amplitudes √(aₙ²+bₙ²), and reports the harmonic-by-harmonic RMS reconstruction error.

  1. 1

    Choose or define the waveform

    Standard shapes or piecewise definition over one period

  2. 2

    Integrate for each coefficient

    a₀, aₙ, bₙ formulas are evaluated with steps

  3. 3

    Assemble the series

    f(t) ≈ a₀/2 + Σ aₙcos + bₙsin

  4. 4

    Measure reconstruction

    Amplitude spectrum and Gibbs overshoot are reported

Use Cases

Signal Processing

Spectra of waveforms: square wave energy at odd harmonics

AC Electronics

Distortion analysis from harmonic amplitudes

Heat Equation

Series solutions start from Fourier coefficients

Tips

  • 1

    Odd square wave: only odd sine terms, bₙ = 4/(πn)

  • 2

    Symmetries kill whole coefficient families (even → no bₙ)

  • 3

    Gibbs overshoot stays near 9% of the jump no matter the terms

Common Mistakes

  • Forgetting the 2/T normalization on the integrals

  • Including even harmonics for a half-wave symmetric square wave

  • Reporting a₀ without halving in the series convention

  • Expecting the overshoot to vanish by adding terms — it narrows but persists

FAQs

What are the coefficients of an odd square wave?

bₙ = 4/(πn) for odd n: b₁ ≈ 1.273, b₃ ≈ 0.424, b₅ ≈ 0.255; all aₙ = 0.

What is a₀?

Twice the average value of the signal over a period — zero for symmetric waves.

What is the Gibbs phenomenon?

A ~9% overshoot ringing near each discontinuity that survives any number of terms.

Why do even harmonics vanish?

Half-wave symmetry f(t+T/2) = −f(t) forces every even-index coefficient to zero.