香农信息论 · 交互实验室
自信息、熵与信道容量
1 自信息
自信息衡量单个事件在信息论中的不确定程度,概率越低信息量越大。公式为 I = -log₂(p)。
事件概率 P(x) {{ selfInfoP.toFixed(3) }}
稀有 (0.01)0.5常见 (0.99)
自信息量
{{ selfInformation.toFixed(3) }} bits
惊讶度
{{ getSurpriseLevel(selfInformation) }}
左: 概率补集 | 右: 信息量 (上限截断)
2 信息熵
信息熵表示随机变量整体的不确定性,是所有可能事件信息量的期望值。计算方式 H = -∑ p_i log₂ p_i。
x{{ idx+1 }}
{{ (prob/100).toFixed(2) }}
熵 H(X)
{{ entropy.toFixed(3) }} bits
最大熵
{{ maxEntropy.toFixed(3) }} bits
不确定性占比: {{ (entropy/maxEntropy*100).toFixed(1) }}%
3 二元熵
二元熵是针对只有两种可能结果的随机变量的熵,反映事件发生与不发生的不确定性。计算公式同熵,只是两项。
P(A) {{ pBinary.toFixed(3) }}
P(A) {{ pBinary.toFixed(2) }}
P(¬A) {{ (1-pBinary).toFixed(2) }}
二元熵 {{ binaryEntropy.toFixed(4) }} bits
{{ getBinaryEntropyInterpretation(pBinary) }}
4 互信息 I(X;Y)
互信息衡量两个随机变量之间共享的信息量,表示已知一个变量对另一个变量不确定性的减少。I(X;Y)=H(X)+H(Y)-H(X,Y)。
P(x₁) {{ (jointProbs[0]/100).toFixed(2) }}
P(x₂) {{ (jointProbs[1]/100).toFixed(2) }}
相关性强度 ρ {{ (correlation/100).toFixed(2) }}
H(X) {{ marginalEntropyX.toFixed(2) }}
I(X;Y) {{ mutualInformation.toFixed(3) }}
H(Y) {{ marginalEntropyY.toFixed(2) }}
基于边缘熵与相关性的近似模型
5 香农信道容量
信道容量是信道在给定带宽和信噪比下的最大可靠传输速率,计算公式 C = B·log₂(1+SNR)。
带宽 B {{ bandwidth }} MHz
信噪比 SNR {{ snrDb }} dB
线性SNR {{ snrLinear.toFixed(2) }}
频谱效率 {{ spectralEfficiency.toFixed(2) }} bps/Hz
容量上限
{{ channelCapacity.toFixed(2) }} Mbps
6 文本熵分析
文本熵分析通过统计字符出现频率来估计信息熵,可用于评估文本的压缩潜力和语言复杂度。
字符数 {{ textInput.length }}
独特字符 {{ uniqueChars }}
最大熵 {{ maxTextEntropy.toFixed(2) }}
实际熵 {{ textEntropy.toFixed(4) }} bits/char · 效率 {{ compressionEfficiency.toFixed(1) }}%