discrim16.m

来自「正交频分复用系统(OFDM)的频率偏移误差抑制技术仿真程序」· M 代码 · 共 38 行

M
38
字号
function outcomplex=discrim16(FFTsym)
%------------------------------------------------
%this function takes in a complex symbol and
%outputs the nearest 16 QAM symbol inside the constellation
%this is done by finding the shortest distance
%to any possible constellation and assigning complex
%to the nearest symbol
%Author: 王博
%Filename: discrim16.m
%----------------------------------------------

%the following are the 16 QAM constellation points
  const(1)=-1-i; 
  const(2)=-3-i; 
const(3)=-1-3*i; 
const(4)=-3-3*i; 
const(5)=1-1*i; 
const(6)=1-3*i; 
const(7)=3-1*i; 
const(8)=3-3*i; 
const(9)=-1+i; 
const(10)=-1+3i; 
const(11)=-3+i; 
const(12)=-3+3i; 
const(13)=1+i; 
const(14)=3+i; 
const(15)= 1+3i; 
const(16)=3+3i; 


        %computing all possible distances from the constants declared
        for K=1:16
            comp16(K)=abs(FFTsym-const(K));
        end

[val, index]=min(comp16);    %finding the minimum distance
outcomplex=const(index);     %the nearest symbol is returned

⌨️ 快捷键说明

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