📄 modified_modulation.m
字号:
function [Symbols] = modified_modulation(TxBits, ModScheme)
% This function Gray encodes binary bits into QPSK symbols onto antenna.
%
% function [Symbols] = Modulation(TxBits, ModScheme)
%
% Input:
% TxBits -- Transmit bits
% ModScheme -- Modulation type
% Output:
% Symbols -- Modulated symbols
% Note:
% Unit energy symbol constellation
% See also:
% None
% Description:
% Author(s): Wang Dongming, SEU, NCRL
% TxBits = [ 0 0 1 1 ] ;
% 3
% ModScheme = 4 ;
%
%
% modified by dupeng 2003 5 15
j=sqrt(-1);
% Gray coded 16-QAM mapping vector
% MapMatrix16QAM = [-1-j -1-3*j -1+j -1+3*j -3-j -3-3*j -3+j -3+3*j 1-j 1-3*j 1+j 1+3*j 3-j 3-3*j 3+j 3+3*j];
% 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
% modified to
MapMatrix16QAM=[ 1+j -1+j 1-j -1-j 3+j -3+j 3-j -3-j 1+3j -1+3j 1-3j -1-3j 3+3j -3+3j 3-3j -3-3j] ;
MapMatrix16QAM = MapMatrix16QAM/sqrt(10);
% Binary to Decimal order vector
vecOrder = (2.^(ModScheme-1:-1:0)).';
switch ModScheme
case 1
Symbols = TxBits*2 - 1;
case 2
Symbols = ((TxBits(:,1:2:end)*2 - 1) + j*(TxBits(:,2:2:end)*2 - 1))/sqrt(2);
case 4
matTxBits = vec2mat(TxBits,ModScheme);
vecTxBits = matTxBits * vecOrder + 1;
Symbols = MapMatrix16QAM(vecTxBits);
otherwise
disp('Modulation options out of range');
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -