Fourier Series & Signal Analyzer Calculator
Decompose periodic signals into Fourier series, compare harmonics, view waveform reconstruction, and explore frequency spectra with animated, student-friendly visuals.
Background
A Fourier series represents a repeating signal as a sum of sine and cosine waves. This calculator helps students see how harmonics build square, triangle, sawtooth, pulse, and custom-looking periodic signals.
How to use this calculator
- Choose a periodic signal: square, triangle, sawtooth, or pulse.
- Set the amplitude, fundamental frequency, optional DC offset, and duty cycle if using pulse mode.
- Adjust the number of harmonics to see how the Fourier partial sum approaches the target waveform.
- Use the spectrum chart to identify which harmonics contribute most to the signal.
- Read the steps and interpretation to connect the visual pattern to the Fourier series equation.
How this calculator works
- It builds a Fourier partial sum from the selected waveform’s known sine and cosine coefficients.
- It samples the target signal and reconstructed signal over one period.
- It estimates reconstruction error using root mean square error across the sampled points.
- It draws harmonic magnitudes as a frequency spectrum so students can see how energy spreads across harmonics.
- For discontinuous signals, it flags overshoot and ringing as a normal Fourier-series effect.
Formula & Equations Used
Fourier series: f(t) ≈ a₀/2 + Σ[aₙcos(nω₀t) + bₙsin(nω₀t)]
Fundamental angular frequency: ω₀ = 2πf₀
Harmonic frequency: fₙ = nf₀
Harmonic magnitude: Cₙ = √(aₙ² + bₙ²)
RMS reconstruction error: RMSE = √mean((target − partial sum)²)
Example Problem & Step-by-Step Solution
Example 1 — Square wave reconstruction
- Choose square wave with amplitude A = 1.
- Use only odd sine harmonics: bₙ = 4A/(πn) for odd n.
- Set harmonics to 15 and compare the purple partial sum with the target waveform.
- Notice the ringing near jumps. That overshoot is the Gibbs phenomenon.
Example 2 — Triangle wave spectrum
- Choose triangle wave.
- Only odd harmonics appear, but their amplitudes shrink roughly like 1/n².
- The spectrum bars drop faster than the square-wave bars.
- This is why triangle waves look smooth with fewer harmonics.
Example 3 — Pulse wave duty cycle
- Choose pulse wave and set duty cycle to 25%.
- The calculator includes a DC term because the signal is high for only part of the period.
- Change the duty cycle and watch the spectrum reshape.
- This connects Fourier series to digital signals, electronics, sound, and communication systems.
Frequently Asked Questions
Q: What is a Fourier series?
A Fourier series represents a periodic signal as a sum of sine and cosine waves at integer multiples of a fundamental frequency.
Q: What are harmonics?
Harmonics are frequencies equal to f₀, 2f₀, 3f₀, and so on. Their amplitudes determine the signal shape.
Q: Why does a square wave need many harmonics?
A square wave has sharp jumps. Sharp edges require high-frequency harmonics, so the reconstruction improves as more harmonics are added.
Q: What is the Gibbs phenomenon?
Gibbs phenomenon is the overshoot and ringing that appears near jump discontinuities in Fourier-series approximations.