18

I have a wireless communication system that I am simulating in Matlab. I am performing some watermarking through slightly adjusting the phase of the transmitted signal. My simulation takes the original I (inphase) and Q (quadrature) values and adds in the watermark. I then have to simulate the resulting bit error rate after being transmitted. For now I just need to add varying amounts of thermal noise to the signal.

Since I have the signal represented as its I and Q channel it would be easiest to add AWGN(additive white Gaussian noise) to the I and Q directly. One thought was to add noise to both channels independently, but my intuition tells me that this isn't the same as adding it to the signal as a whole.

So how can I add noise to it when it is in this form?

bjou
  • 336
  • 2
  • 13
Kellenjb
  • 1,103
  • 1
  • 11
  • 19
  • perhaps it could be of more help if you could give some details of the communication system you are simulating. – Rajesh D Aug 18 '11 at 13:38
  • 1
    I would assume you just generate noise for both I and Q and then add them. I don't see why the noise would be correlated between the two. – endolith Aug 18 '11 at 13:52
  • 1
    @endolith, The noise difference would only appear in the mixer, besides that they should share their noise signals. – Kortuk Aug 18 '11 at 14:07
  • Are you saying that you would to add it to the quadrature multiplexed signal? – Phonon Aug 18 '11 at 14:11
  • @phonon, what do you mean by multiplexed? – Kortuk Aug 18 '11 at 14:31
  • @Kortuk: Why would they share their noise signals? The noise is added to the signal before splitting into I and Q components, no? – endolith Aug 18 '11 at 22:13
  • @endolith, the signal is going to pick up most of its noise during the signal chain and source. I base this on varying amounts of thermal noise and calling it a "communication system". The mixer will add a tiny bit more noise, but I would assume it is a smaller source of thermal noise and will have phase error issues instead. – Kortuk Aug 18 '11 at 22:47
  • 1
    @Kortuk is right. The noise between I and Q are in fact correlated. You have a signal, add noise, and THEN project it onto I and Q. Now, the original noise component is multiplied by a sin in one branch, as the original noise is multiplied by a cosine in the other. – Spacey Sep 26 '11 at 23:06

3 Answers3

15

Yes, you can add AWGN of variance $\sigma^2$ separately to each of the two terms, because the sum of two Gaussians is also a Gaussian and their variances add up. This will have the same effect as adding an AWGN of variance $2\sigma^2$ to the original signal. Here's some more explanation if you're interested.

An analytic signal $x(t)=a(t)\sin\left(2\pi f t + \varphi(t)\right)$ can be written in its in-phase and quadrature components as

$$x(t)=I(t)\sin(2\pi ft) + Q(t)\cos(2\pi ft)$$

where $I(t)=a(t)\cos(\varphi(t))$ and $Q(t)=a(t)\sin(\varphi(t))$. If you wish to add AWGN to your original signal as $x(t)+u(t)$, where $u(t)\sim\mathcal{N}(\mu,\sigma^2)$, then you can add AWGN to each of the terms as

$$y_1(t)=\left[I(t)\sin(2\pi ft) + v(t)\right] + \left[Q(t)\cos(2\pi ft) + w(t)\right]$$

where $v(t), w(t)\sim\mathcal{N}(\mu/2,\sigma^2/2)$

Also note that because the in-phase and quadrature terms are additive, the AWGN can also be simply added to either of the two terms in the $IQ$ representation of $x(t)$ above. In otherwords,

$$y_2=I(t)\sin(2\pi ft) + \left[Q(t)\cos(2\pi ft) + u(t)\right]$$ $$y_3=\left[I(t)\sin(2\pi ft) +u(t)\right]+ Q(t)\cos(2\pi ft)$$

are statistically equivalent to $y_1$, although I prefer using $y_1$ because I don't have to keep track of which component has noise added to it.

