mne_denoise.viz.plot_psd_comparison#

mne_denoise.viz.plot_psd_comparison(inst_before, inst_after, fmin=0, fmax=inf, picks=None, sfreq=None, line_freq=None, show=True, average=True, ax=None, fname=None)[source]#

Plot PSD comparison for original and denoised data.

Parameters:
inst_beforeMNE object | ndarray

Signal before denoising. Supported MNE inputs are Raw, Epochs, and Evoked. Array inputs are interpreted with the last axis as time. When either input is an array, sfreq must be provided.

inst_afterMNE object | ndarray

Signal after denoising with matching channel and time dimensions.

fminfloat, default=0

Lower frequency bound to display.

fmaxfloat, default=np.inf

Upper frequency bound to display.

picksstr | array-like | slice | None

Channels to include. For MNE objects, if None, one homogeneous channel type is automatically picked (‘mag’, ‘grad’, or ‘eeg’ in order) to prevent averaging dissimilar scales.

sfreqfloat | None

Sampling frequency for array inputs.

line_freqfloat | None

Optional line frequency to mark, along with visible harmonics.

showbool

Whether to display the figure.

averagebool

If True, average PSDs across non-frequency axes.

axAxes | None

Optional axis to draw into.

fnamepath-like | None

Optional output path.

Returns:
figmatplotlib.figure.Figure

Figure handle.

Raises:
ValueError

If array inputs are used without sfreq.