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

📄 cpmstate_gen.asv

📁 cpm连续相位调制系统的matlab仿真程序
💻 ASV
字号:
% CPM state table generation

% h=[4,5]/16
% M=4: I=[+1,-1,+3,-3]
% L=1

clear;

m1=1;
p1=4;
m2=5;
p2=16;
h1=m1/p1;
h2=m2/p2;
h=[h1 h2];
M=4;
I=[+3 +1 -1 -3]; 

h1_state=mod((0:2*p1-1)*h1,2);
h2_state=mod((0:2*p2-1)*h2,2);

% state set
state1_set=sort(h1_state);
state1_num=length(h1_state);
state2_set=sort(h2_state);
state2_num=length(h2_state);

% next_state1[]: state transit with h1 
% next_state2[]: state transit with h2
for i=1:state1_num;
    for j=1:M
    next_state1(i,j)=mod(state1_set(i)+h1*I(j),2);
    end    
end

for i=1:state2_num;
    for j=1:M
    next_state2(i,j)=mod(state2_set(i)+h2*I(j),2);
    end    
end


% table used  by MLSE detect 
% state1_pre[]: with h1
% state2_pre[]: with h2
state1_pre=[];
state2_pre=[];
info1_pre=[];
info2_pre=[];

for i=1:state1_num
    index=find(next_state1==state1_set(i));
    row=mod(index-1,state1_num)+1;
    col=floor((index-1)/state1_num)+1;
    state1_pre=[state1_pre;row'];
    info1_pre=[info1_pre;col'];
end

for i=1:state2_num
    index=find(next_state2==state2_set(i));
    row=mod(index-1,state2_num)+1;
    col=floor((index-1)/state2_num)+1;
    state2_pre=[state2_pre;row'];
    info2_pre=[info2_pre;col'];
end

% two tables combine
% 将 state1_pre转换到state2的状态集中
state1_pre=state1_pre-1

debug=1;

⌨️ 快捷键说明

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