No BSD License  

Highlights from
QAM TUTORIAL

QAM TUTORIAL

by

 

14 Aug 2007 (Updated )

M-file for the generation of a symmetrical 16QAM constellation showing amplitudes and phases.

QAM16_TUTORIAL.m
%QAM Tutorial(QAM16_TUTORIAL.m)
%JC 8/12/07
%Run from editor debug(F5)
%m-file for the generation of a symmetrical 16QAM constellation showing amplitudes and
%phases. M=2^2,4,6,8(M=4,16,64,256) can be generated with minor changes.
%Gray coding with 4 bits/symbol(M=16) would normally be used in the real world.
%===================================================================
clear;
ampqam=[-3 -1 1 3] %Number of amplitudes(4 for 16QAM)
A = repmat(ampqam,4,1)
B = flipud(A')
constellation_qam = A+j*B %Matrix that contains all the constellation points(complex)
constellation_qam1 = constellation_qam(:) %Change to column vector
qam = constellation_qam1(floor((16)*rand(1,10000))+1);%Generate 16QAM symbol sequence(complex)
figure(1)
plot(qam,'o'); %Plot the constellation
axis([-4 4 -4 4]); grid on;
xlabel('Q Amplitude');ylabel('I Amplitude');
title('16 QAM Constellation')
phaseangle_rad=atan2(imag(constellation_qam1),real(constellation_qam1))
phaseangle_deg=57.29577*phaseangle_rad
sort(phaseangle_deg)% Count number of DIFFERENT phase angles in command window(12 for 16QAM)

Contact us