plot_ber#
- sionna.phy.utils.plot_ber(snr_db: numpy.ndarray | List[numpy.ndarray], ber: numpy.ndarray | List[numpy.ndarray], legend: str | List[str] = '', ylabel: str = 'BER', title: str = 'Bit Error Rate', ebno: bool = True, is_bler: bool | List[bool] | None = None, xlim: Tuple[float, float] | None = None, ylim: Tuple[float, float] | None = None, save_fig: bool = False, path: str = '') Tuple[matplotlib.figure.Figure, matplotlib.axes._axes.Axes][source]#
Plot error-rates.
- Parameters:
snr_db (numpy.ndarray | List[numpy.ndarray]) – Array defining the simulated SNR points.
ber (numpy.ndarray | List[numpy.ndarray]) – Array defining the BER/BLER per SNR point.
ylabel (str) – Label for the y-axis.
title (str) – Figure title.
ebno (bool) – If True, the x-label is set to “EbNo [dB]” instead of “EsNo [dB]”.
is_bler (bool | List[bool] | None) – If True, the corresponding curve is dashed.
save_fig (bool) – If True, the figure is saved as .png.
path (str) – Path to save the figure if
save_figis True.
- Outputs:
fig – matplotlib.figure.Figure. Figure handle.
ax – matplotlib.axes.Axes. Axes object.
Examples
import numpy as np from sionna.phy.utils import plot_ber snr = np.array([0, 2, 4, 6, 8, 10]) ber = np.array([0.2, 0.1, 0.05, 0.01, 0.001, 0.0001]) fig, ax = plot_ber(snr, ber, legend="AWGN", title="BER vs SNR")