1
$\begingroup$

I am trying to simulate an optical wireless communication channel which uses OOK modulation.

Looking at equation 14 in this literature, I found that:

For electrical SNR at the receiver

$$\textrm{BER}=Q\left(\sqrt{\rm SNR}\right)$$

where (according to this page)

$$Q(z)=\frac{1}{2} \text{erfc}\left(\frac{z}{\sqrt{2}}\right)$$

Please note that:

electrical signal-to-noise ratio is proportional to the square of the received optical power Pr.

Next, I implemented $Q(z)$ as follows:

getOokBer (double snr){
    double ber = 0.5 * erfc (std::sqrt (snr/2));
    return ber;
}

At this point I got stuck. I think the next step is to calculate $P_\rm e$ and/or $P_{\rm err}$ which has been discussed here too.

In this paper $P_\rm e$ is given as:

$P_{\rm e}(k, l)$ -- function that represents an upper bound on the probability that an error is present in the chunk of bits located in interval $l$ for packet $k$.

I found the following implementation for $\rm BER$ calculations which takes $\rm SNR$ in mW. It is not clear to me whether the SNR given in the first equation above is for log scale or linear scale.

All in all, I would like to know how to calculate $P_\rm e$ and $P_{\rm err}$ for OOK?

$\endgroup$
  • $\begingroup$ It seems like you have the information you need. you should be using linear scale in all of your calculations. Also, SNR should not be measured in mW; it should be unitless. $\endgroup$ – Jason R Sep 9 '16 at 13:54
  • $\begingroup$ @JasonR well, I have the ingredients but not the recipe $\endgroup$ – Kristof Tak Sep 10 '16 at 11:18
2
+50
$\begingroup$

It is not clear whether you want a derivation of the formula for the error probability of a wireless OOK system, or ideas about how the formula might apply to an optical communication system.

For a wireless OOK system, there are two main types of receivers called coherent receivers and noncoherent receivers and these have different error probabilities. Neither error probability formula is suitable for application to an optical communication system.

Wireless OOK: The wireless OOK system model is that if a $1$ has to be be transmitted, the transmitted signal is an RF pulse of duration $T$ (the ON part of the keying) while if a $0$ has to be transmitted, then no signal is transmitted (the OFF part of the keying). Assuming no signal distortion in the channel, then in the interval $0 \leq t \leq T$, the receiver input can be expressed as $$r(t) = \begin{cases} A \cos(2\pi f_c t+\theta) + n(t), & 1 ~~\text{transmitted},\\ n(t), & 0 ~~\text{transmitted}, \end{cases} \tag{1}$$ where $n(t)$ is white Gaussian noise (with two-sided power spectral density $\frac{N_0}{2}$) that is independent of the signal and whether $1$ or $0$ is transmitted. It is generally assumed that $1$ and $0$ are equally likely to be transmitted.

Coherent receiver: A coherent receiver know the exact value of the carrier frequency $f_c$, the received phase $\theta$ and the signal timing, that is, it knows both the duration and location of the pulse on the time axis. To understand how it knows all this will take us too far away from this discussion. The receiver constructs the signal $s(t) = \cos(2\pi f_ct+\theta)$ in a local oscillator and then correlates this locally generated signal with $r(t)$, that is, it computes $$X = \int_0^T r(t) s(t)\ \mathrm dt = \begin{cases}\frac{AT}{2} + N, &1 ~~\text{transmitted},\\ N, & 0 ~~\text{transmitted},\end{cases} \tag{2}$$ where $N$ is a zero-mean Gaussian random variable with variance $\frac{N_0T}{4}$. The receiver compares $X$ with the threshold $\Theta = \frac{AT}{4}$ and decides at a $1$ or $0$ is transmitted according $X$ is larger than or smaller than the threshold. The probability of an erroneous decision when a $0$ is transmitted is $P\{N > \Theta\}$, the probability that $N$ exceeds $\Theta$, while the probability of an erroneous decision when a $1$ is transmitted is $P\{N < -\Theta\}$ which is the same as $P\{N > \Theta\}$ We readily get that $$P_e = P\{N > \Theta\} = Q\left(\frac{AT}{4\sqrt{N_0T/4}}\right) = Q\left(\sqrt{\frac{A^2T}{4N_0}}\right) \tag{3}$$ where $Q(z)$ is area under the right tail of the standard Gaussian density to the right of $z$. It is, I believe, built in to MATLAB's library; no need to fool around with erf or erfc.

It is possible to massage the right side of $(3)$ a little to give a different perspective on the matter. Note that $E_b$, the received signal energy per bit is $\frac{A^2T}{4}$ (because for half of the transmitted bits, there is no signal energy received). Thus, we can re-write the right side of $(3)$ as $$P_e = Q\left(\sqrt{\frac{E_b}{N_0}}\right)$$ which expression might be familiar to some readers.

Noncoherent receivers: Coherent receivers for OOK are difficult to implement because the estimation of the RF phase $\theta$ is not easy when the incoming signal (from which the phase is estimated) keeps disappearing from time to time. A noncoherent receiver is easier to implement, and is sometimes referred to as a square law detector because the earlier implementations merely measured the passband energy and decided on $0$ or $1$ according as this energy is small or large. More modern methods use I-Q signals, but regardless of the method, the analysis is messy. The error probability expressions involve things like Marcum's Q function which those knowledgeable about radar will likely know. It is best to hide this stuff behind a veil.

