td-scdma_16qamconstall.m

来自「Plots Constellation difference between t」· M 代码 · 共 37 行

M
37
字号
% close all
clear
clc

% Ideal constellation

M = 16; % Number of points in constellation
h=modem.qammod(M); % Modulator object
% h=modem.qammod('M', 16, 'PhaseOffset', -45); % Modulator object
mapping=h.SymbolMapping; % Symbol mapping vector
pt = h.Constellation; % Vector of all points in constellation

% Plot the constellation.
scatterplot(pt);

% Include text annotations that number the points.
text(real(pt)+0.1,imag(pt),dec2bin(mapping));
axis([-4 4 -4 4]); % Change axis so all labels fit in plot.

title('Ideal 16QAM constellation');

% TD-SCDMA 16QAM constellation
M = 16; % Number of points in constellation
SymbolMapping = [11, 10, 14, 15, 9, 8, 12, 13, 1, 0, 4, 5, 3, 2, 6, 7];
PhaseOffset = 0.7854; % 45 degreee
h=modem.qammod('M', 16, 'PhaseOffset', PhaseOffset, 'SymbolOrder', 'user-defined', 'SymbolMapping', SymbolMapping); % Modulator object
mapping=h.SymbolMapping; % Symbol mapping vector
pt = h.Constellation; % Vector of all points in constellation

% Plot the constellation.
scatterplot(pt);

% Include text annotations that number the points.
text(real(pt)+0.1,imag(pt),dec2bin(SymbolMapping));
axis([-5 5 -5 5]); % Change axis so all labels fit in plot.

title('TD-SCDMA 16QAM constellation');

⌨️ 快捷键说明

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