Skip to content

Hi, Blogs here!

Euler's Formula: From Complex Numbers to Rotating Waves

A cosine tracks the horizontal position of a point going around a circle. A sine tracks its vertical position. Euler's formula puts both coordinates in one complex number. That's why a single exponential can describe a steady rotation and why a minus sign in its exponent reverses the direction.

Read Euler's formula as rotation on the unit circle, then see how two opposite rotations make a cosine in the Fourier series.

欧拉公式:从复数到旋转的波

一个点沿圆周转动时,余弦描述它的横坐标,正弦描述它的纵坐标。欧拉公式把这两个坐标合在一个复数里。这样,只用一个指数就能描述匀速旋转;给指数加个负号,旋转方向就反过来了。

从单位圆上的旋转理解欧拉公式,再看傅里叶级数中方向相反的两项怎样合成一个余弦波。

Fourier Series: Why a Repeating Wave Has Harmonics

A waveform repeats once a second. Does that mean it contains only a 1 Hz tone? No: a 3 Hz tone makes three full cycles in that second, so it fits the same repeating pattern. A Fourier series separates two questions: which frequencies fit the period, and how much of each one does the waveform actually contain?

See why a repeating waveform has harmonics at integer multiples of its fundamental, and work out how a Fourier series measures each one.

傅里叶级数:周期波形为什么有谐波?

一个波形每秒重复一次,是否意味着它只含有 1 Hz 的成分?并不是:3 Hz 的振荡在一秒内恰好走完三个周期,也能跟着整个波形每秒重复一次。傅里叶级数把这件事拆成两个问题:哪些频率能配合这个周期?波形里各有多少这样的成分?

从一个周期能容纳多少整圈振荡出发,理解为什么谐波出现在基频的整数倍处,以及怎样求出各项的傅里叶系数。

How a Voice Recording Becomes a Sequence of Numbers

A recorder set to 16 kHz, 16-bit makes two promises: how often it measures the microphone voltage, and how finely it rounds each measurement. Why does the first setting limit the frequencies we can recover, while the second changes the error in the values we store? The two answers come from different calculations.

Derive the sampling limit and quantization noise from first principles, then follow one voice sample all the way to its stored bytes.

语音如何变成一串数字:从采样到 PCM

录音设置里的 16 kHz、16 位分别回答两个问题:多久测一次麦克风电压?用多细的刻度记录测得的电压?为什么第一个设置决定了哪些频率可以恢复,第二个设置却影响存下来的数值误差?要回答这两个问题,需要做两套不同的计算。

从头推导奈奎斯特采样条件和量化噪声公式,再跟踪一个语音样本,看看它最终会以哪些字节存储。

Rete: Incremental Rule Matching, from First Principles to Go

A rule engine repeatedly asks which combinations of current facts satisfy its rules. Rete keeps those matches up to date by remembering filtered facts and partial matches, then propagating changes through a shared network. We will derive that network and implement a small matcher in Go.

Derive Rete from a naïve rule matcher, then build a runnable Go example with shared filters, real joins, fact retraction, and a separate agenda.

Rete 算法:从基本原理到 Go 增量规则匹配器

规则引擎反复回答一个问题:当前事实的哪些组合满足规则?Rete 保存已经过滤的事实和部分匹配结果,让变化沿共享网络传播,从而持续维护匹配结果。本文先推导这个网络,再用 Go 实现一个小型匹配器。

从朴素规则匹配器推导 Rete,并用可运行的 Go 示例实现共享过滤、真实关联、事实撤回,以及独立的待执行议程。