Segment length out of bound

Hello everyone, I am very new to EEG and I am trying the analyse the changes in alpha and beta frequency bands during stress scenarios. I am continuously recording 7 trials each one marked s1-s2-s3.
S1 corresponds to the first event marked in my virtual game: it is a cognitive test and lasts for 50 seconds.
S2 corresponds to when the stressor is triggered. This one is triggered at the second 50 and lasts for 30 seconds.
S3 marks the end of the game.

I keep getting issues on the segment length being out of bounds and I believe this is because when extracting the epochs, I set s1 to range [0 50] however the latencies of other trials go over 50sexonds.

Any idea on how I could fix that?

Thanks a lot in advance

MNE-Python does not support havind an Epochs object where each epoch (or trial) has a different length. Since you only have three trials, I recommend making them three Raw objects. Copy the original Raw object three times with raw.copy() and then use raw.crop() to trim each one to the right start/stop times to match the three trials.

1 Like