% QAM_SER   Compute the SER for square M-QAM given 
%           MSE achieved by a receiver

function SER = QAM_SER(M,MSE)

ProotM=(1-1/sqrt(M))*erfc(sqrt(3/2*1/(M-1)*1./MSE));
SER=1-(1-ProotM).^2;
