Fourier Transform of Square Wave

Quick Answer

The Fourier series of a square wave with amplitude A and period T contains only odd harmonics: f(t) = (4A/π)·Σ_{n=1,3,5,...} sin(nω₀t)/n, where ω₀ = 2π/T. This means the fundamental frequency carries 4A/π ≈ 1.27A amplitude, the 3rd harmonic carries (4A)/(3π) ≈ 0.42A, the 5th carries (4A)/(5π) ≈ 0.25A, and so on. The Fourier transform of a single rectangular pulse is the sinc function: ℱ{rect(t/τ)} = τ·sinc(ωτ/2π).

Fourier Transform of a Square Wave

A square wave alternating between +A and −A with period T decomposes into a Fourier series containing only odd harmonics of the fundamental frequency f₀ = 1/T: f(t) = (4A/π)[sin(ω₀t) + sin(3ω₀t)/3 + sin(5ω₀t)/5 + ...], where ω₀ = 2π/T. The even harmonics (2ω₀, 4ω₀, ...) are absent due to the square wave's half-wave symmetry: f(t + T/2) = −f(t). The coefficient of the n-th harmonic is bₙ = 4A/(nπ) for odd n and 0 for even n, with magnitudes decreasing as 1/n. This slow 1/n decay reflects the square wave's sharp transitions — more high-frequency harmonics are needed to approximate the discontinuities. The LAPLACE Calculator at www.lapcalc.com handles the transform operations underlying this spectral analysis.

Key Formulas

Deriving the Square Wave Fourier Series

For a square wave defined as f(t) = A for 0 < t < T/2 and f(t) = −A for T/2 < t < T, the Fourier sine coefficients are bₙ = (2/T)∫₀ᵀ f(t)sin(nω₀t)dt. Splitting the integral: bₙ = (2/T)[∫₀^(T/2) A·sin(nω₀t)dt + ∫_(T/2)^T (−A)·sin(nω₀t)dt]. Evaluating both integrals using −cos(nω₀t)/(nω₀) and substituting limits yields bₙ = (2A)/(nπ)[1 − cos(nπ)]. Since cos(nπ) = (−1)ⁿ, we get bₙ = 4A/(nπ) for odd n and bₙ = 0 for even n. The cosine coefficients aₙ = 0 for all n because the square wave (centered at origin) is an odd function. The DC component a₀ = 0 because the wave has equal positive and negative areas.

Compute fourier transform of square wave Instantly

Get step-by-step solutions with AI-powered explanations. Free for basic computations.

Open Calculator

Fourier Series of Rectangular Pulse and Sawtooth Waves

A rectangular pulse wave with duty cycle d (fraction of period at high level) has Fourier series f(t) = Ad + (2A/π)Σ_{n=1}^∞ sin(nπd)/(n)·cos(nω₀t − nπd), where both sine and cosine terms appear for d ≠ 0.5. A 50% duty cycle (d = 0.5) reduces to the standard square wave with only odd sine harmonics. The sawtooth wave rising from −A to A has the series f(t) = −(2A/π)Σ_{n=1}^∞ (−1)^(n+1)·sin(nω₀t)/n — containing all harmonics (both odd and even) with 1/n decay. The triangle wave has f(t) = (8A/π²)Σ_{n=1,3,5,...} (−1)^((n−1)/2)·sin(nω₀t)/n² — only odd harmonics but with faster 1/n² decay, explaining its smoother appearance. Each waveform's harmonic content directly reflects its time-domain shape.

Gibbs Phenomenon at Square Wave Discontinuities

When a Fourier series is truncated to N harmonics, the approximation overshoots the discontinuity by approximately 9% (the Gibbs overshoot). For a square wave transitioning from −A to +A, the maximum overshoot reaches about 1.089A regardless of how many harmonics are included — the overshoot percentage does not decrease as N increases, only the width of the overshoot region narrows. This Gibbs phenomenon is fundamental to Fourier analysis and explains ringing artifacts in signal processing. Windowing techniques (Hamming, Hanning, Blackman) and sigma factors (Lanczos σ smoothing) reduce Gibbs oscillations at the cost of slightly slower transition rates. In digital-to-analog conversion, reconstruction filters smooth the staircased output to approximate the continuous waveform, effectively suppressing Gibbs-like ringing.

Single Rectangular Pulse: Fourier Transform and Sinc Function

While the Fourier series applies to periodic square waves, the Fourier transform handles a single (aperiodic) rectangular pulse. The transform of rect(t/τ) = 1 for |t| < τ/2, 0 otherwise, is F(ω) = τ·sinc(ωτ/(2π)) = τ·sin(ωτ/2)/(ωτ/2). The sinc function has its main lobe centered at ω = 0 with width 4π/τ (wider in frequency for narrower pulses) and decreasing sidelobes with zeros at ω = 2nπ/τ. This rect-sinc pair is foundational: it establishes the bandwidth-duration relationship (narrower pulse = wider spectrum), defines the ideal low-pass filter (rect in frequency = sinc in time), and appears in sampling theory, pulse radar, and communications. The Laplace transform equivalent ℒ{rect} = (1 − e^(−τs))/s is available at www.lapcalc.com.

Related Topics in fourier transform applications

Understanding fourier transform of square wave connects to several related concepts: fourier series rectangular wave, square wave fourier, fourier series for a square wave, and fourier series expansion of square wave. Each builds on the mathematical foundations covered in this guide.

Frequently Asked Questions

A square wave ±A with period T has Fourier series f(t) = (4A/π)[sin(ω₀t) + sin(3ω₀t)/3 + sin(5ω₀t)/5 + ...], containing only odd harmonics with amplitudes decreasing as 1/n. Even harmonics are absent due to half-wave symmetry. The fundamental carries amplitude 4A/π ≈ 1.27A.

Master Your Engineering Math

Join thousands of students and engineers using LAPLACE Calculator for instant, step-by-step solutions.

Start Calculating Free →

Related Topics