二元信源 信息熵 计算公式

来源:百度知道 编辑:UC知道 时间:2024/05/12 06:34:38
信息论基础...二元信源 信息熵 计算公式.急求
不是联合熵。最好有图片形式的公式。写log时不必写底。求求各位高人帮帮忙。简单的话我也不会给高的悬赏分了。

信源熵:
H(x)=E[I(xi)]=E[log2 1/p(xi)]=-ξp(xi)log2 p(xi)(i=1,2,..n)
二元信源,你是想说联合熵吗?
我不知道你想知道什么?

已经调试过了
信息熵计算源代码
函数源程序 CalEntropy.m
Information Shannon Entropy calculation
jma@hebut.edu.cn, 22/08/2007
array : Discrete Probabilities Set
H : Output Shannon Entropy
function H = CalEntropy(array)
Vector number
num = length(array);
Check probabilities sum to 1:
if abs(sum(array) - 1) > .00001,
error('Probablities don''t sum to 1.')
end
Remove any zero probabilities %%
zeroProbs = find(array < eps);
if ~isempty(zeroProbs),
array(zeroProbs) = [];
disp('Removed zero or negative probabilities.')
End
Compute the entropy
H = -sum(array .* log2(array)); % 单位 bit/symbol