新版信息论与编码理论课程实验报告-新版.pdf

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

4/10012PCmatlab2007122612622631.[0.19050.071400.30950.11900.07140.11900.1190]2.61982615229476918133384411175863512113942810715412254919102902.260.09210.01760.02850.04180.10960.02000.02300.02670.06720.00420.00300.05210.02120.07330.08420.02540.00480.06480.09330.07390.03270.00550.01150.00610.01760hijklmn0.02670.06720.00420.00300.05210.02120.0733opqrstu0.08420.02540.00480.06480.09330.07390.03274.16971ASCII2ASCIIASCII26ASCIIaASCII0-250-252625261.fopenMATLABfread2.ASCII3.P01//10021.2.3.4.5.6.7.8.9.1.MATLABclcclearall%string='abdddssdsssdabaabaddkkidkidkdiakdjjaidjaid';%string=lower(string);%ASCIIaASCIInum=string-'a';%26fori=1:2005forj=1:26b(j)=sum(num==j-1);endenddisp('26');disp(b)%26s=0;fori=1:26s=s+b(i);endc=b/s;disp('26');disp(c)%w=0;fori=1:26ifc(i)~=0;w=w-c(i)*log2(c(i));endenddisp('')disp(w)2.MATLABclcclearall%d=fopen('TypesofSpeech.txt','r');%string=fread(d,'*char');%string=lower(string);%ASCIIaASCIInum=string-'a';%26fori=1:2005forj=1:26b(j)=sum(num==j-1);endenddisp('26');disp(b)%26s=0;fori=1:26s=s+b(i);endc=b/s;disp('26');disp(c)%w=0;fori=1:25ifc(i)~=0;w=w-c(i)*log2(c(i));endenddisp('')disp(w)

1 / 6
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功