Lorem Ipsum
  • 5,944
  • 3
  • 34
  • 42
  • Since the signal has the noise it seems the noise would show up on both channels with the original magnitude but affected by the mixing process. I would think that the mixing process would affect the noise much more then addition of subtraction by splitting the signal. – Kortuk Aug 18 '11 at 14:34
  • 1
    Of course, if you had noise in the signal to begin with and then split it into its I-Q components, each will have noise associated with it. However, OP is talking about simulating it in MATLAB and he has the I and Q parts separately and wants to know how to add noise to these so as to simulate adding noise to the original signal. – Lorem Ipsum Aug 18 '11 at 14:42
  • good answer with lots of details, but fails to concisely answer the basic question -- OP: Ignore your intuition; adding WGN on the real axis with WGN on the imaginary axis results in complex WGN. Remember to scale by 3dB since variance of sum is double that of parts (stdv2 = 1.413 stdv1 ) – Mark Borgerding Aug 18 '11 at 14:46
  • @MarkBorgerding Care to explain how it does not answer the question? I believe I've answered it exactly. What you've said in your comment above is exactly what I've shown in my answer, except that you're using an exponential notation where the quadrature is on the imaginary axis and the Gaussian is complex. – Lorem Ipsum Aug 18 '11 at 14:52
  • 2
    @Yoda, you've got all the data, but you make the reader read through many equations before getting to the answer. I merely suggest putting your bolded part first, then provide the supporting details. – Mark Borgerding Aug 18 '11 at 14:55
  • @MarkBorgerding Thanks for the advice. I've re-ordered it to bring the message up top. `@Kellenjb, I had a small typo that I fixed. Please see the revised version. – Lorem Ipsum Aug 18 '11 at 15:12
  • 1
    @yoda, I was tired when I read this. Your answer is very astute. Thank you for taking the time! – Kortuk Aug 18 '11 at 19:26
  • @yoda I think the OP wants to reflect the actuality of the system, that is why wants to confirm his intuition. For his sim, the right way would be to have one noise vector, and then project to I and Q separately, not add two independent noise components. – Spacey Sep 26 '11 at 23:09
  • @Mohammad Since the noise is stochastic, there is no guarantee that both channels will have the exact same process. All we can do is say that they're the same statistically and indeed, $v(t)$ and $w(t)$ are the same in a statistical sense. – Lorem Ipsum Sep 26 '11 at 23:44
  • Umm... it is not accurate to say that both branches have gaussian noise to begin with. There was a signal + noise, and then this was projected onto sin and a cos basis. So result is I will have say, (signal + noise)sin and Q is (signal + noise)cos.

    Are you saying you can model a gaussian*sin the same as a gaussian?

    – Spacey Sep 27 '11 at 03:52
  • @Mohammad Umm... the OP clearly said that it is Gaussian, hence the name AWGN. Do not put words into my mouth... I never said the last statement. As for the rest, please see the second comment under the answer (my reply to Kortuk) – Lorem Ipsum Sep 27 '11 at 04:06
  • @yoda No one is putting words in your mouth. OP is asking for the best way to simulate noise in I and Q given a wireless set up. The noise is AWGN at the receiver. One noise vector. After this, it is projected on both sin and cos basis. Now its no longer white. In fact both noise vectors of I and Q are heavily correlated. (They originated from the same noise vector). A quick&dirty way to simulate it would be to simply add two independent AWGN noise vectors, yes, but this is not the true representation of reality. – Spacey Sep 27 '11 at 04:38
  • @Mohammad I think the OP wanted to know how to add noise to I and Q such that the net result is signal + AWGN. If you add AWGN*sin to each component, then the resulting noise won't be white. So, I'm not really sure I follow you entirely. Please feel free to add an answer if mine is incorrect. – Lorem Ipsum Sep 27 '11 at 04:47
9

Kellenjb has not responded to queries from Rajesh D and endolith, and it is not easy to figure out what exactly he needs. But since I disagree with some of the details of the Answers given by yoda and Mohammad, I am posting a separate answer, where, with due apologies to Mark Borgerding, all the useful stuff appears at the very end after all the boring equations.

In a typical communication system, the incoming signal is a bandpass signal of bandwidth $2B$ at center frequency $f_c \gg B$ Hz and can be expressed as $$ r(t) = I(t) \cos(2\pi f_c t) - Q(t) \sin(2\pi f_c t) $$ where $I(t)$ and $Q(t)$ are low-pass signals of bandwidth $B$ Hz and are referred to as the in-phase and quadrature components. Note the difference in signs and terminology from yoda'a writing: this way we can write $$r(t) = \text{Re}\left\{ [I(t) + jQ(t)] e^{j2\pi f_c t}\right\}$$ where $I(t) + jQ(t)$ is the complex baseband signal.

