get_constell.m

来自「国外大学的同志作出来的好程序」· M 代码 · 共 25 行

M
25
字号
function constell=get_constell(mapping_type);
%Obtain the constellation acroding to mapping type.
%
%
[constell, qpsk_constell, bpsk_constell]=qam_constell_gen(1);
if strcmp(lower(mapping_type), 'bpsk'),
    constell=bpsk_constell;
elseif strcmp(lower(mapping_type), 'qpsk') | strcmp(lower(mapping_type), 'qam4')| strcmp(lower(mapping_type), 'psk4')
    nrm_factor=1/sqrt(2);
    constell=nrm_factor*qpsk_constell;
elseif strcmp(lower(mapping_type), 'qam16')
    mapping_rate=4;
    nrm_factor=1/sqrt(10);
    constell=nrm_factor*constell(1:2^mapping_rate);
elseif strcmp(lower(mapping_type), 'qam32')
    mapping_rate=5;
    nrm_factor=1/sqrt(20);
    constell=nrm_factor*constell(1:2^mapping_rate);
elseif strcmp(lower(mapping_type), 'qam64')
    mapping_rate=6;
    nrm_factor=1/sqrt(42);
    constell=nrm_factor*constell(1:2^mapping_rate);
end

⌨️ 快捷键说明

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