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 的情形与余弦公式统一。