Path: news.mathworks.com!not-for-mail
From: "Hugo Human" <s24093905@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Question about SNR and noise
Date: Sat, 8 Sep 2007 21:26:39 +0000 (UTC)
Organization: Pretoria University
Lines: 45
Message-ID: <fbv42f$cl7$1@fred.mathworks.com>
References: <fbgpiv$c8k$1@fred.mathworks.com> <1188894664.473504.267470@50g2000hsm.googlegroups.com>
Reply-To: "Hugo Human" <s24093905@hotmail.com>
NNTP-Posting-Host: webapp-06-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1189286799 12967 172.30.248.36 (8 Sep 2007 21:26:39 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 8 Sep 2007 21:26:39 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1104218
Xref: news.mathworks.com comp.soft-sys.matlab:427473


 Krishna <krishna.pillai@gmail.com> wrote in message 
<1188894664.473504.267470@50g2000hsm.googlegroups.com>...
> On Sep 3, 4:01 pm, "Giovanna " 
<giovanna.casti...@jku.at> wrote:
> > Hi everybody
> > I need to add a noise signal to my output signal. The 
noise
> > characteristic are 10dB. I dont have the Communication
> > Toolbox and therefore, I cant use wgn, o awgn function.
> > How I could generate the Gaussian White noise with this
> > characteristics.
> > If someone have an idea, please let me know.
> > Cheers
> 
> help randn
> 
> and maybe the following code snippet helps.
> 
> snrdB = 10;
> sig = sqrt(2)*sin(2*pi*[0:1/64:100]);
> noise = 10^(-snrdB/20)*randn(size(sig));
> sig_plus_noise = sig + noise;
> sigPowerdB = 10*log10(sig*sig'/length(sig));
> noisePowerdB = 10*log10(noise*noise'/length(noise));
> 
> HTH,
> Krishna
> http://dsplog.blogspot.com
> 

I have never seen this :

> noise = 10^(-snrdB/20)*randn(size(sig));


As far as I know it's
noise = 10^(-snrdB/10)*randn(size(sig));
because 
SNR = 10*log(1/var);

But what I want to know is, because your signal's power is 
0.5, how does this influence your equation....
Is this why you use
SNR = 20*log(1/var);
????