question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding overlap keyword to make_fixed_length_epochs

See original GitHub issue

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 to Epochs, 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 an AverageTfr 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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
agramfortcommented, Jan 24, 2021

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

1reaction
agramfortcommented, Jan 23, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Divide continuous data into equally-spaced epochs
This tutorial shows how to segment continuous data into a set of epochs spaced equidistantly in time. The epochs will not be created...
Read more >
12.2. List of functions - QGIS Documentation
12.2.1.11. max_length . Returns the maximum length of strings from a field or expression. ... Returns an array with the given value...
Read more >
Making fixed-length epochs in resting-state EEG Data
Dear community members, A few days ago I asked a question about epoching continuous EEG data without events. According to @drammock answer, ...
Read more >
Discovering topic structures of a temporally evolving ...
Though originally developed for text analysis, topic models have since ... epochs within which the corpus can be considered as being static.
Read more >
A comparison of rolling averages versus discrete time epochs ...
Linear mixed models compared FIXED versus ROLL and assessed the influence of epoch length, playing position, starting status, match result, location, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found