Fourier series input form
Use the responsive input grid below. Large screens show three columns, smaller screens show two, and mobile shows one.
Example data table
| Preset | Amplitude | Period | Harmonics | Example coefficient insight |
|---|---|---|---|---|
| Square wave | 5 | 2π ≈ 6.283185 | 7 | b₁ ≈ 6.366198, b₃ ≈ 2.122066, b₅ ≈ 1.273240 |
| Triangle wave | 4 | 2π ≈ 6.283185 | 9 | Odd sine terms decay with 1/n², so convergence is smoother. |
| Full-wave rectified sine | 3 | 2π ≈ 6.283185 | 8 | DC content appears because the waveform stays nonnegative. |
Formula used
Fundamental angular frequency: ω0 = 2π / T, where T is the period.
Cosine coefficient: an = (2 / T) ∫0T f(x) cos(nω0x) dx
Sine coefficient: bn = (2 / T) ∫0T f(x) sin(nω0x) dx
Magnitude per harmonic: Cn = √(an2 + bn2)
RMSE: √[(1/M) Σ (f(xi) - S(xi))2] across M sampled points.
The tool uses closed-form coefficient formulas for the built-in periodic presets. Phase shift φ translates the waveform horizontally, while D adds a vertical offset after reconstruction.
How to use this calculator
- Select a waveform preset that matches your periodic signal.
- Enter amplitude and period using consistent units.
- Adjust phase shift and vertical shift if your signal is translated.
- Choose the number of harmonics for the partial sum.
- Set an evaluation point x to inspect one reconstructed value.
- Increase sample count when you want tighter error estimates.
- Press the compute button to display coefficients and metrics.
- Use CSV or PDF export for reports, sharing, or documentation.
Frequently asked questions
1. What does this Fourier series tool calculate?
It computes closed-form Fourier coefficients for built-in periodic waveforms, evaluates a partial sum, estimates approximation error, and summarizes harmonic magnitudes for analysis.
2. Why does a square wave converge slowly near jumps?
Discontinuous signals create Gibbs overshoot near sharp transitions. Adding more harmonics improves most regions, but the local ringing near jumps never disappears completely.
3. What is the meaning of a₀?
The coefficient a₀ measures the average level of the periodic waveform over one cycle. The series uses a₀/2 as the DC term.
4. How do phase shift and vertical shift affect results?
Phase shift moves the waveform horizontally before evaluation. Vertical shift raises or lowers every reconstructed point without changing the harmonic pattern.
5. What does THD ratio mean here?
THD compares the energy in higher harmonics with the first harmonic. Larger values indicate more distortion relative to the fundamental component.
6. Why do some coefficients become exactly zero?
Waveform symmetry eliminates certain terms. Even, odd, or half-wave symmetry can cancel entire families of cosine or sine coefficients automatically.
7. Which units should I use for x and period?
Use any consistent unit system. If period is seconds, then x should also be seconds, and the resulting angular frequency becomes radians per second.
8. When should I increase the number of harmonics?
Increase harmonics when you need tighter approximation, richer spectral detail, or smaller error metrics. Smooth signals usually need fewer terms than discontinuous signals.