寻精通matlab的通信语音方面高手高高手!完美诠释可报酬
function sys=mdlOutputs(t,x,u)%初始化变量
y1=0;
y2=0;
y3=0;
y4=0;
y5=0;
y6=0;
y7=0;
y8=0;
y1=(u>=0)*1;%求极性码
u_abs=abs(u);
table=;
u_abs=u_abs.*(u_abs<1)+(u_abs>=1).*0.9999;%限幅
%段落码
y2=mdlGetduanluoMa(table,u_abs,2)*1;
y3=mdlGetduanluoMa(table,u_abs,3)*1;
y4=mdlGetduanluoMa(table,u_abs,4)*1;
DuanHao=mdlGetduanHao(y2,y3,y4);
DuanNeiHao=mdlGetDuanNeiHao(DuanHao,u_abs);
y8=(floor(DuanNeiHao./2)~=DuanNeiHao./2)*1;
DuanNeiHao=floor(DuanNeiHao./2);
y7=(floor(DuanNeiHao./2)~=DuanNeiHao./2)*1;
DuanNeiHao=floor(DuanNeiHao./2);
y6=(floor(DuanNeiHao./2)~=DuanNeiHao./2)*1;
DuanNeiHao=floor(DuanNeiHao./2);
y5=(floor(DuanNeiHao./2)~=DuanNeiHao./2)*1;
sys=;
end
%end mdlOutputs
function duanLuoMa=mdlGetDuanLuoMa(table,Is,i)
switch i,
case 2,
duanLuoMa=(Is>=table(4,2));
case 3,
duanLuoMa=(Is<table(4,2)&Is>=table(2,2))/(Is>=table(6,2));
case 4,
duanLuoMa=(Is<table(4,2)&Is>=table(2,2)&Is>=table(3,2))/(Is<table(4,2)
&Is<table(2,2)&Is>=table(1,2))/(Is>=table(4,2)&Is<table(6,2)
&Is>=table(5,2))/(Is>=table(4,2)&Is>=table(6,2)&Is>=table(7,2));
end
end
function duanHao=mdlGetDuanHao(y2,y3,y4)
duanHao=y2*4+y3*2+y4;
end
function DuanNeiHao=mdlGetDuanNeiHao(DuanHao,u_abs)
duanStartIw=1./(2. ^(8-DuanHao));
duanEndIw=2* duanStartIw;
qishiduan=1-(duanStartIw==1/256);
duanStartIw=duanStartIw.*qishiduan;
deta=(duanEndIw-duanStartIw)/16;
DuanNeiHao=(u_abs-duanStartIw)./deta;
DuanNeiHao=fLoor(DuanNeiHao);
end
寻精通matlab的通信语音方面高手高高手!完美诠释可考虑报酬!!!只为答辩通过!!!!
QQ:398981409
这个不是很难理解
页:
[1]