trellis2enc.m
来自「根据TD-SCDMA系统的特点」· M 代码 · 共 25 行
M
25 行
function enc = trellis2enc( trl ),
% put the trellis structure into a more user friendly manner
enc.k = log2( trl.numInputSymbols ); % number of inputs
enc.n = log2( trl.numOutputSymbols ); % numbor of outputs
enc.r = enc.k / enc.n; % code rate
enc.ksym = trl.numInputSymbols; % number of possible input combinations
enc.nsym = trl.numOutputSymbols; % number of possible output combinations
enc.stat = trl.numStates; % number of encoder states
% forward transitions:
enc.next.states = trl.nextStates + 1; % NEXT states
enc.next.output = trl.outputs; % NEXT outputs
for i = 1:enc.ksym, % NEXT (binary) outputs
enc.next.binout(:,:,i) = 2*de2bi(oct2dec(trl.outputs(:,i)), enc.n)-1;
end
% store possible binary outputs and inputs:
enc.inp = de2bi( oct2dec( [0:enc.ksym-1] ), enc.k, 'left-msb' ); % all possible binary inputs
enc.out = de2bi( oct2dec( [0:enc.nsym-1] ), enc.n, 'left-msb' ); % all possible binary outputs
enc.bininp = 2*enc.inp-1;
enc.binout = 2*enc.out-1;
return;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?