Plotting

Utility

sdr.plot.use_style()

Applies sdr’s default matplotlib rcParams.

sdr.plot.stem[_ScalarType_co](x, ...)
sdr.plot.stem[_ScalarType_co](x, ...)

Wraps matplotlib.pyplot.stem() to style the plot more like MATLAB.

Time-domain

sdr.plot.time_domain[_ScalarType_co](x, ...)
sdr.plot.time_domain[_ScalarType_co](t, ...)

Plots a time-domain signal \(x[n]\).

sdr.plot.raster(x: ArrayLike, length: int | None = None, ...)

Plots a raster of the time-domain signal \(x[n]\).

sdr.plot.correlation(x: ArrayLike, y: ArrayLike, ...)

Plots the correlation between two time-domain signals \(x[n]\) and \(y[n]\).

Frequency-domain

sdr.plot.dft(x: ArrayLike, sample_rate: float | None = None, ...)

Plots the discrete Fourier transform (DFT) of the time-domain signal \(x[n]\).

sdr.plot.dtft(x: ArrayLike, sample_rate: float | None = None, ...)

Plots the discrete-time Fourier transform (DTFT) of the time-domain signal \(x[n]\).

Spectral estimation

sdr.plot.periodogram(x: ArrayLike, ...)

Plots the estimated power spectral density \(P_{xx}\) of a time-domain signal \(x[n]\) using Welch’s method.

sdr.plot.spectrogram(x: ArrayLike, ...)

Plots the spectrogram of a time-domain signal \(x[n]\) using Welch’s method.

Modulation

sdr.plot.constellation(x_hat: ArrayLike, ...)

Plots the constellation of the complex symbols \(\hat{x}[k]\).

sdr.plot.symbol_map(modulation: LinearModulation | ArrayLike, ...)

Plots the symbol map of the complex symbols \(\hat{x}[k]\).

sdr.plot.eye(x: ArrayLike, sps: int, span: int = 2, ...)

Plots the eye diagram of the baseband modulated signal \(x[n]\).

sdr.plot.phase_tree(x: ArrayLike, sps: int, span: int = 2, ...)

Plots the phase tree of a continuous-phase modulated (CPM) signal signal \(x[n]\).

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

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

sdr.plot.ser(esn0: ArrayLike, ser: ArrayLike, ...)

Plots the symbol error rate (SER) as a function of \(E_s/N_0\).

sdr.plot.shannon_limit_ebn0(rho: float, ax: Axes | None = None)

Plots the Shannon limit for the bit energy-to-noise PSD ratio \(E_b/N_0\).

Detection

sdr.plot.p_d(x: ArrayLike, p_d: ArrayLike, ...)

Plots the probability of detection \(P_d\) as a function of received SNR or ENR.

sdr.plot.roc(p_fa: ArrayLike, p_d: ArrayLike, ...)

Plots the receiver operating characteristic (ROC) curve as a function of \(P_{fa}\).

sdr.plot.detector_pdfs(...)

Plots the probability density functions (PDFs) of the detector under \(\mathcal{H}_0\) and \(\mathcal{H}_1\).

Filter analysis

sdr.plot.impulse_response(filter, ...)

Plots the impulse response \(h[n]\) of a filter.

sdr.plot.step_response(filter, ...)

Plots the step response \(s[n]\) of a filter.

sdr.plot.zeros_poles(filter, ...)

Plots the zeros and poles of the filter.

sdr.plot.magnitude_response(filter, ...)

Plots the magnitude response \(|H(\omega)|^2\) of the filter.

sdr.plot.phase_response(filter, ...)

Plots the phase response \(\angle H(\omega)\) of the filter.

sdr.plot.phase_delay(filter, ...)

Plots the phase delay \(\tau_{\phi}(\omega)\) of the filter.

sdr.plot.group_delay(filter, ...)

Plots the group delay \(\tau_g(\omega)\) of the IIR filter.

sdr.plot.filter(filter, ...)

Plots the magnitude response \(|H(\omega)|^2\), impulse response \(h[n]\), and zeros and poles of the filter.


Last update: Jun 15, 2024