# How to explain this BER vs SNR behaviour?

I wrote a script in MATLAB to simulate an LDPC created using an algorithm of a colleague of mine. The parity check-matrix is regular and has dimensions $1012 \times 1518$ and the code rate is $R=1/3$.

The channel I'm using is a BPSK one with added Gaussian white noise. The mapping of the bits I used were the values $-1$ and $1$. The decoding method is sum-product (or belief propagation).

To perform the simulation, I used as a guide the Example 2.6 in the 36th page of this paper. I'm getting this curve: This is really different from what I would have expected. The fact that the function is no monotonically decreasing was very shocking. Also, the fact that there is a BER of approximately $1$ for a positive SNR doesn't make any sense to me.

I'm thinking that, maybe, what is wrong is how I defined the a priori LLRs or the SNR. Given that I used $E_b = 1$ to map the bits, then I used some formulas from the section 3.2 of this paper:

$$R\cdot E_b = E_s$$ $$N_0 = 2\sigma^2$$

So, using the formula mentioned in the Example 2.6 of the first paper, we get that

$$r_i = 4y_iR\frac{E_b}{N_0}$$

I believe that this weird behaviour is coming from that formula, maybe a difference of definitions between the two papers that I didn't take into account. I don't really know, what do you think is the reason of the function having that shape?

Extra info:

• The SNR axis in the plot corresponds to $R\frac{E_b}{N_0}.$
• I've read here a question that could solve my problem, but I'm not sure if it applies directly. Here, I don't have any information about the data bit rate that is mentioned in that question. I don't really know what that quantity they call $R_b$ stands for, either.

In a BPSK system, the SNR at the output of the receiver's matched filter is $$\text{SNR}=\frac{E_b}{\sigma^2_n}.$$ In this formula, $E_b$ is the energy used to transmit one bit, and $\sigma_n^2$ is the power of the noise at the filter output.

Assuming an AWGN channel, the noise process at the filter input has constant PSD; this value is usually denoted $N_0/2$. The Wiener-Khinchine theorem relates the PSD and $\sigma_n^2$: $$\sigma_n^2=\frac{N_0}2,$$ so the SNR may be written as $$\text{SNR}=\frac{2E_b}{N_0}.$$

Note that the convention is to plot the bit error rate vs $E_b/N_0$ (note the missing $2$ in the numerator). The reason is that for quadrature systems, the total noise power in the receiver is $N_0$.

In a coded system, each information bit is transmitted using several coded bits. For example, a Hamming (7,4) code uses 7 coded bits to transmit 4 information bits; the code rate is $R=4/7$. In gneral, $R=k/n$, for a code that transmits $k$ information bits using $n$ coded bits.

To make a fair comparison between different codes, we usually keep $E_b$ constant. This means that the energy of each code bit depends on the code rate: $$E_c=RE_b,$$ or $E_b=E_c/R$.

In simulation, it is often convenient to set $E_c=1$. Then, we have $$\frac{E_b}{N_0}=\frac{E_b}{2\sigma_n^2}=\frac{E_c}{2R\sigma_n^2}=\frac{1} {2R\sigma_n^2}.$$

• Thanks for your answer. Would in this case $E_b = 1$, as that is the value I used to map the bits? Also, what about the sentence in the 15th page of this article where it is stated that $E_b/N_0 = 1/(2R\sigma^2)$? Is that wrong then? – Tendero Dec 27 '16 at 15:25
• @Tendero Please see my edit. – MBaz Dec 27 '16 at 18:11
• Great, thank you. However, even applying this to my case, the curve is still the same. Do you have any idea of what could be happening? (I can post my script if that helps) – Tendero Dec 27 '16 at 18:22
• @Tendero What is the value of $R$ in your simulation? – MBaz Dec 27 '16 at 18:32
• $R = 1/3$. I'm using the algorithm described in this paper. – Tendero Dec 27 '16 at 18:34