function a = PAM(M,S)

d=2;
sigma2s=d^2*(M^2-1)/12;
x=rand(S,1);
a=(1/sqrt(sigma2s))*(2*ceil(M*x)-(M+1));
