Sub-epoch time for eeg data

  • MNE version: 0.24.0
  • operating system: Windows 10

Hi,

I’m looking to get sub-epoch time data and was wondering where the right place was to do this in the preprocessing / epoching step.

For example, if I want to calculate the Alpha power every 30s for 2-mins following an event, does that mean I need to change my tmax in the epoching step to 120 (secs)? Then run my band power script on this file?

Thank you in advance :slight_smile:

Cheers,
Thapa

# Epoching settings
    raw_filt = mne.io.read_raw_fif(f"../1_EEG/Python_Outputs/MNE_ICA/p{i}_raw_filt.fif")

    tmin =  -.200  # start of each epoch (in sec)
    tmax =  480  # end of each epoch (in sec)
    baseline = (None, 0)

    # Create epochs
    epochs = mne.Epochs(raw_filt,
                        events, 
                        event_mapping,
                        tmin,
                        tmax,
                        baseline=baseline,
                        preload=True)

Hello, I would create 4 sets of Epochs with the following tmin and tmax, relative to the events of interest:

  • 0, 30
  • 30, 60
  • 60, 90
  • 90, 120

Then you can analyze them separately!

Best wishes,
Richard

1 Like

Hi @richard,

That’s a good idea. I’ll give that a go.

Thank you :slight_smile:

Cheers,
Thapa

1 Like

Hi @richard,

I’ve tried your approach but got a ‘data out of range’ error.

However, if I keep my tmin-0, and vary my tmax e.g., tmax= 60 (for a 1-min epoch), tmax=120 (for a 2-min epoch), it seems to work.

Does this sound right to you? Thoughts?

Cheers,
Thapa