A local oscillator in the receiver generates signals $2\cos(2\pi f_c t + \theta)$ and $-2\sin(2\pi f_c t + \theta)$ but we assume perfect synchronization for simplicity so that the phase error $\theta = 0$. $I(t)$ and $Q(t)$ are recovered through two mixers (multipliers) and low-pass filters: $$ \begin{align*} r(t)[2\cos(2\pi f_c t)] &= I(t)[2\cos^2(2\pi f_c t)] - Q(t)[2\sin(2\pi f_c t)\cos(2\pi f_c t)]\\ &= I(t) + \left [ I(t) \cos(2\pi (2f_c)t) - Q(t) \sin(2\pi (2f_c) t) \right ]\\ r(t)[-2\sin(2\pi f_c t)] &= I(t)[-2\sin(2\pi f_c t)\cos(2\pi f_c t)] + Q(t)[2\sin^2(2\pi f_c t)]\\ &= Q(t) + \left [ - I(t) \sin(2\pi (2f_c)t) - Q(t) \cos(2\pi (2f_c) t) \right ] \end{align*} $$ where the double frequency terms (in square brackets) are eliminated by the low-pass filters which we assume to have sufficient bandwidth to pass $I(t)$ and $Q(t)$ without distortion.

Broadband noise is present in the front end of the receiver and the key questions that need to be answered are what happens in an actual receiver, and what must be done to simulate the reality.

  • In an actual system, the net result is that the outputs of the low-pass filters are $$ \begin{align*} x(t) &= I(t) + N_I(t)\\ y(t) &= Q(t) + N_Q(t) \end{align*} $$ where $N_I(t)$ and $N_Q(t)$ are independent zero-mean Gaussian random processes with common variance $$ \sigma^2 = \frac{N_0}{2}\int_{-\infty}^\infty \vert H(f) \vert^2 \mathrm df $$ where $H(f)$ is the common transfer function of the low pass filters. In particular, for each $t_0$, $N_I(t_0)$ and $N_Q(t_0)$ are independent zero-mean Gaussian random variables with variance $\sigma^2$. However, $N_I(t_0)$ and $N_I(t_1)$ need not be independent. The SNR can be taken to be the ratio of the signal power in $I(t)$ and $Q(t)$ to the noise variance.
  • In a quadrature down-sampling system or in a MATLAB simulation wishing to capture every nuance, "$r(t) + ~$ noise" is sampled $M$ times each cycle of the RF carrier at $f_c$ Hz, and so the $m$-th sample is $$ \begin{align*} r[m] &= r(m/Mf_c) + N[m]\\ &= I(m/Mf_c)\cos(2\pi (m/M)) - Q(m/Mf_c)\sin(2\pi(m/M)) + N[m] \end{align*} $$ where the $N[m]$'s zero-mean Gaussian random variables with common variance whose value depends on the SNR. These can be tracked through the mixers and the low-pass filters during the detailed simulation.
  • I do not recommend adding noise between the mixer outputs and the low-pass filter units. While there is noise introduced at that stage, this is typically overwhelmed by the noise from the front end that is coming through the mixers.
  • In some systems, A/D conversion is done at the output of the low pass filters. If more filtering is to be done (e.g. matched filtering), the sampling will typically be at a higher rate than $B^{-1}$ or the inverse of the filter bandwidth. If noise is introduced at this stage, then for each $m$, $N_I[m]$ and $N_Q[m]$ should be taken to be independent zero-mean Gaussian random variables, but whether $N_I[m]$ and $N_I[m+i]$ are independent or not requires a lot of thought and analysis, and details that are known to Kellenjb but not to us.
Dilip Sarwate
  • 20,349
  • 4
  • 48
  • 94
-1

Kellenjb,

The noise in both the I and Q are not in fact going to be gaussian. In fact they are going to originate from the same original noise vector. This is because there was only one noise vector to begin with at the receiver. So what is happening, is your signal comes into the receiver, where AWGN is added of course. Soon afterwards though, the receiver is going to project that (signal + noise) onto a sin basis, and onto a cosine basis, thereby giving you your I and Q components.

So now the noise in either branch is no longer gaussian, but are in fact, the product of a sin basis times orignal noise vector, and product of cosine basis times original noise vector.

The way I would recommend to simulate this, (are you doing all of this in baseband?), is to simply construct a sin and cosine basis, and simply multiply against (signal+noise), where 'signal' is your original signal of course, and then of course take it down to baseband after that. In fact once you filter for taking it down to baseband, your noise vectors are going to be non-white, and non-gaussian.

Hope this helps! :)

Spacey
  • 9,817
  • 8
  • 43
  • 79