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: Mon, 10 Sep 2007 14:05:35 +0000 (UTC)
Organization: Pretoria University
Lines: 107
Message-ID: <fc3ivf$c70$1@fred.mathworks.com>
References: <fbgpiv$c8k$1@fred.mathworks.com> <1189430911.786415.145550@g4g2000hsf.googlegroups.com>
Reply-To: "Hugo Human" <s24093905@hotmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1189433135 12512 172.30.248.38 (10 Sep 2007 14:05:35 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 10 Sep 2007 14:05:35 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1104218
Xref: news.mathworks.com comp.soft-sys.matlab:427691


 Randy Poe <poespam-trap@yahoo.com> wrote in message 
<1189430911.786415.145550@g4g2000hsf.googlegroups.com>...
> On Sep 10, 8:39 am, "Hugo Human" <s24093...@hotmail.com> 
wrote:
> >  Krishna <krishna.pil...@gmail.com> wrote in message
> >
> > 
<1189391762.667749.208...@50g2000hsm.googlegroups.com>...
> >
> >
> >
> > > On Sep 10, 1:06 am, "Hugo Human" 
<s24093...@hotmail.com>
> > wrote:
> > > > Not really ...
> > > > Let's use an example... plz.
> > > > If I have a signal:
> > > > x = 1*exp(i*2*pi*freq1*t + phase1); % in volts
> >
> > > > Now, how do I add noise to this signal ???
> > > > The power of a sinusoid like this is 0.5, right ???
> >
> > > No. The power of the complex sinusoidal which you 
stated
> > above is 1
> > > (and not 0.5). A quick check
> > > trying to plug in some numbers:
> > > x = 1*exp(i*2*pi*2*[0:1/100:1]+0);
> > > xPower = x*x'/length(x);
> > > xPower =
> >
> > >      1
> >
> > > > Should SNR = 10*log(1/var) OR
> > > > SNR = 10*log(0.5/var)
> > > > or how ?
> >
> > > Based on your signal power, you can scale your noise
> > power. For the
> > > complex exponential, I think the former
> > > SNR = 10*log(1/var) is pertinent.
> >
> > > HTH,
> > > Krishna
> > >http://dsplog.blogspot.com
> >
> > First of ... Thanks for all your help this far ^_^
> >
> > Second: This "scaling" factor (noise std, sqrt(var)), 
how
> > do I scale this with the signal power of 1, and then 
add
> > this to the signal for different SNRs... what I mean is
> 
> I may have missed it, but I don't see anyone using 
complex
> AWGN to add to your signal.
> 
>   N = n0 * complex( randn(m,1), randn(m,1) );
> 
> will give you m samples of complex white gaussian noise
> of power 2*n0^2.
> 
> > SNR = 10; % dB
> > x = 1*exp(i*2*pi*f*[0:1/100:1]+0); % Signal with power 
1
> > noise_var = 10^(-SNR/10);
> > noise_std = sqrt(noise_var)
> > awgn = randn(1,N)*noise_std;
> 
> So I would use
> 
> awgn = complex( randn(1, N), randn(1, N) ) * 
noise_std/sqrt(2);
> 
> > Do I now go :
> > x = x + awgn;
> 
> Yes.
> 
> But the awgn above is pure real, and the imaginary
> component of your signal will be noise-free.
> 
> > OR
> > x = x + (awgn/sqrt(2));
> > ???
> > I see some people add the sqrt(2), I don't know what
> > that's for ???
> 
> If you saw it, it is because some people (unlike what I 
said)
> were indeed using complex noise, which is a sum of two
> independent noise processes, one real and one imaginary,
> each of which has power noise_var. So the total noise
> power is 2*noise_var.  The sqrt(2) divides the power of
> each of these two noise channels in half, so that their
> total is the desired noise power.
> 
>                 - Randy
> 


Omg, what a stupid mistake !!! Sorry, I didn't even think 
of the imaginary parts ! I kninda forgot. Sorry, i'm still 
new with this.

Thanks for your help ^_^