mapper2.m
来自「Mapper for QAM 2,4 and 6 bits, taking st」· M 代码 · 共 30 行
M
30 行
% Function Mapping generates the Symbols from the Bit Stream for the Modulate
% stream use for input
% symbol use for output of qam
% Symbol is than coverted to Digit.
function digit = mapper2(stream)
if (mod(length(stream),2)~=0)
pad(mod(length(stream),2))=0;
stream = [stream ,pad];
end
symbol (length(stream)/2,2) = 0;
digit = symbol;
j = 1;
k = 1;
for i=1:length(stream)
symbol(j,k)=stream(i);
%
k=k+1;
if (mod(i,2) == 0)
k=1;
j=j+1;
end
end
digit = bi2de(symbol,'left-msb');
end %end of qam function
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?