-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tfr_array_morlet issues with wavelet #11645
Comments
Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴 |
your minimum frequency is too low. 6 cycles at 1 Hz is longer than your
signal given the way the Morlet wavelet is clipped temporally.
Message ID: ***@***.***>
… |
Ah, I was assuming that at lowest (1 Hz), 7 cycles equate to 7s of signal! It appears that the minimum length, as obtained from |
look at the code. I don't know on the top of my head how the clipping is
done.
… Message ID: ***@***.***>
|
See my (edited) comment; l I did take a look! |
@RainyMeadows would you be up for submitting a PR to update our doc? that would be much appreciated. thanks |
@RainyMeadows In the code there's a comment that I think would resolve your confusion: mne-python/mne/time_frequency/tfr.py Lines 153 to 155 in 57f5ce3
In other words, the wavelet will always be (If |
This change improves the docstring of mne.time_frequency.tfr_morlet and mne.time_frequency.tfr_array_morlet. An explanation on the length of the Morlet wavelet for time-frequency representation is added. Closes mne-tools#11645 .
Steps to reproduce
Link to data
I can provide actual data of a single (or couple) channel(s), if necessary.
Expected results
An array of shape (n_chans, n_freqs, n_times)
Actual results
ValueError: At least one of the wavelets is longer than the signal. Use a longer signal or shorter wavelets.
The function works ONLY for
n_cycles <= 4
.Additional information
Platform: Windows-10-10.0.22621-SP0
Python: 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Executable: C:\Users\user\AppData\Local\Programs\Python\Python310\python.exe
CPU: Intel64 Family 6 Model 167 Stepping 1, GenuineIntel: 12 cores
Memory: 15.7 GB
mne: 1.3.1
numpy: 1.24.2 {unknown linalg bindings (threadpoolctl module not found: No module named 'threadpoolctl')}
scipy: 1.10.1
The text was updated successfully, but these errors were encountered: