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
Adding overlap keyword to make_fixed_length_epochs #8773
Comments
ok to add overlap param to make_fixed_length_epochs yet I am not sure what you aim to obtain for TFR on raw. You want a spectrogram? |
Yep I'm essentially after a spectrogram. |
one idea now we refactored the raw.plot would be to add plot of spectrogram
in each "horizontal" band of the plot.
I've seen this in certain software for sleep data.
did you try scipy.signal.spectrogram?
… |
And do you mean we could add a compute_spectrogram function for
|
my concern is that TFRs are often bigger than the initial raw data (one
signal gives an image),
so it makes sense to compute it on the fly when you need and do not store
it to disk.
A TFR for 300 MEG channels for 6 mins of sample data would be huge.
… |
I agree storing the full (ch, freqs, time) array would be huge, but in many cases, one might jsut want (ch, time) for a certain frequency band, so for example, I want spectrograms for my iEEG The combination scheme can be "mean", or "median" for example, or more generally a Overall, I think the general use-case of getting one of these averaged spectrogram directly from Is the idea of computing a spectrogram directly from |
try to cook something for your needs and share it when it does the job for
you.
then we'll see what to consider for inclusion in mne
… |
👨💻 |
I am working on this |
Describe the new feature or enhancement
I am trying to use time-frequency analysis that is present in mne without converting to arrays first. There is no way to do this using the
Raw
object, and one must convert toEpochs
, with each epoch "representing" the window that will have tfr methods applied. E.g. I want to compute the multitaper FFT, and/or morlet wavelet transform to get anAverageTfr
object for multiple frequency bands, alpha, beta, gamma, etc.Normally, one would like some overlap of these windows. For example, if you do multitpaer FFT, then you usually use a sliding window with some overlap (e.g. 1 sec window with 0.5 sec step).
In https://mne.tools/stable/generated/mne.make_fixed_length_events.html#mne.make_fixed_length_events
there is an overlap keyword.
However, in
make_fixed_legnth_epochs
there is not.https://mne.tools/stable/generated/mne.make_fixed_length_epochs.html#mne.make_fixed_length_epochs
Describe your proposed implementation
Is it possible to add the
overlap
keyword argument here?Describe possible alternatives
I'm still not quite sure what the optimal way to apply tfr analysis to a Raw object. Obviously one can always convert to arrays, but then they lose the structure present in the mne data structures. I would prefer staying with the data structures mne has (e.g. Epochs for TFR). If what I said up there is not the optimal way to construct TFR then please let me know.
Additional comments
I can update an existing example to show this functionality off if needed.
The text was updated successfully, but these errors were encountered: