Below is an example of a digital modulation system using 16-QAM. I have copied this example from MATLAB communications toolbox,
M = 16; % Size of signal constellation
k = log2(M); % Number of bits per symbol
n = 30000; % Number of bits to process
numSamplesPerSymbol = 1; % Oversampling factor
dataIn = randi([0 1],n,1);
dataInMatrix = reshape(dataIn, length(dataIn)/4, 4); % Reshape data into binary 4-tuples
dataSymbolsIn = bi2de(dataInMatrix);
dataMod = qammod(dataSymbolsIn, M);
I am wondering if
1) there is a need to reshape the bits into tuples of 4 bits
2) there is a need to do the mapping from binary to decimal and then do the QAM modulation, couldn't I just have done
dataMod = qammod(dataIn, M)
;
Thanks.