📄 ieee802_15_3_tcm_code.m
字号:
function trellis=ieee802_15_3_tcm_code(mapping_type);
%This program generate TCM specified in
%IEEE 802.15.3-2003 standard.
%See page 250.
%
%info is the input binary input.
%tcm_output is the output symbols.
%
%By Aijun Song
%tcm: trellis codes setting up.
mapping_rate=constell_mapping_rate(mapping_type);
if mapping_rate==2 | mapping_rate==4 | mapping_rate==5 | mapping_rate==6,
n_k=[mapping_rate mapping_rate-1];
coding_rate=n_k(2)/n_k(1);
coding_reg_num=3;
else
disp('[chk_parameters]Error: codes for other than (qpsk/qam16/qam32/qam64) are not supported.')
end
trellis.numTotalInput=n_k(2);
switch mapping_rate
case {4, 5, 6}
numTrelInput=2;
numRegisters=3;
numTrelOutput=3;
trellis.numTotalOutput=trellis.numTotalInput-numTrelInput+numTrelOutput;
%Here we assume all the number is decimal.
trellis.numInputSymbols = 2^numTrelInput;
trellis.numStates = 2^numRegisters;
trellis.nextStates = [0 1 2 3; 4 5 6 7; 0 1 2 3; 4 5 6 7; ...
0 1 2 3; 4 5 6 7; 0 1 2 3; 4 5 6 7];
trellis.numOutputSymbols = 2^numTrelOutput;
trellis.outputs = [0 2 4 6; 1 3 5 7; 0 2 4 6; 1 3 5 7; ...
0 2 4 6; 1 3 5 7; 0 2 4 6; 1 3 5 7;];
case 2,
numTrelInput=1;
numRegisters=3;
numTrelOutput=2;
trellis.numTotalOutput=trellis.numTotalInput-numTrelInput+numTrelOutput;
%Here we assume all the number is decimal.
trellis.numInputSymbols = 2^numTrelInput;
trellis.numStates = 2^numRegisters;
trellis.nextStates = [0 1 ; 6 7; 0 1; 6 7; ...
2 3; 4 5; 2 3; 4 5;];
trellis.numOutputSymbols = 2^numTrelOutput;
trellis.outputs = [0 2; 1 3; 0 2; 1 3; ...
0 2; 1 3; 0 2; 1 3;];
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -