Python MNE:如何计算连续小波?

时间:2016-07-13 09:06:39

标签: python mne-python

Python MNE API说我应该按

计算连续小波
mne.time_frequency.cwt_morlet(X, sampling_frequency, frequencies_of_interest)

但是,当我使X等于原始.fif数据文件时,它会抛出

287     # mode = "valid"
288     decim = _check_decim(decim)
--> 289     n_signals, n_times = X[:, decim].shape
290
291     # Precompute wavelets for given frequency range to save time

AttributeError: 'tuple' object has no attribute 'shape'

我做错了什么?

1 个答案:

答案 0 :(得分:0)

正如文档所述,此函数在NumPy数组上运行,而不是在Raw实例上运行。这意味着您必须从Raw对象中获取数据。您可以使用get_data()方法:

mne.time_frequency.cwt_morlet(X.get_data(), X.info['sfreq'], frequencies_of_interest)