bemobil_mne.viz.plot_PSD#

bemobil_mne.viz.plot_PSD(inst_dict, fmin, fmax, baseline_dict=None, picks=None, combine=False, ci=True, dB=True)[source]#

Plot power spectral density (PSD) for given events.

Parameters:
inst_dictdict

Dictionary of mne.Epochs objects, grouped by condition, e.g., {“condition”: mne.Epochs}.

fminfloat

Minimum frequency to include in the PSD.

fmaxfloat

Maximum frequency to include in the PSD.

baseline_dictdict | None

An optional dictionary using the same keys as the inst_dict to specify baselines e.g., {“condition”: mne.Epochs} or {“condition”: mne.Spectrum}.

pickslist of str or None, optional

List of channel names to include. If None, all channels are used.

combinebool | optional

If True, average PSDs over channels and show a single plot. If False, plot each channel separately. Defaults to False.

cifloat | bool | callable() | None

Confidence band around each PSD. If False or None no confidence band is drawn. If float, ci must be between 0 and 1, and will set the threshold for a parametric estimation of the confidence band; True is equivalent to setting a threshold of 0.95 (i.e., the 95% confidence band is drawn). If a callable, it must take a single array (n_observations x n_times) as input and return upper and lower confidence margins (2 x n_times). Defaults to True.

dBbool | None

If True (default), plot PSD in decibels (10*log10(V²/Hz)). If False, plot in linear units (V²/Hz).

Returns:
figmatplotlib.figure.Figure

The resulting figure containing the PSD plots for each event and channel.

See also

mne.Evoked.compute_psd

For more information on the PSD computation.

mne.viz.evoked._get_ci_function_pce

For computing confidence intervals.