Skip to content
Tactiverge

Textbooks/Signals and Systems/Chapter 6Lite (plain text) version

6Sinusoids and Fourier series

Version 1 · Technically checked (automated checks only) · 2 source lessons · 7 practice items

Text
All chapters and search
  1. 1. Signals and noise
  2. 2. Sampling and the Nyquist rate
  3. 3. Aliasing: when samples lie
  4. 4. Quantisation and resolution
  5. 5. Smoothing filters
  6. 6. Sinusoids and Fourier series
  7. 7. The DFT: measuring a spectrum
  8. 8. Filters seen in frequency

Introduction

Add sinusoids together and you can build almost any repeating shape. A spectrum is the recipe: a bar for each ingredient frequency, its height the amplitude. A square wave, all sharp corners, turns out to be odd harmonics only, with amplitudes falling as one over the harmonic number. Seeing signals as sums of sinusoids is the change of viewpoint that makes filters, music and radio understandable.

A square wave is odd harmonics only1.27310.42430.25550.1827amplitude = 4 / (π·k)
Figure 6.1. A square wave is odd harmonics only. The spectrum of a unit square wave: bars only at odd harmonics, with amplitude 4/(πk). k = 1: 1.273, k = 3: 0.424, k = 5: 0.255, k = 7: 0.182; even harmonics are absent.

Explanation

This chapter is built from 2 School lessons. Each part below is the lesson's own explanation; open the lesson for its predict-and-discover activities.

6.1 Seeing a signal's ingredients

A chord played on a piano is one wobbly line on an oscilloscope. How can a tuner app name every note in it?

Two views of one signal

The time domain shows value against time. The frequency domain shows how much of each frequency is present. A magnitude spectrum draws a bar of height Aᵢ at each fᵢ. The same information, arranged differently, like a recipe versus the cake.

Phase hides in the time view

Shifting a component's phase reshapes the waveform (peaks can line up or cancel) but leaves its bar the same. That is why two signals that look different can sound identical: your ear cares mostly about magnitudes. A full description keeps the phase too, so the time signal can be rebuilt.

Power adds across frequencies

Sinusoids of different frequencies average to zero when multiplied together, so the cross terms vanish and P = Σ Aᵢ²/2. That is Parseval's theorem in miniature: power computed in time equals power computed from the spectrum. Components at the same frequency are different: they combine as phasors first.

Common mix-ups

  • If two waveforms look different, their spectra must be different.
    ✓ Phase changes the look without changing the magnitude spectrum.
  • Amplitudes always add.
    ✓ Only powers of different frequencies add simply; same-frequency components add as phasors.

Open the full lesson: Seeing a signal's ingredients →

6.2 A square wave made of curves

A square wave has perfectly sharp corners. Sine waves have none. Yet enough sine waves add up to a square. How many, and what's left over?

The series

A square wave swinging between +A and −A is x(t) = (4A/π)·[sin ωt + sin 3ωt/3 + sin 5ωt/5 + …]. Harmonic n has amplitude bₙ = 4A/(nπ) for odd n and 0 for even n. The fundamental is 4/π ≈ 1.27 times taller than the square itself.

Power is concentrated low

The square has power A². The fundamental alone carries (4A/π)²/2 = 8A²/π² ≈ 81 % of it; adding the 3rd and 5th reaches about 93 %. So a square wave through a low-pass filter quickly looks like a sine: that is how some cheap sine-wave inverters work.

Gibbs: the overshoot that won't go away

Near each jump the partial sum overshoots by about 9 % of the jump, however many terms you add. More terms make the overshoot narrower, not lower. In practice, ringing near edges in a band-limited system is the same effect: a sharp edge truly needs infinitely high frequencies.

Common mix-ups

  • Enough harmonics make a perfect square wave with no overshoot.
    ✓ The partial sums always overshoot by about 9 % near jumps; only the width shrinks.
  • The fundamental of a ±1 square wave has amplitude 1.
    ✓ It is 4/π ≈ 1.27: taller than the square, with the harmonics trimming it back down.

