symbols2bits.m

来自「APSK仿真程序」· M 代码 · 共 26 行

M
26
字号
%This function Maps the input symbols on to Bits

%Input Parameters:-
%Symbols : Symbols to be mapped on to bits

%Output Parameters:-
%Bits : Bits for the input symbols

function Bits = Symbols2Bits(Symbols)
%Paramters Initialization
Parameter;
Initialconstellation;

Bits = [];
    
for iSymb = 1 : length(Symbols)
    CurSymbol = Symbols(iSymb);
%    for i=1:length(Constellation_Table)
%        if abs(Constellation_Table(i)-CurSymbol)<=10^(-4)
%            BitsValue=i;
%        end
%    end
    BitsValue = find(Constellation_Table == CurSymbol);
    CurSymbolBits = de2bi(BitsValue-1, BitsPerSymb, 'left-msb');        
    Bits = [Bits, CurSymbolBits];
end

⌨️ 快捷键说明

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