find_sttc.m
来自「通信中常用的卷积码信道译码源码程序」· M 代码 · 共 42 行
M
42 行
function [ST_NextState, ST_Output] = ... find_sttc(STTCFile, modulation_type, number_of_states);%------------------------------------------------------------------------------% Find Tarokh space-time code trellis structures.% % Format:% -------% % [ST_NextState, ST_Output] = ...% find_sttc(STTCFile, modulation_type, number_of_states)% % Author: MVe% Date: 26.07.2002%------------------------------------------------------------------------------% Convert number to stringnumber_of_states_s = num2str(number_of_states);% Open file, read it to variable 'STTC' and close fileFileID= fopen(STTCFile,'r');STTC = fread(FileID);fclose(FileID);% Find correct trellis structureMatchB = ... ['#define ', modulation_type, ' ',number_of_states_s,'-state STTC begins'];BCode = findstr(char(STTC)',MatchB);MatchE = ... ['#define ', modulation_type, ' ',number_of_states_s,'-state STTC ends'];ECode = findstr(char(STTC)',MatchE);STTC = STTC(BCode(1)+length(MatchB):ECode(1)-1);% Insert trellis structure to variableseval(char(STTC).');% Convert 'ST_NextState' and 'ST_Output' to "pointer" formatsize_o = size(Output);ST_NextState = NextState+1;ST_Output = reshape(num2cell([Output{:,:}]+1,[1,3]),size_o);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?