Open the full lesson: A square wave made of curves →

Worked examples

Seeing a signal's ingredients: example 1

Sketch the spectrum of 3 + 2·cos(2π·10t) + sin(2π·30t).

Solution

A bar of height 3 at 0 Hz (DC), height 2 at 10 Hz and height 1 at 30 Hz. Power = 3² + 2²/2 + 1²/2 = 9 + 2 + 0.5 = 11.5.

A square wave made of curves: example 1

A ±5 V, 1 kHz square wave drives a speaker. What is the amplitude of the 3 kHz component?

Solution

n = 3: b₃ = 4 × 5/(3π) ≈ 2.12 V.

Interactive figures

Figure 6.2 from Seeing a signal's ingredientsLoad 'Three tones'. Read the spectrum bars, then change each phase and watch the time plot. Next put two components at the same frequency and vary one phase: what happens to that bar now?
Can't use the interactive? Read a description instead

With three tones at 2, 5 and 8 Hz the spectrum shows three bars of heights 1, 0.6 and 0.3. Changing phases changes the waveform's shape but not the bars. Putting two components at the same frequency makes one bar whose height depends on their phase difference (from the sum to the difference of the amplitudes).

Interactive figure (online). Description: With three tones at 2, 5 and 8 Hz the spectrum shows three bars of heights 1, 0.6 and 0.3. Changing phases changes the waveform's shape but not the bars. Putting two components at the same frequency makes one bar whose height depends on their phase difference (from the sum to the difference of the amplitudes).

Figure 6.3 from A square wave made of curvesStart with 1 harmonic, then add them one by one up to 25. Watch the power captured and the peak of the sum. Does the overshoot near the jump get smaller, or only narrower?
Can't use the interactive? Read a description instead

With 1 harmonic the builder draws a sine of peak 1.27 over the square. Adding odd harmonics (3, 5, 7…) fills in the corners; captured power rises from 81 % to about 98 % with 13 terms; the peak near each jump stays about 1.18, a 9 % overshoot of the jump of 2.

Interactive figure (online). Description: With 1 harmonic the builder draws a sine of peak 1.27 over the square. Adding odd harmonics (3, 5, 7…) fills in the corners; captured power rises from 81 % to about 98 % with 13 terms; the peak near each jump stays about 1.18, a 9 % overshoot of the jump of 2.

Laboratory

Everything runs in your browser. No kit, nothing mains-powered. Simulations are simplified educational models.

  • Studio

    Code Lab

    Add the first one, three and ten odd harmonics of a square wave and plot how the corners sharpen.

    Open Code Lab →
  • Equation Lab exploration

    Equation Lab: Functions

    Add two sines of different frequency and amplitude and sketch the spectrum of the result.

    Open Equation Lab: Functions →

Guided practice

Answers are checked on the server; wrong answers get a hint and another try. Signed in, solved items also count towards the source lesson.

Practice 1

You change only the phase of one component. What changes?

Practice 2

3·sin(2π·5t) + 4·sin(2π·5t + 90°) is a single 5 Hz sinusoid. What is its amplitude?

Practice 3

Where does a constant offset appear in a spectrum?

Practice 4

What is the amplitude of the fundamental of a ±1 square wave (3 decimal places)?

Practice 5

What is the amplitude of the 4th harmonic of a symmetric square wave?

Practice 6

What percentage of a square wave's power is in its fundamental alone (8/π² as a percentage, 1 decimal place)?

%

Practice 7

