def plot_psd(X, label, Fs, NFFT, color=None):
freqs, psd = welch(X, fs=Fs, window='hanning', nperseg=NFFT,
noverlap=int(NFFT * 0.8))
freqs = freqs[freqs > 0]
psd = psd[freqs > 0]
plt.plot(np.log10(freqs), 10 * np.log10(psd.ravel()), label=label,
color=color)
###############################################################################
# Now we read in the data
#
# Then we plot the power spectrum of the MEG and reference channels,
# apply the reference correction and add the resulting cleaned MEG channels
# to our comparison.
评论列表
文章目录