# Adding white noise to complex signal (complex envelope)

Good day everyone.

So, i run in to trouble - how to add white noise to signal samples? For now i'm working with MSK signal - quadrature modulator and quadrature demodulator + viterbi processor. My signal samples at TX and RX side represents Q and I signals of modulator(real and complex part of the signal). Model works nice in ideal situation, without any noise and other interference.

So, i'm working with complex envelope of the MSK signal with amplitude equal to one. Currently,i would like to test my demodulator with some noise.

It looks like, i just need to add (+) samples from my noise generator to samples of transmitted signal. But im not sure if this is correct way - should i sum both Q and I channels to one sample of noise signal or not? And i'm pretty confused how to determine signal to noise ratio after this? I would like to measure bit error ratio at some SNR points. As i read in some books changing sigma parameter of white noise generator will play a role here, but still how to determine SNR in numbers after this?

If you want a complex white noise sample with variance $N_0$, then you should generate two independent noise samples each with variance $\frac{N_0}{2}$. The two samples that you generate make up the real and imaginary parts of the desired complex noise sample. The resulting complex value will have the desired variance $N_0$. You should then sum this with your complex baseband signal to get the effect that you want.

• Still im little confused. At first i will initialize my white noise generator with mean m=0 and sigma=10 (for example). It will lead variance of generator to value N=100. So, after this i will generate two numbers from generator and this numbers will represent me real and imaginary part of complex noise sample with variance N=100+100=200. And after this i will sum my samples with my signal samples. Still confused, what SNR i will get at this point? – Araxnid May 13 '14 at 13:39
• Yes, in your example your complex noise samples would have variance 200. For zero-mean noise, its variance is equal to its average power. In order to calculate the SNR, you need to know the average signal power level. – Jason R May 13 '14 at 15:13

How do you measure the power of your signal?

You will approximate it using, $P_{x,av} = \frac{1}{K} \sum_{k=0}^{K-1} |x(k)|^2$, right! Where $x(k) = x_{I}(k) + i.x_{Q}(k)$, and $i$ denotes the imaginary part.

In order to add a noise signal, you need to add noise to I and the Q part of $x(k)$ separately. If we assume noise for I part to be $n_{I}(k)$ and for Q part to be $n_Q(k)$, then the total noise power will be $P_{n,av} = \frac{1}{N}\sum_{k=0}^{K-1} |n(k)|^2$, where $n(k) = n_{I}(k) + i.n_Q(k)$.

SNR is given as $10\log_{10}(P_{x,av}/P_{n,av})$. So, the total noise power, i.e., for the I and Q part combined for a given SNR value is $P_{n,av} = P_{x,av}10^{-SNR/10}$. You will generate one noise vector for I, i.e., add it to I part of $x(k)$ with half of the power, and another noise vector to be added to Q part of $x(k)$.

Since $x(k)$ is complex you can add noise in one go if you make the complex noise signal $n(k)$ as mentioned above. In case of Gaussian noise you use randn() function to generate noise for both I and Q parts, but do not forget to multiply each Gaussian noise component by $\sqrt{P_{n,av/2}}$.

Hint: btw MATLAB allows this, x = 1 + 1i*2, you can do n = nI + 1i*nQ, if nI and nQ are noise vectors.

• Hm, are this power values in dB? Currently i'm watching power spectrum of my noise samples to determine noise power (without signal) and get values in dB.. – Araxnid May 14 '14 at 8:18
• The power value $P_{n,av}$ are in watts. If they are in dBs you need to change them in watts. – learner May 14 '14 at 8:41