You add more and more harmonics. What happens to the overshoot near each jump?

  1. You change only the phase of one component. What changes?
    • The height of its spectrum bar
    • The waveform's shape in time
    • The total power
    • The component's frequency
  2. 3·sin(2π·5t) + 4·sin(2π·5t + 90°) is a single 5 Hz sinusoid. What is its amplitude?
  3. Where does a constant offset appear in a spectrum?
    • At the highest frequency
    • Nowhere
    • At 0 Hz
    • Spread evenly over all frequencies
  4. What is the amplitude of the fundamental of a ±1 square wave (3 decimal places)?
  5. What is the amplitude of the 4th harmonic of a symmetric square wave?
    • 4A/(4π)
    • Zero
    • Half the 2nd harmonic
    • The same as the 3rd
  6. What percentage of a square wave's power is in its fundamental alone (8/π² as a percentage, 1 decimal place)? (%)
  7. You add more and more harmonics. What happens to the overshoot near each jump?
    • It shrinks to zero
    • It stays about 9 % of the jump but gets narrower
    • It grows without limit
    • It moves to the middle of the flat parts

Engineering applications

  • Musical timbre

    A flute and a violin playing the same note share a fundamental frequency but carry different mixtures of harmonics. That recipe, the spectrum, is what makes them sound different.

  • Switching interference

    PWM and digital clocks are square-ish waves, so they radiate energy at many odd harmonics. Engineers check those harmonics against radio-interference limits and slow the edges if needed.

Watch

Optional verified videos. Nothing loads from YouTube until you press play.

Builds sharp-cornered functions, including a square wave, out of rotating sinusoids, and shows where the 4/(nπ)-style coefficients come from.

24 min 47 s · captions on YouTube · source

Nothing loads from YouTube until you press play.

Steve Brunton derives the Fourier series, the recipe for building signals from sines and cosines.

12 min 15 s · captions on YouTube · source

Nothing loads from YouTube until you press play.

  • But what is a Fourier series? From heat flow to drawing with circles | DE4 (3Blue1Brown)
  • Fourier Series: Part 1 (Steve Brunton)

Chapter summary

  • A spectrum lists the amplitude (and phase) of each sinusoid in a signal.
  • Sinusoids of the same frequency combine into one sinusoid of that frequency.
  • A square wave contains only odd harmonics, with amplitude 4 / (πk).
  • Truncated Fourier series overshoot near jumps: the Gibbs effect does not vanish with more terms.

Glossary

Frequency and period
Frequency is how many cycles happen per second; the period is the time for one cycle. Each is the reciprocal of the other.
Sine, cosine and tangent
In a right-angled triangle, sine is opposite over hypotenuse, cosine is adjacent over hypotenuse and tangent is opposite over adjacent, each a function of the angle.

Definitions from the Field Guide.

Project: Build a waveform from recipes

Write a program that synthesises a waveform from a list of (frequency, amplitude, phase) ingredients. Use it to approximate a square wave and a sawtooth, plot each with 3, 10 and 30 terms, and measure how the Gibbs overshoot behaves as terms are added.

Deliverables

  • The synthesiser program
  • Plots for both waveforms at three term counts
  • Overshoot measurements and an explanation

Keep your work in your Engineering Journal; it stays private unless you choose to share it.

References

  • Alan V. Oppenheim et al. (1997). Signals and Systems, 2nd edition. Prentice Hall.
  • Steven W. Smith (1997). The Scientist and Engineer's Guide to Digital Signal Processing. California Technical Publishing.

Publication record

Version
1
Status
Technically checked (automated checks only)
Technical review
Automated checks only, last run 2026-11-29. No human, educator or mentor review is claimed.src/content/textbooks/textbooks.test.ts: schema, every lesson, diagram, practice item, video, Field Guide entry, lab and reference resolves; figure numbers recomputed; no practice answers in client payloads.
Written by
Compiled and written by the Tactiverge team with AI assistance, from Tactiverge School lessons that were themselves written with AI assistance.
Licence
All rights reserved by the founders unless a licence is approved.
Corrections
None recorded yet.Spotted a mistake? Use “Report a problem” on any chapter, or see the corrections page.