编码冗余度

🔐 Encoding Redundancy

Compare average code length with source entropy to compute redundancy (avgLen - H) / H; lower redundancy means a better code.

📐 计算公式与说明

编码冗余度(本页代码口径三输出):冗余度 = (平均码长−熵)÷平均码长×100(%);编码效率 = 熵÷平均码长×100(%);节省位数 = 符号数×(平均码长−熵)(位)。校验:三项输入空值/非数值即提示;平均码长为 0 时除零结果按「—」兜底。判据:无固定分级,冗余度越低编码越接近熵极限,效率与冗余度之和恒为 100%。

冗余越低编码越优,理想情况趋近 0。

📚 深度解析:编码冗余度

💡 常见使用场景

示例:两符号 p=0.9/0.1
熵≈0.469 bit,若定长 1 bit/符号则冗余≈113%;哈夫曼可逼近熵,冗余近 0。

❓ 常见问题(FAQ)

冗余度为何不是越低越好?
为纠错常主动加冗余(如信道编码),效率与可靠性需权衡。
与压缩率关系?
信源编码冗余越低压缩越强;本指标衡量离香农下限的差距。
熵怎么算?
H=−Σ p_i·log2(p_i),见信息熵(香农)工具。

Formula & Standard References

Item Formula / Rule Source / Standard
Redundancy definition R = 1 − H(X) / Hmax, ranging from 0 to 1 Shannon, A Mathematical Theory of Communication, 1948
Maximum entropy Hmax = log2(n) where n is the alphabet size Shannon 1948 §1 Discrete noiseless source
Coding efficiency Efficiency η = H(X) / Hmax = 1 − R ISO/IEC 2382 Information technology vocabulary — information theory terms