📄 qmodulator2.m
字号:
%Carlos 26/03/06; AAU; DK
%one unnecessary output removed by Yuanye Wang
function yqam=qmodulator2(x,M)
K=log2(M); %x must be even(use the function randint to generate the bits
res=rem(length(x),K); %Remainder after division(exact number of bits)
if (res ~= 0)
x=x(1:length(x)-res);
end
symbi=reshape(x,K,length(x)/K).'; %Reshape in matrix containg column vectors for each symbol in Binary
symdec=bi2de(symbi,'left-msb'); %Converting from binary to Decimal
z=symdec;
%clear yqmod;
switch M
case 2
load qam2;
case 4
load qam4;
case 8
load qam8;
case 16
load qam16;
case 32
load qam32;
case 64
load qam64;
case 128
load qam128;
case 256
load qam256;
end
for i=1:length(z)
q(i)=yqmod(z(i)+1);
end
yqam=q;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -