---
title: "Fourier series coefficients of a square wave"
subject: "Data Communication"
chapter: 3
key: "semester_5/data_communication:fs-coefficients-square-wave"
source: https://www.bctengineer.com/q/semester_5/data_communication/fs-coefficients-square-wave
site: BCT Engineering
---

# Fourier series coefficients of a square wave

Data Communication · Chapter 3: Signal Analysis

- Asked in: 2068 Chaitra, 6 marks
- Video: [How to Compute a FOURIER SERIES // Formulas & Full Example](https://www.youtube.com/watch?v=ijQaTAT3kOg) — Dr. Trefor Bazett
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/data_communication/fs-coefficients-square-wave
- Whole chapter: https://www.bctengineer.com/md/semester_5/data_communication/chapter-3

## Question

Compute the Fourier series coefficients for the signal given below. [Figure: periodic square wave x(t) alternating between +1 and -1, period T, with time marks at -2, 2 and 4]

## Short answer

For a ±1 square wave of period T=4 s, the exponential coefficients are c_k = −j 2/(kπ) for odd k and zero for even k. The trigonometric series is x(t)=(4/π)[sin(πt/2)+⅓ sin(3πt/2)+⅕ sin(5πt/2)+…].

## Answer

**Assumption** (the figure's marks are -2, 2, 4): a square wave of amplitude ±1 with period T = 4 s, odd about the origin: x(t) = +1 for 0 < t < 2 and x(t) = -1 for -2 < t < 0 (repeating every 4 s; it flips sign again at t = 4). So ω₀ = 2π/4 = π/2 rad/s.

#### Exponential coefficients
cₖ = (1/T) ∫_{-2}^{2} x(t) e^(-jkω₀t) dt
= (1/4) [ -∫_{-2}^{0} e^(-jkπt/2) dt + ∫₀^2 e^(-jkπt/2) dt ]

∫₀^2 e^(-jkπt/2) dt = (1 - e^(-jkπ)) / (jkπ/2)

∫_{-2}^{0} e^(-jkπt/2) dt = (e^(jkπ) - 1) / (jkπ/2)

cₖ = (1/4) · (2/(jkπ)) · [ (1 - e^(-jkπ)) - (e^(jkπ) - 1) ]
= (1/(2jkπ)) [ 2 - 2cos kπ ] = (1 - cos kπ)/(jkπ)

- For even k: cos kπ = 1, so cₖ = 0 (including c₀ = 0, since the mean is zero).
- For odd k: cos kπ = -1, so **cₖ = 2/(jkπ) = -j 2/(kπ)**.

#### Trigonometric form
x(t) = (4/π) [ sin(πt/2) + (1/3) sin(3πt/2) + (1/5) sin(5πt/2) + ... ]

That is, bₖ = 4/(kπ) for odd k, and aₖ = 0.

General result: for amplitude ±A and period T the coefficients are cₖ = -j 2A/(kπ) for odd k, 0 for even k. If the wave is instead shifted so that it is an even function, cₖ = (2A/kπ) sin(kπ/2) is obtained, and the magnitude |cₖ| = 2A/(kπ) is the same.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. T = 4 gives ω0 =
   A. π
   B. 2π
   C. π/2 rad/s
   D. π/4
   Answer: C. 2π/4. (Key point: Period)

2. For even k, ck =
   A. 2/(jkπ)
   B. 1
   C. j
   D. 0
   Answer: D. 1-cos kπ = 0. (Key point: Even k)

3. For odd k, ck =
   A. 2/(jkπ)
   B. 4/(kπ)
   C. 1/(jkπ)
   D. 0
   Answer: A. (1-(-1))/(jkπ). (Key point: Odd k)

4. c0 = 0 because
   A. Wave is positive
   B. Mean of wave is zero
   C. T is 4
   D. k is odd
   Answer: B. Equal +1 and -1. (Key point: DC)

## Related in Data Communication

- [Fourier series of full-wave rectified sine](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Afs-full-wave-rectified) — Data Communication, chapter 3
- [Fourier series of half-wave rectified sine](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Afs-half-wave-rectified) — Data Communication, chapter 3
- [Properties of continuous-time Fourier series](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Afourier-series-properties) — Data Communication, chapter 3
- [Fourier transform of a DC signal](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Aft-dc-signal) — Data Communication, chapter 3
- [Applications of Fourier series](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Afourier-series-applications) — Data Communication, chapter 3
- [Fourier series vs Fourier transform](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Afs-vs-ft) — Data Communication, chapter 3

## Related in other subjects

- [FS coefficients of periodic square wave](https://www.bctengineer.com/question.md?key=semester_4%2Fsignals_and_systems%3Asquare-wave-fourier-coefficients) — Signals and Systems, chapter 2
- [Fourier series of square wave and DFT](https://www.bctengineer.com/question.md?key=semester_4%2Finstrumentation_and_measurement%3Afourier-series-square-wave-dft) — Instrumentation and Measurement, chapter 2
- [Periodic signal whose Fourier series fails](https://www.bctengineer.com/question.md?key=semester_4%2Fsignals_and_systems%3Afourier-series-existence-examples) — Signals and Systems, chapter 2
- [Convergence; coefficients of ±1.5 square wave](https://www.bctengineer.com/question.md?key=semester_4%2Fsignals_and_systems%3Asquare-wave-convergence-coefficients) — Signals and Systems, chapter 2
