算数编码(c++实现)
摘要:
最近老师布置了一道题目,要求用c++来实现算数编码,题目要求为:无记忆信源 a1 a2 a3 a4 ,其概率分布为:p(a1)=0.5,p(a2)=0.25,p(a3)=0.125,p(a4)=0.125信源序列:u=a2 a1 a1 a3 a4 a1 a2 a1对信源进行编码。代码实现部分如下:#include<iostream>#include<math.h>using namespace std;double p[]={0.5,0.25,0.125,0.125}; //信源概率分布char u[]={2,1,1,3,4,1,2,1}; //信源序列double f 阅读全文
posted @ 2011-11-27 18:04 博远小记 阅读(570) 评论(0) 推荐(0)
浙公网安备 33010602011771号