natalie_nyl
Newbie level 3
Hi ,
I have edit my MATLAB code to suit for the 64 QAM modulation. Below is my code for modulation + awgn + demodulation part. It works fine for 16 QAM but an error of "index exceeds matrix limit" is popping out when modified to 64 QAM.
Hope anyone can ans me or help me to solve that prob. Thanks a lot.
%MATLAB Code
% 64-QAM Modulation+AWGN Channel
grayencod = bitxor(0:M-1, floor((0:M-1)/2));
msg_gr_enc = grayencod(msg_enc+1);
msg_tx = modulate(modem.qammod(M, 64), msg_gr_enc);
msg_tx = rectpulse(msg_tx, nsamp);
msg_rx = awgn(msg_tx, 1000,'measured');
%Demodulation
msg_rx_int = intdump(msg_rx, nsamp);
msg_gr_demod = demodulate(modem.qamdemod(64), msg_rx_int);
[dummy graydecod] = sort(grayencod);
graydecod = graydecod - 1;
msg_demod = graydecod(msg_gr_demod+1)';
msg_demod_bi = de2bi(msg_demod,k)';
msg_demod_bi = msg_demod_bi);
Error popped out in command window:
??? Index exceeds matrix dimensions.
Error in ==> LTEModel_64QAM at 41
msg_demod = graydecod(msg_gr_demod+1)';
I have edit my MATLAB code to suit for the 64 QAM modulation. Below is my code for modulation + awgn + demodulation part. It works fine for 16 QAM but an error of "index exceeds matrix limit" is popping out when modified to 64 QAM.
Hope anyone can ans me or help me to solve that prob. Thanks a lot.
%MATLAB Code
% 64-QAM Modulation+AWGN Channel
grayencod = bitxor(0:M-1, floor((0:M-1)/2));
msg_gr_enc = grayencod(msg_enc+1);
msg_tx = modulate(modem.qammod(M, 64), msg_gr_enc);
msg_tx = rectpulse(msg_tx, nsamp);
msg_rx = awgn(msg_tx, 1000,'measured');
%Demodulation
msg_rx_int = intdump(msg_rx, nsamp);
msg_gr_demod = demodulate(modem.qamdemod(64), msg_rx_int);
[dummy graydecod] = sort(grayencod);
graydecod = graydecod - 1;
msg_demod = graydecod(msg_gr_demod+1)';
msg_demod_bi = de2bi(msg_demod,k)';
msg_demod_bi = msg_demod_bi);
Error popped out in command window:
??? Index exceeds matrix dimensions.
Error in ==> LTEModel_64QAM at 41
msg_demod = graydecod(msg_gr_demod+1)';