📚 4 Examples of Fourier Series | 傅里叶级数的四个例子
ics, and engineering. This article walks through four classic examples - the square wave, the sawtooth wave, the triangular wave and the parabola f(x) = x² - demonstrating step-by-step calculation of Fourier coefficients and the resulting series expansions, with an emphasis on symmetry, convergence behaviour and the numerical series that fall out of the results.
傅里叶级数将周期函数分解为一系列谐波正弦和余弦之和,是数学、物理和工程领域的重要工具。本文详细讲解四个经典例子——方波、锯齿波、三角波以及抛物线 f(x) = x²,逐步展示傅里叶系数的计算方法和最终级数展开式,并重点讨论对称性、收敛特性,以及由这些展开式导出的若干数值级数求和结果。
1. Introduction to Fourier Series | 傅里叶级数简介
n be expressed as a constant plus an infinite sum of sines and cosines whose frequencies are integer multiples of the fundamental frequency. The constant term a₀/2 gives the mean value of the function over one period, while each pair of coefficients aₙ and bₙ measures how much of the nth harmonic - the cosine wave cos(nx) and the sine wave sin(nx) - is present in the signal.
一个周期为 2π 的函数 f(x)(即对任意 x 都满足 f(x + 2π) = f(x))可以表示为一个常数项加上无穷多个正弦与余弦之和,这些三角函数的频率都是基频的整数倍。常数项 a₀/2 给出函数在一个周期内的平均值,而每一对系数 aₙ 与 bₙ 分别度量第 n 次谐波——余弦波 cos(nx) 与正弦波 sin(nx)——在信号中所占的比重。
The general expansion takes the form below, and the whole theory rests on the fact that the functions 1, cos(nx) and sin(nx) are mutually orthogonal over a full period.
一般展开式如下所示,整个理论的基础在于函数 1、cos(nx) 与 sin(nx) 在一个完整周期上两两正交。
f(x) = a₀/2 + Σn=1∞ [ aₙ cos(nx) + bₙ sin(nx) ]
The index n runs over the positive integers, so the expansion is a superposition of harmonics at frequencies 1, 2, 3, ... times the fundamental frequency. Truncating the series after N terms gives the best least-squares approximation to f by a trigonometric polynomial of that degree.
指标 n 取遍正整数,因此该展开式是频率为基频 1、2、3、……倍的谐波的叠加。把级数在第 N 项处截断,得到的便是用该次三角多项式对 f 做最小二乘逼近的最佳结果。
2. The Euler-Fourier Coefficient Formulas | 欧拉-傅里叶系数公式
The coefficients are extracted by multiplying both sides of the expansion by the relevant trigonometric function and integrating over one period, using orthogonality to kill every term except one. This yields three integral formulas that do all the work in every example that follows.
求系数的做法是:在展开式两边乘以相应的三角函数,然后在一个周期上积分,利用正交性消去除目标项以外的所有项。这样便得到三个积分公式,后续所有例子的计算都依赖它们。
a₀ = (1/π) ∫-ππ f(x) dx
aₙ = (1/π) ∫-ππ f(x) cos(nx) dx
bₙ = (1/π) ∫-ππ f(x) sin(nx) dx
of cos(mx)cos(nx) or sin(mx)sin(nx) is π when m = n and 0 otherwise; and the integral of cos(mx)sin(nx) is always 0. Note the factor 1/π, not 1/(2π), because a₀ is deliberately written as the coefficient of 1/2.
这些公式背后的核心正交关系是:cos(nx) 或 sin(nx) 在一个完整周期上的积分为零(n ≥ 1);cos(mx)cos(nx) 与 sin(mx)sin(nx) 的积分在 m = n 时为 π,否则为零;而 cos(mx)sin(nx) 的积分恒为零。注意公式中的系数是 1/π 而不是 1/(2π),这是因为 a₀ 被特意写成 1/2 的系数。
In complex form the same series reads f(x) = Σ cₙ einx with cₙ = (1/2π) ∫ f(x) e-inx dx, and the two descriptions are linked by aₙ = cₙ + c-n and bₙ = i(cₙ - c-n). Real coefficients correspond to a real-valued function.
写成复数形式即 f(x) = Σ cₙ einx,其中 cₙ = (1/2π) ∫ f(x) e-inx dx;两种描述之间由 aₙ = cₙ + c-n 与 bₙ = i(cₙ - c-n) 相互联系。当函数取实值时,其复系数满足共轭对称 c-n = cₙ*。
3. Symmetry Shortcuts: Even and Odd Functions | 对称性技巧:偶函数与奇函数
tric interval, so every bₙ = 0 and only cosine terms survive. If f is odd, that is f(-x) = -f(x), then f(x) cos(nx) is odd, so a₀ = 0 and every aₙ = 0, leaving a pure sine series.
在动手积分之前,先判断 f 的对称性。若 f 为偶函数,即 f(-x) = f(x),则 f(x) sin(nx) 是奇函数,在对称区间上积分为零,于是所有 bₙ = 0,只剩下余弦项。若 f 为奇函数,即 f(-x) = -f(x),则 f(x) cos(nx) 是奇函数,于是 a₀ = 0 且所有 aₙ = 0,只剩下正弦级数。
| Symmetry | 对称性 | Vanishing coefficients | 消失的系数 | Surviving terms | 保留下来的项 |
| Even f(-x) = f(x) | 偶函数 | bₙ = 0 | cosine series | 余弦级数 |
| Odd f(-x) = -f(x) | 奇函数 | a₀ = 0, aₙ = 0 | sine series | 正弦级数 |
| Half-wave symmetry f(x+π) = -f(x) | 半波对称 | all even n vanish | 所有偶数项为零 | odd harmonics only | 仅奇次谐波 |
This shortcut halves the work and, more importantly, prevents algebra errors: a non-zero aₙ appearing for an odd function is an immediate red flag in an exam. Symmetry also explains why the square wave and the sawtooth contain only sine terms while |x| and x² contain only cosine terms.
这一技巧不仅把工作量减半,更重要的是能防止代数错误:对奇函数算出非零的 aₙ,在考试中就是明显的警报信号。对称性也解释了为什么方波与锯齿波只含正弦项,而 |x| 与 x² 只含余弦项。
4. Example 1: The Square Wave | 例 1:方波
eriodically with period 2π. This odd function describes an ideal switching signal and is the standard first example because its jump discontinuities make the convergence behaviour especially visible.
定义 f(x) = -1(-π < x < 0),f(x) = +1(0 < x < π),并以 2π 为周期延拓。这个奇函数描述理想的开关信号,是最经典的第一例,因为它的跳跃间断点使收敛行为格外直观。
For bₙ, the integrand f(x) sin(nx) is even, so we double the integral over half a period:
由于 f 为奇函数,a₀ = 0 且对所有 n 有 aₙ = 0。计算 bₙ 时被积函数 f(x) sin(nx) 为偶函数,因此可在半个周期上积分再乘二:
bₙ = (2/π) ∫0π sin(nx) dx = (2/π) [ -cos(nx)/n ]0π = (2/(nπ)) (1 - cos nπ)
nπ))(1 - (-1)ⁿ). This is 4/(nπ) when n is odd and 0 when n is even, so only odd harmonics survive. The square wave therefore has the expansion below.
由于 cos nπ = (-1)ⁿ,得到 bₙ = (2/(nπ))(1 - (-1)ⁿ)。当 n 为奇数时等于 4/(nπ),n 为偶数时为零,因此只有奇次谐波保留下来。方波的展开式如下。
f(x) = (4/π) [ sin x + sin 3x/3 + sin 5x/5 + sin 7x/7 + … ]
Setting x = π/2, where f = 1, gives 1 = (4/π)(1 - 1/3 + 1/5 - 1/7 + …), which rearranges to the Leibniz formula for π: π/4 = 1 - 1/3 + 1/5 - 1/7 + … ke 1/n, which is slow, so many terms are needed for a decent approximation near the jumps.
取
更多咨询请联系16621398022(同微信)

或截图后用「扫一扫 → 相册」选择本图