-3

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
Luis Mendo
  • 110,752
  • 13
  • 76
  • 147

1 Answers1

3

The randn function in the first marked line generates complex, Gaussian-distributed (1), independent (2) samples with zero mean and unit variance. The second marked line scales those samples according to the specified signal-to-noise ratio (EB/N0) and adds (3) them to the signal.

These operations stem from the definition of AWGN:

  1. The "G" in "AWGN" means "Gaussian".
  2. The "W" means "white". The term "white" applied to a stochastic process means that the samples are statistically independent (or uncorrelated; but in the Gaussian case they are equivalent conditions).
  3. The "A" is "additive", so you add the noise to the signal.
Luis Mendo
  • 110,752
  • 13
  • 76
  • 147