Kindly tell me the theory behind the two commands (marked with ***
) of an AWGN channel in the below shown code.
Code:
N_all = [10^3*ones(1,6) 10^3*ones(1,5)];
Eb_no = [0:2:20];
for ii=1:length(Eb_no)
N = N_all(ii);
b = (1/sqrt(2))*rand(1,N)>0.5;
ip = qpsk_new(b);
s = ip;
*** noise = 1/sqrt(2) * [randn(1,N/2)+j*randn(1,N/2)];
*** y = s+10^(-Eb_no(ii)/20)*noise;
end