文件名称:huffman-code
介绍说明--下载内容均来自于网络,请自行研究使用
程序的算法
1)先输入以下字符串和数组,其中sym为字符串中出现的信源符号,p为各符号出现的概率,seq为要进行编码的符号序列。如下所示:
2)初始各字符的区间:a[0,0.1),b[0.1,0.3),c[0.3,0.6),d[0.6,1.0)
3)利用以下公式计算区间的上下限:
Li+1=Li+rangei*r_L
Hi+1=Li+rangei*r_H
-Program Algorithm 1) to enter the following string and array of sym string of source symbols appear, p is the probability of each symbol appears, seq is a sequence of symbols to be encoded. As follows: 1) the initial interval of each character: a [0,0.1), b [0.1,0.3), c [0.3,0.6), d [0.6,1.0) 3) using the following formula to calculate the upper and lower intervals: Li+1 = Li+rangei* r_L Hi+1 = Li+rangei* r_H
1)先输入以下字符串和数组,其中sym为字符串中出现的信源符号,p为各符号出现的概率,seq为要进行编码的符号序列。如下所示:
2)初始各字符的区间:a[0,0.1),b[0.1,0.3),c[0.3,0.6),d[0.6,1.0)
3)利用以下公式计算区间的上下限:
Li+1=Li+rangei*r_L
Hi+1=Li+rangei*r_H
-Program Algorithm 1) to enter the following string and array of sym string of source symbols appear, p is the probability of each symbol appears, seq is a sequence of symbols to be encoded. As follows: 1) the initial interval of each character: a [0,0.1), b [0.1,0.3), c [0.3,0.6), d [0.6,1.0) 3) using the following formula to calculate the upper and lower intervals: Li+1 = Li+rangei* r_L Hi+1 = Li+rangei* r_H
(系统自动生成,下载前可以参看下载内容)
下载文件列表
huffman code(包括熵和平均码长)\huffman.m
................................\prob.m
huffman code(包括熵和平均码长)