Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

adding white gaussian noise to correlation without awgn [C]

Status
Not open for further replies.

DeliriumCordia

Newbie level 2
Joined
Oct 5, 2012
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,285
Hi everybody guys, I'm writing a signal processing software using C, so I'm a little bit "stuck".

I generated a triangular sampled signal. I need to add white gaussian noise to it at a certain SNR.

I calculated the power of autocorrelation as:
\[\frac{1}{N}\sum_{i=0}^{N-1}x^{2}\]

and then divided each element of the array with the sqrt of this power. So now the power of signal is 1.

Is conceptually right?

Then I generated a random array with 0 mean and 1 std.dev using Box Muller transformation. This has to become my noise array.

So I decided to make the same operation as above, to bring it to power 1. Then, I know that:

\[SNR_{dB}=\frac{Spower}{Npower}\] \[\Rightarrow\] \[ Npower=\frac{Spower}{10^{\frac{SNR}{10}}}\], with Spower=1.

Then I multiply each element of noise vector with the sqrt of this number.

The noisy correlation is the sum of this new vector and autocorrelated sampled vector.

Does it seems you legit? I made some conceptual error?
 

There's something wrong with the formula I used to introduce noise on my sequence:
obviously, talking about a autocorrelation of rectangular sequences, it has to be a triangle: the central sample should be > of left and right neighbours, so I decided to plot the probability that central sample is > of its neighbours varying SNR.

snrdb.png

It's clear that SNR must be too high: before 40dB I have pure noise, because 33% of Probability that central sample is > of other two samples means that I have a pure random sequence...
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top