Constellation Space For M-QAM (M-ary Quadrature Amplitude Modulation) 

MATLAB PROGRAM

%  This code shows constellation space for

%  M-QAM (M-ary Quadrature Amplitude Modulation) scheme.

%  To get more ideas of the used inbuilt function,

%  type 'help the_function' (without inverted comma) in 'Command Window'

%  and press Enter.

%  For example, help pskmod; you will get details.

%  At low SNRs, there is higher probability that a symbol fall into

%  the region of other symbols. This results in higher detection error

%  probability at the receiver. As SNR increases, the symbols are highly

%  likely to fall into their own region, hence reducing the detection error

%  probability or increasing the correct detection probability.

%

 

clc;

clear all;

 

M = 16;   % modulation order - should be 2, 4 , 8, 16, and so on

 

Nsymb = 1e4; % number of symbols

 

d = randi ([0,M-1],1, Nsymb);  % d stores random symbols

 

y = qammod (d, M);  % symbols 'd' are modulated using M-PSK and stored in y

 

 

snr_dB = 0:3:15;  % SNR (signal-to-noise ratio) level (dB)

 

for ii = 1:length(snr_dB)  % iteration for dirrefernt SNR levels

 

  snr = 10^(snr_dB(ii)/10) ;  % SNR in linear scale

 

  z = awgn (y, snr);   % z stores noisy symbols. awgn(y, snr) adds noise in y

 

  figure,plot (z, "mo", y, "bo")  % plotting z and y (scatter plot)

  title(['Constellation Space for ',num2str(M),'-QAM at SNR = ',...

                                   num2str(snr_dB(ii)),'dB']); % title of the plot

                               

  grid on; % this enalbes grids on the plot

  axis([-4 4 -4 4]);  % set range of x-axis and y-axis

 

  legend('Symbols under noise (Received)', 'Symbols without noise (Transmitted)')

                % legends. circles in magenta color correspnd to noisy symbols z

                % and circles in blue color correspnd to noiseless symbols y.

            

  %pause(1) % pause for 1 second

 

end

SIMULATED OUTPUT

DOWNLOAD LINK