Skip to content

Hi, Blogs here!

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 示例实现共享过滤、真实关联、事实撤回,以及独立的待执行议程。