qam_bits2ab.m

来自「64QAM matlab s programs.」· M 代码 · 共 27 行

M
27
字号
function [a,b]=QAM_bits2ab(bit_stream)
%
% [a,b]=QAM_bits2ab(bit_stream)

% Make length a multiple of 4
L = length(bit_stream);
N = floor(L/4);
L2 = N*4;
bit_stream = bit_stream(1:L2);

BS = reshape(bit_stream,4,N);
BS1 = BS(1:2,:);
BS2 = BS(3:4,:);

for k = 1 : N
    
   % Split 4 bit word into two 2 bit words
   % and convert each to a a number from 0-3
   temp1 = BS1(:,k);
   num1 = temp1(1)*2+temp1(2);
   temp2 = BS2(:,k);
   num2 = temp2(1)*2+temp2(2);
   
   a(k) = (num1 - 1.5)/1.5;
   b(k) = (num2 - 1.5)/1.5;
    
end

⌨️ 快捷键说明

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