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

📄 prologue_init_state.m

📁 该文件夹为空时块码-卷积码级联系统的仿真程序
💻 M
字号:
function state=prologue_init_state(Pr_c)
% prologue step to look for good intial state, use viterbi algorithm

% load trellis
load next_out.mat;
load next_state.mat;
load last_out.mat;
load last_state.mat;

path_state=zeros(64,70);    % every stage and state's previous state: 64 states, 70=10*K data bits
Metric_state_prev=ones(64,1);   % each state's metric at previous stage
Metric_state_current=ones(64,1);    % each state's metric at current stage
for stage=1:70
    for state=1:64
        [Metric_state_current(state),index] ...
        =max([Pr_c(last_out(state,1)+1,2*stage-1)*Pr_c(last_out(state,2)+1,2*stage)*Metric_state_prev(last_state(state,1)), ...
             Pr_c(last_out(state,3)+1,2*stage-1)*Pr_c(last_out(state,4)+1,2*stage)*Metric_state_prev(last_state(state,2))]);
         path_state(state,stage)=last_state(state,index);
    end % end for state
    Metric_state_prev=Metric_state_current;
end % end for stage

[Metric,state]=max(Metric_state_current);

% Trace back to get initial state
for stage=70:-1:1
    state=path_state(state,stage);
end % end for stage

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -