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

📄 encoding.m

📁 信道编码程序
💻 M
字号:
function [codeword,sita]=encoding(symbol_per_frame, x1, x2, table)
   S0=[0,0; 1;];
   S1=[1, 0;];
current_state=0;
            for i=1:symbol_per_frame,
                switch current_state,
                    case 0,
                        switch x2(i),
                                case 0,
                                    codeword(i,1)=x1(i);
                                    codeword(i,2)=S0(x1(i)+1);
                                    sita(i)=0;
                                    current_state=0;
                                case 1,
                                    codeword(i,1)=x1(i);
                                    codeword(i,2)=S1(x1(i)+1);
                                    sita(i)=pi;
                                    current_state=1;
                                otherwise,
                                    display('encoding input is error');
                        end;
                    case 1,
                        switch x2(i),
                            case 0,
                                    codeword(i,1)=x1(i);
                                    codeword(i,2)=S1(x1(i)+1);
                                    sita(i)=0;
                                    current_state=0;
                            case 1,
                                    codeword(i,1)=x1(i);
                                    codeword(i,2)=S0(x1(i)+1);
                                    sita(i)=pi;
                                    current_state=1;
                            otherwise,
                                display('encoding input is error');
                        end;
                    otherwise,
                        display('encoding input is error');
                end; %end for switch current states
            end;      %end for i

⌨️ 快捷键说明

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