hnn_core.viz.plot_psd

hnn_core.viz.plot_psd(dpl, *, fmin=0, fmax=None, tmin=None, tmax=None, layer='agg', ax=None, show=True)

Plot power spectral density (PSD) of dipole time course

Applies periodogram from SciPy with window='hamming'. Note that no spectral averaging is applied across time, as most hnn_core simulations are short-duration. However, passing a list of Dipole instances will plot their average (Hamming-windowed) power, which resembles the Welch-method applied over time.

Parameters
dplinstance of Dipole | list of Dipole instances

The Dipole object.

fminfloat

Minimum frequency to plot (in Hz). Default: 0 Hz

fmaxfloat

Maximum frequency to plot (in Hz). Default: None (plot up to Nyquist)

tminfloat or None

Start time of data to include (in ms). If None, use entire simulation.

tmaxfloat or None

End time of data to include (in ms). If None, use entire simulation.

layerstr, default ‘agg’

The layer to plot. Can be one of ‘agg’, ‘L2’, and ‘L5’

axinstance of matplotlib figure | None

The matplotlib axis.

showbool

If True, show the figure

Returns
figinstance of matplotlib Figure

The matplotlib figure handle.