gusucode.com > matlab通信工程仿真源码(张德丰等编著)程序书籍 > matlab_code/matlab通信工程仿真源码(张德丰等编著)/第8章/li8_2.m

    clear;
n=2^3;  %以3比特传递信道
t=[0:100]*pi/20;
y=cos(t);
[a,b]=lloyds(y,n); %生成分界点矢量和编码手册
[indx,quant,distor]=quantiz(y,a,b);  %理化信号
axis([-1 1 0 16]);
plot(t,y,t,quant,'.');