JOVANA
Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

把函數寫成波的疊加:正交性與傅立葉係數

為什麼正弦與餘弦構成一個正交系,以及這一個事實如何直接給出每個傅立葉係數的公式。

想法:聆聽一個函數

週期函數就像一個和弦:一個複雜的聲音,其實暗中是若干純音的疊加。傅立葉級數的夢想,是把週期為 2π 的函數 f 寫成三角級數 a_0/2 + 對 n>=1 求和 (a_n cos nx + b_n sin nx)。純音是 cos nx 與 sin nx;數 a_n、b_n 說明每個純音有多響。整個主題始於一個問題:給定 f,我們如何還原這些響度?

正交性,證明出來

系統 {1, cos x, sin x, cos 2x, sin 2x, …} 是一個正交系:在 ⟨·,·⟩ 下不同的純音互相垂直。這並非魔法 —— 一旦用積化和差公式,它就是一行積分。後面的一切都建立在它之上。

Claim: for integers m, n >= 1, integral over [-pi, pi] of cos(mx) cos(nx) dx = 0 when m != n.

Product-to-sum:  cos(mx) cos(nx) = (1/2)[ cos((m-n)x) + cos((m+n)x) ].

Integrate term by term over [-pi, pi].  For any integer k != 0,
   integral over [-pi, pi] of cos(kx) dx = [ sin(kx)/k ] from -pi to pi
                                         = ( sin(k pi) - sin(-k pi) ) / k = 0,
since sin(k pi) = 0 for every integer k.

Here m != n forces both k = m-n != 0 and k = m+n != 0, so BOTH integrals vanish:
   integral of cos(mx)cos(nx) dx = (1/2)(0 + 0) = 0.    QED

Same computation gives:
   integral cos(mx) sin(nx) dx = 0   for ALL m, n  (integrand is odd),
   integral sin(mx) sin(nx) dx = 0   for m != n.

Diagonal (m = n):  integral cos^2(nx) dx = pi  and  integral sin^2(nx) dx = pi.
So with the 1/pi weight, ⟨cos nx, cos nx⟩ = 1 and ⟨sin nx, sin nx⟩ = 1: the tones are unit-length.
不同的三角純音互相正交;每個 cos nx、sin nx 的平方範數為 π。

係數公式自然落出

暫且假設 f 確實等於它的級數。兩邊都與 cos kx 取內積。除 cos kx 外的每個純音都與它正交而消失;只有 a_k 項存活,並乘以 ‖cos kx‖² = π。解出便得到歐拉–傅立葉公式 —— 即傅立葉係數的定義。

  1. a_n = (1/π) 對 [−π, π] 積分 f(x) cos nx dx,n = 0, 1, 2, …
  2. b_n = (1/π) 對 [−π, π] 積分 f(x) sin nx dx,n = 1, 2, …
  3. 常數項是 a_0/2;用同一個 1/π 寫 a_0,可使 n = 0 的情形與餘弦公式統一。