sdr.plot.zeros_poles(filter: FIR | IIR | ArrayLike | tuple[ArrayLike, ArrayLike], ax: plt.Axes | None = None, **kwargs)

Plots the zeros and poles of the filter.

Parameters:
filter: FIR | IIR | ArrayLike | tuple[ArrayLike, ArrayLike]

The filter definition.

  • sdr.FIR, sdr.IIR: The filter object.

  • npt.ArrayLike: The feedforward coefficients \(b_i\).

  • tuple[npt.ArrayLike, npt.ArrayLike]: The feedforward coefficients \(b_i\) and feedback coefficients \(a_j\).

ax: plt.Axes | None = None

The axis to plot on. If None, the current axis is used.

**kwargs

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

Examples

See the FIR filters example.

In [1]: h_srrc = sdr.root_raised_cosine(0.5, 10, 10)

In [2]: plt.figure(); \
   ...: sdr.plot.zeros_poles(h_srrc)
   ...: 
../../_images/sdr_plot_zeros_poles_1.png

See the IIR filters example.

In [3]: zero = 0.6; \
   ...: pole = 0.8 * np.exp(1j * np.pi / 8); \
   ...: iir = sdr.IIR.ZerosPoles([zero], [pole, pole.conj()])
   ...: 

In [4]: plt.figure(); \
   ...: sdr.plot.zeros_poles(iir)
   ...: 
../../_images/sdr_plot_zeros_poles_2.png