Simulation of M-PSK modulation techniques in AWGN channel
A generic simulation technique to simulate all M-PSK modulation techniques (for upto M=32) is given here. The given simulation code is very generic, and it plots both simulated and theoretical symbol error rates for all M-PSK modulation techniques (upto M=32).
M-PSK Modulation and simulation methodology:
The general expression for a M-PSK signal set is given by
Here M defines the number of constellation points in the constellation diagram and essentially the M-PSK type. For example M=4 implies 4-PSK or QPSK, M=8 implies 8-PSK. The value of M depends on another parameter ‘k’ – the number of bits we wish to squeeze into a single M-PSK symbol. For example if we wish to squeeze in 3 bits (k=3) in one transmit symbol, M = 2^(k) = 2^(3) = 8. This gives us 8-PSK configuration.
Equation (1) can be separated into cos and sin terms as follows
This can be written as
Here and are orthonormal basis functions that follows from Gram-Schmidt orthogonalization procedure and and are the coefficients of each signaling point in the M-PSK constellation. is the symbol energy usually normalized to The constellation points on the M-PSK constellation lie radians apart and are placed on a circle of radius . The coefficients si1 and si2are termed as inphase (I) and quadrature-phase (Q) components respectively.
The ideal constellation diagram for M-PSK contains M equally spaced signaling points that are located at the distance from the origin. Figure 1 illustrates the ideal constellation diagram for 8-PSK constellation.
The generated I and Q components are then added with AWGN noise of required variance depending on the required Es/N0. The received signal’s constellation is corrupted with noise and the detection is based on comparing the received symbols with the ideal signaling points and making a decision based on the minimum distance.
Finally the simulated and theoretical symbol error rates are computed.
The theoretical symbol error rate  for M-PSK modulation is given by
File 1: simulateMPSK.m
Check this book for full Matlab code.
Simulation of Digital Communication Systems Using Matlab – by Mathuranathan Viswanathan
File 2: M_PSK_wrapper.m
% Demonstration of Eb/N0 Vs SER for all M-PSK modulation scheme
% Author: Mathuranathan for http://www.gaussianwaves.com
% License : creative commons : Attribution-NonCommercial-ShareAlike 3.0
N=1000000; %Number of input symbols
EbN0dB = 0:2:12; %Define EbN0dB range for simulation
k=2:1:5; % Number of Symbols for each M-PSK modulation
Rc=1; %Rc = code rate for a coded system. Since no coding is used Rc=1
M=2.^k; %for M-PSK modulation.
simulatedSER = zeros(length(M),length(EbN0dB));
theoreticalSER = zeros(length(M),length(EbN0dB));
[simulatedSER(i,:), theoreticalSER(i,:)]= simulateMPSK(i,N,EbN0dB,Rc);
plot(EbN0dB,log10(simulatedSER(i,:)),sprintf('%s-',plotColor(j))); hold on;
plot(EbN0dB,theoreticalSER(i,:),sprintf('%s*',plotColor(j))); hold on;
legend('Simulated - QPSK','Simulated - 8-PSK','Simulated - 16-PSK','Simulated - 32-PSK','Theoretical - QPSK','Theoretical - 8-PSK','Theoretical - 16-PSK','Theoretical - 32-PSK');
ylabel('Symbol Error Rate (Ps)');
title('Eb/N0 (dB) Vs Symbol Error Rate for various M-PSK schemes');
 BER Vs Eb/N0 for 8-PSK modulation over AWGN
 BER Vs Eb/N0 for QPSK modulation over AWGN
QPSK modulation and Demodulation
 Simulation of BER Vs Eb/N0 for BPSK modulation over AWGN in Matlab
 Intuitive derivation of Performance of an optimum BPSK receiver in AWGN channel