Constellation Space For M-PSK (M-ary Phase Shift Keying) Modulation Scheme
MATLAB PROGRAM
% This code shows constellation space for
% M-PSK (M-ary Phase Keying) 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;
close all
M = 4; % 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 = pskmod (d, M, 0, "gray"); % symbols 'd' are modulated using M-PSK and stored in y
snr_dB = 0:3:15; % SNR (signal-to-noise ratio) level (dB)
figure,plot (y, "bo") ;
grid on;
axis([-2 2 -2 2]); % set range of x-axis and y-axis
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),'-PSK at SNR = ',...
num2str(snr_dB(ii)),'dB']); % title of the plot
grid on; % this enalbes grids on the plot
axis([-3 3 -3 3]); % 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