Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Error rate in AWGN: why mean=0, variance = No/2 ?

Status
Not open for further replies.

mazdaspring

Advanced Member level 4
Joined
Feb 18, 2008
Messages
108
Helped
4
Reputation
8
Reaction score
3
Trophy points
1,298
Activity points
2,030
I am trying to understand how to do matlab on error rate in AWGN. However I am not clear on some parts below.

1 Why mean is 0 and why variance=No/2 where are they from? is it theory or what?

And I need to add noise to the signal. What is the noise equation in theory and how do you write
noise equation in matlab.

Thank you.
 

puripong

Member level 2
Joined
Sep 21, 2009
Messages
43
Helped
1
Reputation
6
Reaction score
0
Trophy points
1,286
Activity points
1,484
AWGN is additive white Gaussian noise.
Its mean is zero according to Gaussian distribution.

No/2 is noise power
I'm not sure about actual meaning of No/2 but I think
the power of real signal spreads over negative and positive frequency.
So, No/2 stands for two-sided power spectral density.


In Matab,
function randn is used to generate Gaussian distributed random value with zero mean and unit variance
 
Last edited:

mazdaspring

Advanced Member level 4
Joined
Feb 18, 2008
Messages
108
Helped
4
Reputation
8
Reaction score
3
Trophy points
1,298
Activity points
2,030
In Matab,
function randn is used to generate Gaussian distributed random value with zero mean and unit variance

Thank you so much. That's quite clear to me. Can you explain to me further please. what different between rand and randn?
So when I do matlab for AWGN I have to use randn instead of rand?

Also...I see some people's code....their noise in matlab is 1/(squareroot2 x [rand(1,N)+j randn(1,N)])
where is this come from? and why in the [] ....real value use rand and imaginary use randn?

Thank you so much in advance.
 

puripong

Member level 2
Joined
Sep 21, 2009
Messages
43
Helped
1
Reputation
6
Reaction score
0
Trophy points
1,286
Activity points
1,484
Function rand is used to generate uniformly-distributed random values
whereas function randn is for Gaussian-distributed random values.

I think this term [rand(1,N)+j randn(1,N)]) is complex Gaussian random value
So the variance (you may think it as power) of its is equal to 2

In matlab, you can easily check variance of variable X
X = randn(1,N)
by typing
var(X)

If N is large, var(X) is aprrox. 1

and then you can further check the var(X+Y) = 2
where X = randn(1,N) and Y = randn(1,N)

To normalize energy of [rand(1,N)+j randn(1,N)]) to 1, we simply multiply with 1/sqrt(2)

Hope this helps
 

ninju

Full Member level 3
Joined
May 14, 2011
Messages
189
Helped
49
Reputation
98
Reaction score
48
Trophy points
1,308
Activity points
2,398
randn produces all positive numbers. So, it can not be 0 mean.

to add awgn to a signal, use awgn(signal, snr);

or, add this:

r = a + (b-a).*rand(100,1);
 

Max Planck

Junior Member level 3
Joined
Aug 17, 2010
Messages
29
Helped
7
Reputation
14
Reaction score
7
Trophy points
1,283
Location
Kalisz
Activity points
1,430
Can you explain to me further please. what different between rand and randn?
The difference concerns distributions of random variables generated by these functions. rand() generates random elements with unit distribution whereas randn() with normal distribution.
 

mazdaspring

Advanced Member level 4
Joined
Feb 18, 2008
Messages
108
Helped
4
Reputation
8
Reaction score
3
Trophy points
1,298
Activity points
2,030
randn produces all positive numbers. So, it can not be 0 mean.

to add awgn to a signal, use awgn(signal, snr);

or, add this:

r = a + (b-a).*rand(100,1);

What is a and b?

By the way, thank you for all of you. I understand it now about rand, randn
 

ninju

Full Member level 3
Joined
May 14, 2011
Messages
189
Helped
49
Reputation
98
Reaction score
48
Trophy points
1,308
Activity points
2,398
sorry,

a is the lower limit and b isthe upper limit of the numbers you expect.
 

prank

Newbie level 4
Joined
Oct 13, 2010
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,300
friends can you tell me about what is real valued gaussian distribution noise ??. and how can it be generated
 

in8214

Newbie level 4
Joined
Jul 20, 2009
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
UK
Activity points
1,345
Hi Prank
Say you want to add gaussain on the following 10 bits of BPSK modulated data

ModulatedData= randint(1,10,[1 0]);

And Say EbNo= 4dB
this is how you can calculated Real and Img part of noise

EbNo_lin=10.^(EbNo/10); % Calculate Linear value of EbNo

No= 1/EbNo_lin; %Calculate Noise Power Assuming Eb=1

NI=sqrt(No/2)*randn(1,length(ModulatedData));
NQ=sqrt(No/2)*randn(1,length(ModulatedData));
N=NI+j*NQ ; %Generate complex AWGN
 

Ahmed Alaa

Full Member level 5
Joined
Jul 22, 2009
Messages
317
Helped
61
Reputation
136
Reaction score
44
Trophy points
1,318
Location
Egypt
Activity points
2,968
No is the noise power density over a BW B, and because noise spectrum is in the +ve and -ve frequencies the amplitude is No/2 in a double-sided spectrum. Zero mean comes from the fact that all noise samples are independent and the whole noise signal is uncorrelated, so the noise signal isn't biased neither to the + nor - amplitudes.
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top