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
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 n | Coefficient for A = 1 |
|---|---|
| 1 | 4/π ≈ 1.273 |
| 2 | 0 |
| 3 | 4/(3π) ≈ 0.424 |
| 5 | 4/(5π) ≈ 0.255 |
| 7 | 4/(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
| Symbol | What it means | Example |
|---|---|---|
| T | The period: time for one repeat | 1 s |
| n | The harmonic number (1, 2, 3, …) | 3 |
| aₙ, bₙ | Cosine and sine coefficients of harmonic n | b₃ ≈ 0.849 |
| a₀/2 | The average level of the signal | 0 for a square wave |
| A | Amplitude of the square wave | 2 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:
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
- 1Check the harmonic number. If n is even, the coefficient is 0, because the square wave's symmetry cancels even harmonics.
- 2Multiply the amplitude by 4. For A = 2, that's 8.
- 3Divide by n × π. For n = 3,
8 ÷ (3 × 3.14159) ≈ 0.849. - 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.
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.
- 01For square wave: b3 = (4×2)/(π×3)
- 02= 8/9.4247
- 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.


