Loading…

Fourier Series Approximator

Math Calculus • Infinite Series and Sequences

View all topics
6. Fourier Series Approximator
Computes the partial Fourier series for a periodic function \(f(x)\) with period \(T\): \(S_N(x)=\dfrac{a_0}{2}+\sum_{n=1}^{N}\big(a_n\cos(n\omega_0 x)+b_n\sin(n\omega_0 x)\big)\), where \(\omega_0=\dfrac{2\pi}{T}\). Includes a zoomable, pannable plot and an optional “auto \(N\) for \(\varepsilon\)” helper.
Inputs
Variable: x. Constants: pi, e. Supported: + − * / ^, parentheses, sin cos tan, asin acos atan, ln/log, sqrt, abs, exp, sgn.
Piecewise helper: pw(c, a, b) returns a if c is true, else b. Conditions: lt, le, gt, ge, eq, ne (return 1 or 0).
Accepts expressions like 2*pi, pi/2, 6.283.
Computes coefficients up to \(n=N\) (numerical Simpson sampling).
Heuristic: find smallest \(N\le 300\) with \(|S_N(x_0)-S_{N-1}(x_0)|\le \varepsilon\).
Even number required (Simpson).
Click a preset to load & compute.
Ready
Graph
Drag to pan • wheel/pinch to zoom. Plots periodic extension of \(f(x)\) and the partial sum \(S_N(x)\).
x: 0, y: 0, zoom(px/unit): 60
Results & steps
Enter inputs, then click Calculate.

Rate this calculator

0.0 /5 (0 ratings)
Be the first to rate.
Your rating
You can update your rating any time.

Frequently Asked Questions

What does the Fourier series approximator compute?

It computes a finite Fourier partial sum S_N(x) that approximates a T-periodic function using sine and cosine harmonics. The coefficients a_n and b_n are estimated numerically from integrals over one period.

How are the Fourier coefficients calculated in this tool?

The calculator approximates the required integrals with Simpson’s rule over an interval of length T. Increasing the integration subintervals can improve accuracy, especially for sharp corners or jump-like behavior.

What does the epsilon helper for N mean at x0?

It finds the smallest N (up to the tool limit) such that the change in the partial sum at x0 is small: |S_N(x0)-S_{N-1}(x0)|<=epsilon. This is a practical indicator at that point, not a guaranteed global error bound.

Why do I see overshoot near jumps even when N is large?

Fourier partial sums can show persistent oscillations near discontinuities, known as the Gibbs phenomenon. As N increases the oscillations narrow, but the peak overshoot does not fully disappear.

How do I enter a piecewise function for one period?

Use pw(condition,a,b) where the condition is built from lt, le, gt, ge, eq, or ne and returns 1 or 0. The calculator interprets your input over one period and then extends it periodically.