MATLAB: SNR in AWGN

awgncommunicationCommunications ToolboxMATLABnoisesnr

Hello,
i am trying to do some simulation of AWGN channel. matlab has a function awgn(x,snr). what kind of snr does it use here? is it Eb/No (average bit energy/power spectral density)? If so, then i know the awgn has a PSD equal to No/2. does that psd in the snr term implies No/2?
-OBLI

Best Answer

With the syntax
y = awgn(x,snr);
You generate a white noise vector with a variance of
variance = 10^(-snr/10);
noise = sqrt(variance)*randn(size(x));
If you use 'measured', then awgn actually measures the signal power.
For example:
x = cos(pi/4*(0:99));
y = awgn(x,5,'measured');
In this case the variance of the additive white noise is:
sigp = 10*log10(norm(x,2)^2/numel(x));
snr = sigp-5;
noisep = 10^(snr/10);
noise = sqrt(noisep)*randn(size(x));
Related Question