?? encoding.m
字號(hào):
function [codeword,sita]=encoding(symbol_per_frame, x1, x2, table)
S0=[0,0; 1;];
S1=[1, 0;];
current_state=0;
for i=1:symbol_per_frame,
switch current_state,
case 0,
switch x2(i),
case 0,
codeword(i,1)=x1(i);
codeword(i,2)=S0(x1(i)+1);
sita(i)=0;
current_state=0;
case 1,
codeword(i,1)=x1(i);
codeword(i,2)=S1(x1(i)+1);
sita(i)=pi;
current_state=1;
otherwise,
display('encoding input is error');
end;
case 1,
switch x2(i),
case 0,
codeword(i,1)=x1(i);
codeword(i,2)=S1(x1(i)+1);
sita(i)=0;
current_state=0;
case 1,
codeword(i,1)=x1(i);
codeword(i,2)=S0(x1(i)+1);
sita(i)=pi;
current_state=1;
otherwise,
display('encoding input is error');
end;
otherwise,
display('encoding input is error');
end; %end for switch current states
end; %end for i
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -