⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 trellis2enc.m

📁 Woven码在TD-SCDMA中的应用仿真程序
💻 M
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -