## Analytical Expressions Used in berawgn Function and Bit Error Rate Analysis App

These sections cover the main analytical expressions used in the berawgn function and Bit Error Rate Analysis app.

### M-PSK

From equation 8.22 in [2],

${P}_{s}=\frac{1}{\pi }\underset{0}{\overset{\left(M-1\right)\pi /M}{\int }}\mathrm{exp}\left(-\frac{k{E}_{b}}{{N}_{0}}\frac{{\mathrm{sin}}^{2}\left[\pi /M\right]}{{\mathrm{sin}}^{2}\theta }\right)d\theta$

This expression is similar, but not strictly equal, to the exact BER (from [4] and equation 8.29 from [2]):

${P}_{b}=\frac{1}{k}\left(\sum _{i=1}^{M/2}\left({w}_{i}^{\text{'}}\right){P}_{i}\right)$

where ${w}_{i}^{\text{'}}={w}_{i}+{w}_{M-i}$, ${w}_{M/2}^{\text{'}}={w}_{M/2}$, ${w}_{i}$ is the Hamming weight of bits assigned to symbol i,

$\begin{array}{c}{P}_{i}=\frac{1}{2\pi }\underset{0}{\overset{\pi \left(1-\left(2i-1\right)/M\right)}{\int }}\mathrm{exp}\left(-\frac{k{E}_{b}}{{N}_{0}}\frac{{\mathrm{sin}}^{2}\left[\left(2i-1\right)\pi /M\right]}{{\mathrm{sin}}^{2}\theta }\right)d\theta \\ -\frac{1}{2\pi }\underset{0}{\overset{\pi \left(1-\left(2i+1\right)/M\right)}{\int }}\mathrm{exp}\left(-\frac{k{E}_{b}}{{N}_{0}}\frac{{\mathrm{sin}}^{2}\left[\left(2i+1\right)\pi /M\right]}{{\mathrm{sin}}^{2}\theta }\right)d\theta \end{array}$

For M-PSK with M = 2, specifically BPSK, this equation 5.2-57 from [1] applies:

${P}_{s}={P}_{b}=Q\left(\sqrt{\frac{2{E}_{b}}{{N}_{0}}}\right)$

For M-PSK with M = 4, specifically QPSK, these equations 5.2-59 and 5.2-62 from [1] apply:

$\begin{array}{c}{P}_{s}=2Q\left(\sqrt{\frac{2{E}_{b}}{{N}_{0}}}\right)\left[1-\frac{1}{2}Q\left(\sqrt{\frac{2{E}_{b}}{{N}_{0}}}\right)\right]\\ {P}_{b}=Q\left(\sqrt{\frac{2{E}_{b}}{{N}_{0}}}\right)\end{array}$

### DE-M-PSK

For DE-M-PSK with M = 2, specifically DE-BPSK, this equation 8.36 from [2] applies:

${P}_{s}={P}_{b}=2Q\left(\sqrt{\frac{2{E}_{b}}{{N}_{0}}}\right)-2{Q}^{2}\left(\sqrt{\frac{2{E}_{b}}{{N}_{0}}}\right)$

For DE-M-PSK with M = 4, specifically DE-QPSK, this equation 8.38 from [2] applies:

${P}_{s}=4Q\left(\sqrt{\frac{2{E}_{b}}{{N}_{0}}}\right)-8{Q}^{2}\left(\sqrt{\frac{2{E}_{b}}{{N}_{0}}}\right)+8{Q}^{3}\left(\sqrt{\frac{2{E}_{b}}{{N}_{0}}}\right)-4{Q}^{4}\left(\sqrt{\frac{2{E}_{b}}{{N}_{0}}}\right)$

From equation 5 in [3],

${P}_{b}=2Q\left(\sqrt{\frac{2{E}_{b}}{{N}_{0}}}\right)\left[1-Q\left(\sqrt{\frac{2{E}_{b}}{{N}_{0}}}\right)\right]$

### OQPSK

For OQPSK, use the same BER and SER computations as for QPSK in [2].

### DE-OQPSK

For DE-OQPSK, use the same BER and SER computations as for DE-QPSK in [3].

### M-DPSK

For M-DPSK, this equation 8.84 from [2] applies:

${P}_{s}=\frac{\mathrm{sin}\left(\pi /M\right)}{2\pi }\underset{-\pi /2}{\overset{\pi /2}{\int }}\frac{\mathrm{exp}\left(-\left(k{E}_{b}/{N}_{0}\right)\left(1-\mathrm{cos}\left(\pi /M\right)\mathrm{cos}\theta \right)\right)}{1-\mathrm{cos}\left(\pi /M\right)\mathrm{cos}\theta }d\theta$

This expression is similar, but not strictly equal, to the exact BER (from [4]):

${P}_{b}=\frac{1}{k}\left(\sum _{i=1}^{M/2}\left({w}_{i}^{\text{'}}\right){A}_{i}\right)$

where ${w}_{i}^{\text{'}}={w}_{i}+{w}_{M-i}$, ${w}_{M/2}^{\text{'}}={w}_{M/2}$, ${w}_{i}$ is the Hamming weight of bits assigned to symbol i,

$\begin{array}{l}{A}_{i}=F\left(\left(2i+1\right)\frac{\pi }{M}\right)-F\left(\left(2i-1\right)\frac{\pi }{M}\right)\\ F\left(\psi \right)=-\frac{\mathrm{sin}\psi }{4\pi }\underset{-\pi /2}{\overset{\pi /2}{\int }}\frac{\mathrm{exp}\left(-k{E}_{b}/{N}_{0}\left(1-\mathrm{cos}\psi \mathrm{cos}t\right)\right)}{1-\mathrm{cos}\psi \mathrm{cos}t}dt\end{array}$

For M-DPSK with M = 2, this equation 8.85 from [2] applies:

${P}_{b}=\frac{1}{2}\mathrm{exp}\left(-\frac{{E}_{b}}{{N}_{0}}\right)$

### M-PAM

From equations 8.3 and 8.7 in [2] and equation 5.2-46 in [1],

${P}_{s}=2\left(\frac{M-1}{M}\right)Q\left(\sqrt{\frac{6}{{M}^{2}-1}\frac{k{E}_{b}}{{N}_{0}}}\right)$

From [5],

$\begin{array}{c}{P}_{b}=\frac{2}{M{\mathrm{log}}_{2}M}×\\ \sum _{k=1}^{{\mathrm{log}}_{2}M}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\sum _{i=0}^{\left(1-{2}^{-k}\right)M-1}\left\{{\left(-1\right)}^{⌊\frac{i{2}^{k-1}}{M}⌋}\left({2}^{k-1}-⌊\frac{i{2}^{k-1}}{M}+\frac{1}{2}⌋\right)Q\left(\left(2i+1\right)\sqrt{\frac{6{\mathrm{log}}_{2}M}{{M}^{2}-1}\frac{{E}_{b}}{{N}_{0}}}\right)\right\}\end{array}$

### M-QAM

For square M-QAM, $k={\mathrm{log}}_{2}M$ is even, so equation 8.10 from [2] and equations 5.2-78 and 5.2-79 from [1] apply:

${P}_{s}=4\frac{\sqrt{M}-1}{\sqrt{M}}Q\left(\sqrt{\frac{3}{M-1}\frac{k{E}_{b}}{{N}_{0}}}\right)-4{\left(\frac{\sqrt{M}-1}{\sqrt{M}}\right)}^{2}{Q}^{2}\left(\sqrt{\frac{3}{M-1}\frac{k{E}_{b}}{{N}_{0}}}\right)$

From [5],

$\begin{array}{c}{P}_{b}=\frac{2}{\sqrt{M}{\mathrm{log}}_{2}\sqrt{M}}\\ ×\sum _{k=1}^{{\mathrm{log}}_{2}\sqrt{M}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\sum _{i=0}^{\left(1-{2}^{-k}\right)\sqrt{M}-1}\left\{{\left(-1\right)}^{⌊\frac{i{2}^{k-1}}{\sqrt{M}}⌋}\left({2}^{k-1}-⌊\frac{i{2}^{k-1}}{\sqrt{M}}+\frac{1}{2}⌋\right)Q\left(\left(2i+1\right)\sqrt{\frac{6{\mathrm{log}}_{2}M}{2\left(M-1\right)}\frac{{E}_{b}}{{N}_{0}}}\right)\right\}\end{array}$

For rectangular (non-square) M-QAM, $k={\mathrm{log}}_{2}M$ is odd, $M=I×J$, $I={2}^{\frac{k-1}{2}}$, and $J={2}^{\frac{k+1}{2}}$. So that,

$\begin{array}{c}{P}_{s}=\frac{4IJ-2I-2J}{M}\\ ×Q\left(\sqrt{\frac{6{\mathrm{log}}_{2}\left(IJ\right)}{\left({I}^{2}+{J}^{2}-2\right)}\frac{{E}_{b}}{{N}_{0}}}\right)-\frac{4}{M}\left(1+IJ-I-J\right){Q}^{2}\left(\sqrt{\frac{6{\mathrm{log}}_{2}\left(IJ\right)}{\left({I}^{2}+{J}^{2}-2\right)}\frac{{E}_{b}}{{N}_{0}}}\right)\end{array}$

From [5],

${P}_{b}=\frac{1}{{\mathrm{log}}_{2}\left(IJ\right)}\left(\sum _{k=1}^{{\mathrm{log}}_{2}I}{P}_{I}\left(k\right)+\sum _{l=1}^{{\mathrm{log}}_{2}J}{P}_{J}\left(l\right)\right)$

where

${P}_{I}\left(k\right)=\frac{2}{I}\sum _{i=0}^{\left(1-{2}^{-k}\right)I-1}\left\{{\left(-1\right)}^{⌊\frac{i{2}^{k-1}}{I}⌋}\left({2}^{k-1}-⌊\frac{i{2}^{k-1}}{I}+\frac{1}{2}⌋\right)Q\left(\left(2i+1\right)\sqrt{\frac{6{\mathrm{log}}_{2}\left(IJ\right)}{{I}^{2}+{J}^{2}-2}\frac{{E}_{b}}{{N}_{0}}}\right)\right\}$

and

${P}_{J}\left(k\right)=\frac{2}{J}\sum _{j=0}^{\left(1-{2}^{-l}\right)J-1}\left\{{\left(-1\right)}^{⌊\frac{j{2}^{l-1}}{J}⌋}\left({2}^{l-1}-⌊\frac{j{2}^{l-1}}{J}+\frac{1}{2}⌋\right)Q\left(\left(2j+1\right)\sqrt{\frac{6{\mathrm{log}}_{2}\left(IJ\right)}{{I}^{2}+{J}^{2}-2}\frac{{E}_{b}}{{N}_{0}}}\right)\right\}$

### Orthogonal M-FSK with Coherent Detection

From equation 8.40 in [2] and equation 5.2-21 in [1],

$\begin{array}{l}{P}_{s}=1-\underset{-\infty }{\overset{\infty }{\int }}{\left[Q\left(-q-\sqrt{\frac{2k{E}_{b}}{{N}_{0}}}\right)\right]}^{M-1}\frac{1}{\sqrt{2\pi }}\mathrm{exp}\left(-\frac{{q}^{2}}{2}\right)dq\\ {P}_{b}=\frac{{2}^{k-1}}{{2}^{k}-1}{P}_{s}\end{array}$

### Nonorthogonal 2-FSK with Coherent Detection

For $M=2$, equation 5.2-21 in [1] and equation 8.44 in [2] apply:

${P}_{s}={P}_{b}=Q\left(\sqrt{\frac{{E}_{b}\left(1-\mathrm{Re}\left[\rho \right]\right)}{{N}_{0}}}\right)$

$\rho$ is the complex correlation coefficient, such that:

$\rho =\frac{1}{2{E}_{b}}\underset{0}{\overset{{T}_{b}}{\int }}{\stackrel{˜}{s}}_{1}\left(t\right){\stackrel{˜}{s}}_{2}^{*}\left(t\right)dt$

where ${\stackrel{˜}{s}}_{1}\left(t\right)$ and ${\stackrel{˜}{s}}_{2}\left(t\right)$ are complex lowpass signals, and

${E}_{b}=\frac{1}{2}\underset{0}{\overset{{T}_{b}}{\int }}{|{\stackrel{˜}{s}}_{1}\left(t\right)|}^{2}dt=\frac{1}{2}\underset{0}{\overset{{T}_{b}}{\int }}{|{\stackrel{˜}{s}}_{2}\left(t\right)|}^{2}dt$

For example, with

then

$\begin{array}{c}\rho =\frac{1}{2{E}_{b}}\underset{0}{\overset{{T}_{b}}{\int }}\sqrt{\frac{2{E}_{b}}{{T}_{b}}}{e}^{j2\pi {f}_{1}t}\sqrt{\frac{2{E}_{b}}{{T}_{b}}}{e}^{-j2\pi {f}_{2}t}dt=\frac{1}{{T}_{b}}\underset{0}{\overset{{T}_{b}}{\int }}{e}^{j2\pi \left({f}_{1}-{f}_{2}\right)t}dt\\ =\frac{\mathrm{sin}\left(\pi \Delta f{T}_{b}\right)}{\pi \Delta f{T}_{b}}{e}^{j\pi \Delta ft}\end{array}$

where $\Delta f={f}_{1}-{f}_{2}$.

From equation 8.44 in [2],

where $h=\Delta f{T}_{b}$.

### Orthogonal M-FSK with Noncoherent Detection

From equation 5.4-46 in [1] and equation 8.66 in [2],

$\begin{array}{l}{P}_{s}=\sum _{m=1}^{M-1}{\left(-1\right)}^{m+1}\left(\begin{array}{c}M-1\\ m\end{array}\right)\frac{1}{m+1}\mathrm{exp}\left[-\frac{m}{m+1}\frac{k{E}_{b}}{{N}_{0}}\right]\\ {P}_{b}=\frac{1}{2}\frac{M}{M-1}{P}_{s}\end{array}$

### Nonorthogonal 2-FSK with Noncoherent Detection

For $M=2$, this equation 5.4-53 from [1] and this equation 8.69 from [2] apply:

${P}_{s}={P}_{b}=Q\left(\sqrt{a},\sqrt{b}\right)-\frac{1}{2}\mathrm{exp}\left(-\frac{a+b}{2}\right){I}_{0}\left(\sqrt{ab}\right)$

where

### Precoded MSK with Coherent Detection

Use the same BER and SER computations as for BPSK.

### Differentially Encoded MSK with Coherent Detection

Use the same BER and SER computations as for DE-BPSK.

### MSK with Noncoherent Detection (Optimum Block-by-Block)

The upper bound on error rate from equations 10.166 and 10.164 in [6]) is

$\begin{array}{c}{P}_{s}={P}_{b}\\ \le \frac{1}{2}\left[1-Q\left(\sqrt{{b}_{1}},\sqrt{{a}_{1}}\right)+Q\left(\sqrt{{a}_{1}},\sqrt{{b}_{1}}\right)\right]+\frac{1}{4}\left[1-Q\left(\sqrt{{b}_{4}},\sqrt{{a}_{4}}\right)+Q\left(\sqrt{{a}_{4}},\sqrt{{b}_{4}}\right)\right]+\frac{1}{2}{e}^{-\frac{{E}_{b}}{{N}_{0}}}\end{array}$

where

$\begin{array}{cc}{a}_{1}=\frac{{E}_{b}}{{N}_{0}}\left(1-\sqrt{\frac{3-4/{\pi }^{2}}{4}}\right),& {b}_{1}=\frac{{E}_{b}}{{N}_{0}}\left(1+\sqrt{\frac{3-4/{\pi }^{2}}{4}}\right)\\ {a}_{4}=\frac{{E}_{b}}{{N}_{0}}\left(1-\sqrt{1-4/{\pi }^{2}}\right),& {b}_{4}=\frac{{E}_{b}}{{N}_{0}}\left(1+\sqrt{1-4/{\pi }^{2}}\right)\end{array}$

### CPFSK Coherent Detection (Optimum Block-by-Block)

The lower bound on error rate (from equation 5.3-17 in [1]) is

${P}_{s}>{K}_{{\delta }_{\mathrm{min}}}Q\left(\sqrt{\frac{{E}_{b}}{{N}_{0}}{\delta }_{\mathrm{min}}^{2}}\right)$

The upper bound on error rate is

${\delta }_{\mathrm{min}}^{2}>\underset{1\le i\le M-1}{\mathrm{min}}\left\{2i\left(1-\text{sinc}\left(2ih\right)\right)\right\}$

where h is the modulation index, and ${K}_{{\delta }_{\mathrm{min}}}$ is the number of paths with the minimum distance.

${P}_{b}\cong \frac{{P}_{s}}{k}$