📄 qampsk_modulate.m
字号:
function s=qampsk_modulate(R,Q_modu)%输入为编码后的,输出为复数点Q=4or16or8
if Q_modu==4
table=exp(j*[pi/4 ,3*pi/4 ,-pi/4,-3*pi/4]);%mapping表
table=table([1,3,2,4]);
s=table([ 2 1]*R+1);%s为mapping后的复数点
elseif Q_modu==8
table=exp(j*[0 ,pi/4 ,2*pi/4 ,3*pi/4 ,pi ,-3*pi/4,-2*pi/4 ,-pi/4]);
table=table([1,2,4,3,8,7,5,6]);
s=table([4 2 1]*R+1);%s为mapping后的复数点
elseif Q_modu==16
table=1/sqrt(10)*[-3+3*j,-1+3*j,3+3*j,1+3*j,-3+j,-1+j,3+j,1+j,-3-3*j,-1-3*j,3-3*j,1-3*j,-3-j,-1-j,3-j,1-j];
s=table([8 4 2 1]*R+1);%s为mapping后的复数点
% elseif Q_modu==64%利用最大距离
% table=1/sqrt(42)*[7+7*j,7+5*j,7+j,7+3*j,7-j,7-3*j,7-7*j,7-5*j,...
% 5+7*j,5+5*j,5+j,5+3*j,5-j,5-3*j,5-7*j,5-5*j,...
% 1+7*j,1+5*j,1+j,1+3*j,1-j,1-3*j,1-7*j,1-5*j,...
% 3+7*j,3+5*j,3+j,3+3*j,3-j,3-3*j,3-7*j,3-5*j,...
% -1+7*j,-1+5*j,-1+j,-1+3*j,-1-j,-1-3*j,-1-7*j,-1-5*j,...
% -3+7*j,-3+5*j,-3+j,-3+3*j,-3-j,-3-3*j,-3-7*j,-3-5*j,...
% -7+7*j,-7+5*j,-7+j,-7+3*j,-7-j,-7-3*j,-7-7*j,-7-5*j,...
% -5+7*j,-5+5*j,-5+j,-5+3*j,-1-j,-1-3*j,-1-7*j,-1-5*j];
% s=table([32 16 8 4 2 1]*R+1);%s为mapping后的复数点
elseif Q_modu==64%利用reim
table=1/sqrt(42)*[-7-7*j,-7-5*j,-7-j,-7-3*j,-7+7*j,-7+5*j,-7+j,-7+3*j,...
-5-7*j,-5-5*j,-5-j,-5-3*j,-5+7*j,-5+5*j,-5+j,-5+3*j,...
-1-7*j,-1-5*j,-1-j,-7-3*j,-1+7*j,-1+5*j,-1+j,-1+3*j,...
-3-7*j,-3-5*j,-3-j,-3-3*j,-3+7*j,-3+5*j,-3+j,-3+3*j,...
7-7*j,7-5*j,7-j,7-3*j,7+7*j,7+5*j,7+j,7+3*j,...
5-7*j,5-5*j,5-j,5-3*j,5+7*j,5+5*j,5+j,5+3*j,...
1-7*j,1-5*j,1-j,1-3*j,1+7*j,1+5*j,1+j,1+3*j,...
3-7*j,3-5*j,3-j,3-3*j,3+7*j,3+5*j,3+j,3+3*j];
s=table([32 16 8 4 2 1]*R+1);%s为mapping后的复数点
%
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -