www.pudn.com > 8PSK.rar > ModSymTable.m, change:2007-11-15,size:2638b


function [Dimen, SymbolTable] = ModSymTable(ModType) 
 
clear Dimen SymbolTable; 
 
%******************************************************************************************************************* 
% Modulation Symbols Table 
%******************************************************************************************************************* 
 
Mi_BPSK = 2; 
U_BPSK(1) = 1;                                  % BPSK symbols table 
U_BPSK(2) = -1; 
 
Mi_QPSK  = 4;                                   % QPSK symbols table 
Theta0 = pi/4; 
for (i=1:Mi_QPSK) 
    Theta = (i-1)*2*pi/Mi_QPSK+Theta0; 
    U_QPSK(i) = cos(Theta)+j*sin(Theta);         
end; 
 
Mi_8PSK  = 8;                                   % 8PSK symbols table 
Theta0 = 0; 
for (i=1:Mi_8PSK) 
    Theta = (i-1)*2*pi/Mi_8PSK+Theta0; 
    U_8PSK(i) = cos(Theta)+j*sin(Theta);         
end; 
 
% QAM Table Generation 
 
IncUnit = 2; 
k = 0; 
for (i=1:4) 
    k = k+1; 
    U_QAM(k) = 1+IncUnit*(i-1)+j*(1+IncUnit*(i-1)); 
    for (n=1:(2*i-1)) 
        U_QAM(k+1) = U_QAM(k)-IncUnit; 
        k = k+1; 
    end; 
    for (n=1:(2*i-1)) 
        U_QAM(k+1) = U_QAM(k)-j*IncUnit; 
        k = k+1; 
    end; 
    for (n=1:(2*i-1)) 
        U_QAM(k+1) = U_QAM(k)+IncUnit; 
        k = k+1; 
    end; 
    for (n=1:(2*i-1)-1) 
        U_QAM(k+1) = U_QAM(k)+j*IncUnit; 
        k = k+1; 
    end; 
end; 
 
Mi_16QAM = 16;                                  % 16QAM symbols table 
U_16QAM = U_QAM(1:Mi_16QAM); 
powerAccu = sum((abs(U_16QAM).^2)/Mi_16QAM); 
NormQAM = (1/powerAccu)^0.5; 
U_16QAM = NormQAM*U_16QAM; 
 
Mi_32QAM = 32; 
U_32QAM(1:16) = U_QAM(1:16); 
U_32QAM(17:20) = U_QAM(18:21); 
U_32QAM(21:24) = U_QAM(23:26); 
U_32QAM(25:28) = U_QAM(28:31); 
U_32QAM(29:32) = U_QAM(33:36); 
powerAccu = sum((abs(U_32QAM).^2)/Mi_32QAM); 
NormQAM = (1/powerAccu)^0.5; 
U_32QAM = NormQAM*U_32QAM; 
 
Mi_64QAM = 64;                                  % 64QAM symbols table 
U_64QAM = U_QAM(1:Mi_64QAM); 
powerAccu = sum((abs(U_64QAM).^2)/Mi_64QAM); 
NormQAM = (1/powerAccu)^0.5; 
U_64QAM = NormQAM*U_64QAM; 
 
switch ModType 
case 'BPSK' 
        Dimen = log2(Mi_BPSK); 
        SymbolTable = U_BPSK; 
    case 'QPSK' 
        Dimen = log2(Mi_QPSK); 
        SymbolTable = U_QPSK; 
    case '8PSK' 
        Dimen = log2(Mi_8PSK); 
        SymbolTable = U_8PSK; 
    case '16QAM' 
        Dimen = log2(Mi_16QAM); 
        SymbolTable = U_16QAM; 
    case '32QAM' 
        Dimen = log2(Mi_32QAM); 
        SymbolTable = U_32QAM;         
    case '64QAM' 
        Dimen = log2(Mi_64QAM); 
        SymbolTable = U_64QAM;         
    otherwise 
        Dimen = 0; 
        SymbolTable = 0; 
end;