SNR in AWGN
Show older comments
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
Accepted Answer
More Answers (2)
Wayne King
on 10 Jun 2012
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));
5 Comments
Gautam Sreekumar
on 10 Jun 2017
Edited: Gautam Sreekumar
on 10 Jun 2017
Is snr in dB or in linear scale?
shaunaksinha
on 29 Jun 2017
Edited: shaunaksinha
on 29 Jun 2017
Going by the official MATLAB documentation for awgn, I think snr is in dB. [https://www.mathworks.com/help/comm/ref/awgn.html?searchHighlight=awgn&s_tid=doc_srchtitle]
shaunaksinha
on 29 Jun 2017
Why do we have this:
snr = sigp-5;
in the code. Seems like we are subtracting the given snr from the signal power. Not sure why this makes sense. Could somebody kindly explain this please?
Mustafa qays
on 14 Nov 2017
The calculation is correct but the variable names need to be corrected
Signal to noise ratio SNR = sigp/noise_p (in ratio)
or
SNR = sigp - noise_p (in dB)
=>
noise_p(dB) = sigp - SNR , SNR = 5 dB
noise_p(db) = sigp - 5
noise_p = 10^(noise_p(db)/10)
So , (snr) in his equation should be written as noise power in the last section of code
Mrutyunjaya Hiremath
on 13 Sep 2020
Meaningful Explanation
philip
on 11 Oct 2023
0 votes
x = cos(pi/4*(0:99));
y = awgn(x,5,'measured');
Categories
Find more on Propagation and Channel Models in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!