Optical OOK communication: This is completely different and the system model is quite different. In particular, in contrast to coherent wireless OOK communications, the probability of error when a $1$ is transmitted is quite different from the error probability when a $0$ is transmitted. Indeed, most of the errors are mistaking $1$'s for $0$'s, and it is hardly ever the case that a $0$ is mistaken for $1$. The reason is that the detector is essentially a photon counter which can fail to detect a photon sometimes, but hardly ever sees photons where none exist. As such, for the OP's simulation of an optical communication system, the results from the analysis of wireless RF communication systems are totally inapplicable.

$\endgroup$
2
$\begingroup$

I don't know about optical, but I can give an electrical interpretation. In a noiseless OOK system, for each transmitted bit, the receiver will get either $P_r$ or 0. When you add AWGN, the numbers become $P_r+n$ and $n$, where $n$ is a sample of a Gaussian random variable with zero mean and variance $\sigma^2$.

Consider transmission of a 0. There will be a bit error if the received number, $n$, is larger than $Pr/2$. The probability that $n>P_r/2$ is given by $$P(n>P_r/2)=Q\left(\frac{P_r}{2\sigma}\right).$$

By symmetry, the same equation applies for the transmission of a bit 1 and then we can say that $$\text{BER}=Q\left(\frac{P_r}{2\sigma}\right).$$

$\endgroup$
  • $\begingroup$ what would be the Pe then? Referring to the Pe from cutebugs.net/files/wns2-yans.pdf (function that represents an upper bound on the probability that an error is present in the chunk of bits located in interval l for packet k.) $\endgroup$ – Kristof Tak Sep 9 '16 at 16:49
  • 1
    $\begingroup$ BER refers to the probability of any particular bit being in error. Extrapolating this to a packet level can be done via simple combinatorics and probability theory (after making assumptions on the distribution of the error positions). $\endgroup$ – Jason R Sep 9 '16 at 17:16
  • $\begingroup$ Have you read reference [16] from the paper you linked? Note that, if you know the probability of a single bit being in error, you can easily find the probability that $a$ out of $k$ bits are in error (assuming that the bits are independent). $\endgroup$ – MBaz Sep 9 '16 at 17:19
  • $\begingroup$ No I hadn't, thanks for pointing out. But I still don't think I could figure that out, otherwise wouldn't ask. $\endgroup$ – Kristof Tak Sep 9 '16 at 18:17
2
$\begingroup$

It seems that you have no clue about digital communications. My understanding is that you have figured out the probability of bit error as $$P_b=\sqrt{\mathsf{SNR}}$$ Now you want to calculate the probability of block error $P_{\text{block error}}$. I suppose you are clear of why $P_b=\sqrt{\mathsf{SNR}}$ and how $\mathsf{SNR}$ is defined. For clarity, $\mathsf{SNR}$ is the ratio of the square of the received signal power to the noise variance and is dimensionless (i.e. has no units). You should use it in natural scale when plugging it in the BER formula.

Now how to calculate $P_{\text{block error}}$:

Assume you have a block length $L$ (that is, you send $L$ bits). For simplicity it is sometimes easier to calculate the probability of correct reception of the whole block at first. The probability of block error is then equal to one minus the probability of success. It happens when all bits are received correctly. Hence, $$P_{\text{block success}}=(1-P_b)^L.$$ Therefore, $$P_{\text{block error}}=1-(1-P_b)^L$$ Note however, this is for the case without using any forward error correction (FEC) code. In case if you use an FEC code, among the bits of a block you can have some errors and get the block successfully delivered as long as the code can correct those errors. So you need to take this probability into account.

As an example, assume a binary linear block code $[n,k,t]$ is used. In such a case, blocks of length $k$ of message are mapped to codewords of length $n$ and the code can correct up to $t$ errors. The FEC code can give you the correct message at the receiver if

  • there is no error,
  • or there is one error only,
  • or there is two errors only,
  • or ...
  • or there is $t$ error only.

This can be written as $$P_{\text{block success}}=\sum_{i=0}^{t}\binom{n}{i}P_b^i(1-P_b)^{n-i}$$ and therefore, $$P_{\text{block error}}=1-\sum_{i=0}^{t}\binom{n}{i}P_b^i(1-P_b)^{n-i}$$

In case if any other code you want to use, you should follow the same approach, however, the calculation of block error probability will be different across various codes.


PS: The derivation of $P_{\text{block success}}$ in the above example is simplified.

$\endgroup$
  • $\begingroup$ I definitely have no clue about anything low layer, including digital communications. But I know what SNR is :P. Feel free to provide some pointers if you don't mind. Btw what's "natural scale"? $\endgroup$ – Kristof Tak Sep 12 '16 at 13:28
  • 1
    $\begingroup$ @KristofTak I was not sure if I need to elaborate so presumed no clue :) Indeed, SNR is the most confusing part sometimes... Natural (= not dB). Also I suggest you assume a system model with clear understanding of the underlying blocks before analytical modeling. Otherwise, you will get stuck between various models in different references. A block diagram would be enough. Then you can easily look up the performance of each individual block. $\endgroup$ – msm Sep 12 '16 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.