Plotting

Configuration

sdr.plot.use_style()

Applies sdr’s default matplotlib rcParams.

Time-domain

sdr.plot.time_domain(x: NDArray, ...)

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

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

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

Frequency-domain

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: NDArray[complex_], ...)

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

sdr.plot.symbol_map(modulation, ...)

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

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

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

sdr.plot.phase_tree(x: NDArray, sps: int, span: int = 4, ...)

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

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

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

sdr.plot.ser(esn0: NDArray[float_], ser: NDArray[float_], **kwargs)

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

Detection

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

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

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

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

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]\), step response \(s[n]\), and zeros and poles of the filter.


Last update: Aug 09, 2023