📄 encoding.m
字号:
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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -