Skip to content
    Calculus

    Fourier Series Explained: Square Wave Coefficients

    How can a sharp-cornered square wave be made from smooth sine waves? It sounds impossible, but add enough of them and the corners appear. That's a Fourier series. This guide explains the idea like a musical chord and shows how to find the square wave's coefficients.

    Math Solver Academic Editorial Board6 min read

    Key takeaways

    • A Fourier series builds a repeating signal from sine and cosine waves.
    • For a square wave between +A and −A: bₙ = 4A/(nπ) for odd n, and 0 for even n.
    • Each harmonic is smaller: the 3rd is one-third of the 1st.
    • The period T changes the frequencies, not the coefficient sizes.
    In this guide
    1. 01What is a Fourier series?
    2. 02Why do Fourier series matter?
    3. 03The general formulas
    4. 04How to find the coefficients step by step
    5. 05Common mistakes to avoid
    6. 06Tips and tricks
    7. 07Where you'll use it in real life
    8. 08Quick summary
    9. 09Worked example
    10. 10Frequently asked questions

    What is a Fourier series?

    Think of a musical chord. One sound is really several pure notes played together. A Fourier series does the same for any repeating signal: it splits it into a sum of pure waves. There is a basic wave, the fundamental, that repeats once per period, plus faster waves called harmonics that repeat 2, 3, 4, … times per period.

    Each wave gets a number called a coefficient, which says how big that harmonic is. Find the coefficients and you have the recipe for the signal.

    Why do Fourier series matter?

    Fourier's idea changed science and technology. Once a signal is split into pure frequencies, you can boost the bass in music, remove hum from a recording, compress sound and images, or find the vibration that's about to break a machine.

    The square wave is the classic example. It has sharp corners, yet it is built only from smooth sine waves.

    Harmonic nCoefficient for A = 1
    14/π ≈ 1.273
    20
    34/(3π) ≈ 0.424
    54/(5π) ≈ 0.255
    74/(7π) ≈ 0.182
    Add more and more odd harmonics and the wiggly sum gets closer and closer to a perfect square wave. Only near each jump does a small overshoot remain.

    The general formulas

    f(t) = a₀/2 + Σ [aₙ cos(2πnt/T) + bₙ sin(2πnt/T)]
    aₙ = (2/T) ∫₀ᵀ f(t) cos(2πnt/T) dt, bₙ = (2/T) ∫₀ᵀ f(t) sin(2πnt/T) dt
    SymbolWhat it meansExample
    TThe period: time for one repeat1 s
    nThe harmonic number (1, 2, 3, …)3
    aₙ, bₙCosine and sine coefficients of harmonic nb₃ ≈ 0.849
    a₀/2The average level of the signal0 for a square wave
    AAmplitude of the square wave2 V

    What this calculator computes

    The calculator works with one important signal: a square wave that switches between +A and −A, spending half of each period at each level and starting at +A at t = 0. For this wave all cosine coefficients are 0, and the sine coefficients are:

    bₙ = 4A/(nπ) for odd n, and 0 for even n

    The result is labelled bₙ. The period T changes the frequency of each harmonic but not its size, so it doesn't change the answer. So the square wave is 4A/π × [sin(ωt) + sin(3ωt)/3 + sin(5ωt)/5 + …], where ω = 2π/T. It needs a positive whole-number harmonic n, T > 0 and A ≥ 0.

    How to find the coefficients step by step

    1. 1Check the harmonic number. If n is even, the coefficient is 0, because the square wave's symmetry cancels even harmonics.
    2. 2Multiply the amplitude by 4. For A = 2, that's 8.
    3. 3Divide by n × π. For n = 3, 8 ÷ (3 × 3.14159) ≈ 0.849.
    4. 4Repeat for n = 1, 3, 5, … to build the series. Each harmonic is smaller than the last.

    Now try your own harmonic, period and amplitude below and watch the coefficient shrink as n grows.

    Try it yourself

    Pre-filled with the example — change any value.

    🧮
    Advanced Mathematics
    University

    Fourier Series Coefficient

    Calculate the Fourier sine coefficient bₙ of a square wave with amplitude A (4A/nπ for odd n, 0 for even n)

    bₙ = (2/T)∫[0 to T] f(t)sin(2πnt/T)dt

    n = 3Active Variable
    Dynamic Formula Model
    0.120
    120
    0.120

    💡 Example

    Reference
    Inputs:n=1, T=2, A=1
    Result:1.273
    Open the full Fourier Series Coefficient calculator

    Common mistakes to avoid

    • Mixing up aₙ and bₙ. Odd functions, like this square wave, have only sine terms; even functions have only cosine terms.
    • Forgetting the 2/T factor when you work out coefficients by integration yourself.
    • Expecting a perfect corner. The sum overshoots by about 9% of the jump near each corner (the Gibbs phenomenon), however many terms you add.
    • Thinking T changes the size. It only changes how fast each harmonic wiggles.

    Tips and tricks

    • Symmetry saves work: odd function → only sines; even function → only cosines.
    • Frequency of harmonic n: it is n ÷ T cycles per second. With T = 1 s, the 3rd harmonic is 3 Hz.
    • Build-up: the coefficients come from definite integrals of sine and cosine.

    Where you'll use it in real life

    • Audio: equalisers, synthesisers and MP3 compression.
    • Electronics: analysing digital clock signals and filters.
    • Engineering: finding dangerous vibration frequencies in machines and bridges.
    • Science: solving heat and wave equations; for non-repeating signals, see the Laplace transform.

    Quick summary

    A Fourier series writes a repeating signal as a sum of sine and cosine waves. For a square wave between +A and −A, only odd harmonics appear, with bₙ = 4A/(nπ). Use the calculator above to find any harmonic's coefficient with the working shown.

    Worked example

    A digital clock signal is a square wave switching between +2 volts and −2 volts, repeating once every second. How big is its 3rd harmonic, the wave that repeats 3 times per second? Use n = 3, T = 1 and A = 2.

    1. 01For square wave: b3 = (4×2)/(π×3)
    2. 02= 8/9.4247
    3. 03= 0.849

    These numbers are pre-filled in the calculator above.

    Frequently asked questions

    What is the Fourier series of a square wave?

    For a square wave between +A and −A starting at +A, it is (4A/π)[sin(ωt) + sin(3ωt)/3 + sin(5ωt)/5 + …], with ω = 2π/T. Only odd harmonics appear.

    Why are the even Fourier coefficients of a square wave zero?

    The square wave has half-wave symmetry: the second half of each period is the first half flipped upside down. That makes the integrals for every even harmonic cancel to 0.

    What is the first Fourier coefficient of a square wave with amplitude 1?

    It is 4/π ≈ 1.273. The 3rd harmonic is 4/(3π) ≈ 0.424, and the 5th is 4/(5π) ≈ 0.255.

    What is the difference between a Fourier series and a Fourier transform?

    A Fourier series is for repeating signals and uses separate harmonics 1, 2, 3, …. A Fourier transform handles signals that don't repeat, using a continuous range of frequencies.

    #Advanced Mathematics#University#Fourier Series Coefficient
    Updated

    Related calculators

    Keep reading

    Sponsored ToolsAd

    More tools on Ytools →
    Calcu.click — 25+ Free Smart Calculators preview

    Calcu.click — 25+ Free Smart Calculators

    Brand new calculation platform with 0ms reactive math, 100% client-side privacy, and dedicated subdomains. Fast calculators for EMI, SIP, Mortgage, Income Tax, BMI, Age, Percentage, and more.

    25+ CalculatorsFinanceHealth0ms Real-TimeFree
    Keyboard Arena preview

    Keyboard Arena

    Master touch typing with real-time WPM speed tests, mechanical switch audio, A-Z finger biomechanics drills, 40+ structured lessons, and competitive arcade games.

    Typing TestWPMTouch Typing
    Flutter Log Explorer preview

    Flutter Log Explorer

    Real-time structured log viewer and search explorer for Flutter & Dart. Zero-config capture from Debug Adapter (DAP) & Dart VM Service with smart classification and filters.

    FlutterDartVS Code ExtensionOpen VSX