Fourier Series Visualizer

Computes Fourier coefficients for standard and custom periodic functions, animates the partial sums term by term and measures the Gibbs overshoot.

ทำงานในเบราว์เซอร์ของคุณ ไฟล์ไม่ออกจากอุปกรณ์ ดูวิธีตรวจสอบ

…

วิธีทำ

  1. 1
    Choose a function

    Pick a preset such as Square wave or Custom pieces and set the half-period L.

  2. 2
    Pick the series type

    Use full range, or a half-range sine or cosine series for functions on [0, L].

  3. 3
    Add terms

    Move the Terms slider or press Animate terms to watch the partial sum approach the function.

  4. 4
    Read the coefficients

    Open Coefficients and spectrum for the table, the bar chart and the exact formula of the preset.

  5. 5
    Edit your own wave

    In Edit the function change the pieces and their intervals; the graph updates at once.

  6. 6
    Practise

    Practice asks for coefficients of standard waves and which terms vanish by symmetry.

เกี่ยวกับเครื่องมือนี้

A Fourier series rebuilds a periodic function from sines and cosines. The idea is easy to state and hard to picture until you watch it happen. This visualizer computes the coefficients a_n and b_n for a square wave, sawtooth, triangle wave, rectified sine, parabola or pulse train, or for any function you build from pieces such as x on [0, π) and 0 on [-π, 0). A slider or the Animate button adds one term at a time while the graph shows the function, the current partial sum and the newest harmonic. The spectrum chart and table show how fast the coefficients shrink, Parseval's theorem reports how much of the signal's energy the first N terms capture, and near a jump the tool measures the overshoot that never goes away: the Gibbs phenomenon. You can also switch to half-range sine or cosine series, which extend a function on [0, L] as an odd or even function.

The formulas used

On the interval [-L, L] the series is f(x) ≈ a0/2 + Σ [a_n cos(nπx/L) + b_n sin(nπx/L)], with a_n = (1/L)∫ f(x) cos(nπx/L) dx and b_n = (1/L)∫ f(x) sin(nπx/L) dx over one period. The tool evaluates these integrals numerically, splitting them at every break between pieces so that jumps do not spoil the accuracy. The exact formulas for each preset are shown beside the table so you can compare.

Even, odd and half-range

An even function has only cosine terms and an odd function only sine terms; you can see the zeros in the table. A half-range sine series uses the odd extension of f on [0, L], and a half-range cosine series the even extension. These are the series used to solve the heat and wave equations on a rod or string with fixed or insulated ends.

The Gibbs phenomenon

At a jump discontinuity the partial sums overshoot the function by about 9 % of the jump, however many terms you take. More terms squeeze the overshoot into a narrower spike next to the jump but do not lower it; the limit is 8.95 %. The statistic box measures the overshoot for the current N.

Worked example

For the square wave equal to -1 on (-π, 0) and 1 on (0, π), b_n = 4/(nπ) for odd n and 0 for even n, so b_1 ≈ 1.27324 and b_3 ≈ 0.42441. With N = 7 the partial sum captures about 95 % of the energy and overshoots the jump of 2 by roughly 9 %.

Limits

Coefficients are computed numerically, so values like 1e-12 appear as 0 and the last digits can differ from exact fractions. Functions must be bounded and piecewise smooth on one period; functions with infinite values do not have sensible coefficients. The animation shows at most 60 terms. This is a learning tool, not a signal-processing package.

ตัวอย่างพร้อมวิธีทำ

Square wave: b_n = 4/(nπ) for odd n (b_1 ≈ 1.27324, b_3 ≈ 0.42441); the partial sums overshoot each jump by about 9 %.

สรุปสั้น ๆ

คำถามที่พบบ่อย

What do a_n and b_n represent?

They are the amplitudes of the cosine and sine waves with n cycles per period. Together they describe how much of each frequency the signal contains.

Why are some coefficients exactly zero?

Symmetry. For an odd function every a_n is zero; for an even function every b_n is zero. Square waves also have no even harmonics.

What is the Gibbs phenomenon?

Near a jump, the partial sums overshoot by about 9 % of the jump height. Adding terms narrows the overshoot but never removes it.

How do I enter my own function?

Open Edit the function and add pieces, each an expression with the interval where it applies. Gaps between pieces count as zero.

What does energy captured mean?

By Parseval's theorem the mean square of f equals a0^2/2 plus the sum of a_n^2 + b_n^2. The percentage compares the first N terms with the total.

Can I export the coefficients?

Coefficients CSV saves n, a_n, b_n and the amplitude for 60 terms; Print / PDF prints the first 20 with the formula.

ฟรีทั้งหมดไม่มีค่าใช้จ่าย ไม่ต้องสมัคร
ไฟล์เป็นส่วนตัวทุกอย่างทำงานในเบราว์เซอร์ของคุณ
ใช้ง่ายในภาษาของคุณมีหลายภาษา