sdr.plot.ber(ebn0: ArrayLike, ber: ArrayLike, **kwargs)

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

Parameters:
ebn0: ArrayLike

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

ber: ArrayLike

The bit error rate \(P_b\).

**kwargs

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

Examples

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

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

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