sdr.plot.ber(ebn0: NDArray[float_], ber: NDArray[float_], **kwargs)

Plots the bit error rate (BER) as a function of \(E_b/N_0\).

Parameters:
ebn0: NDArray[float_]

The bit energy \(E_b\) to noise PSD \(N_0\) ratio (dB).

ber: NDArray[float_]

The bit error rate \(P_{be}\).

**kwargs

Additional keyword arguments to pass to matplotlib.pyplot.semilogy().

Examples

Plot theoretical BER curves for BPSK, QPSK, 8-PSK, and 16-PSK in an AWGN channel.

In [1]: bpsk = sdr.PSK(2); \
   ...: qpsk = sdr.PSK(4); \
   ...: psk8 = sdr.PSK(8); \
   ...: psk16 = sdr.PSK(16); \
   ...: ebn0 = np.linspace(-2, 10, 100)
   ...: 

In [2]: plt.figure(figsize=(8, 4)); \
   ...: sdr.plot.ber(ebn0, bpsk.ber(ebn0), label="BPSK"); \
   ...: sdr.plot.ber(ebn0, qpsk.ber(ebn0), label="QPSK"); \
   ...: sdr.plot.ber(ebn0, psk8.ber(ebn0), label="8-PSK"); \
   ...: sdr.plot.ber(ebn0, psk16.ber(ebn0), label="16-PSK"); \
   ...: plt.title("BER curves for PSK modulation in an AWGN channel"); \
   ...: plt.tight_layout();
   ...: 
../../_images/sdr_plot_ber_1.png