0

The Python MNE API says I should compute continuous wavelets by

mne.time_frequency.cwt_morlet(X, sampling_frequency, frequencies_of_interest)

However, when I make X equal to a raw .fif data file, it throws

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'

What am I doing wrong?

S.A.
  • 1,819
  • 1
  • 24
  • 39
Nico Autia
  • 129
  • 2
  • 14

1 Answers1

0

As the documentation says, this function operates on NumPy arrays, not on instances of Raw. This means you have to get the data out of the Raw object. You can use the get_data() method for that:

mne.time_frequency.cwt_morlet(X.get_data(), X.info['sfreq'], frequencies_of_interest)
Marijn van Vliet
  • 5,239
  • 2
  • 33
  • 45