Adding "realistic" noise to signals of different amplitudes
I would do it this way in Matlab:

stanDevNoise_i=sqrt((Ai^2)/(2*EbNo));
noise_i=stanDevNoise*(randn(length(xi),1)+1i*randn(length(xi),1));


The reason I put (Ai^2)/2 is because you want to put there your signal power. 
The noise is just a random number with the same length as your signal (p, in your case).