- 110
- 0
- 约4.21千字
- 约 7页
- 2020-08-03 发布于河北
- 举报
哈尔滨理工大学荣成学院
信息论与编码实验报告
——费诺编码
班级: 电信12-1班
姓名: 李 赛
学号: 1230160109
日期: 2015.6.17
费诺编码
C语言代码:
#includestdio.h
#includemath.h
#include string.h
static char p[20][20];
void Fano(int m,int n,float y[20]);
main()
{
int i,j,flag,count,b[20]; //count:信源符号个数,b[]: 码长
float a[20],temp,sum=0.0,l=0.0,H=0.0,y,R; // a[]:输入概率分布 l:平均码长 H:信源熵 y:编码效率 R:信源信息率
flag=0; //flag:输入概率的判断标志位。为0时表示输入概率有误
/************ 输入信源符号个数并判断是否是正数 ******************/
printf(Please input the amount of probabilities\n);
scanf(%d,count
原创力文档

文档评论(0)