Concatenate raw data or epochs

Hello all,

I’m new to EEG analysis and I have a question that might have a simple answer.

I want to perform time-frequency analysis on EEG data. I have blocks of trials for the left and right hand. If I wanted to do the analysis, say, on the left side, I would probably need to concatenate my data to join all the left-side blocks. So my question is, what would be better?: Concatenate the raw data, then preprocessing, and then epoching that data; or preprocess the raw data separately, epoch each of those files, and then concatenate the epochs? Is there any difference?

Thanks in advance.
José

The main thing to worry about here is different channels getting marked as “bad” in different recordings; you need to have the same set of bad channels in order to concatenate raw files (and also to concatenate epochs). There is a function equalize_bads() that can help with that, but you can also avoid the problem in the first place if you concatenate the raw files before doing the preprocessing.

Other than that, there shouldn’t be any theoretical difference between preprocess→concatenate→epoch and concatenate→preprocess→epoch because MNE-Python will automatically add annotations (BAD_EDGE) at the concatenation edges, which tells downstream functions not to treat that part of the data as continuous. Practically, however, you might hit memory constraints if you concatenate first, depending on how many / how long your raw files are.

The third option, preprocess→epoch→concatenate is probably what I would do if the bad channel mismatch mentioned above was not an issue. You may want to do the preprocessing step first, see how bad the mismatch is, and then decide.

3 Likes