Unify(stack) two EDF files

Dear MNE community! I have two EDF files with different channels, which belong to the same subject. I’d like to concatenate the files “horizontally” such that the result will be single file with all the channels from two EDF files and all the annotations from two EDF files.
I’m considering writing code with pyEDFlib, to manually stack numpy arrays(signals) and merge annotations dictionaries. But before that I was wandering if MNE already put their hand on it :slight_smile: Thanks!!

MNE has mne.concatenate_raws() for this purpose, but you need to take care that both data sets have the same set of channels. If your goal is to export a single EDF file with the combined signals, I think pyEDFlib is currently your best option.

I think actually you don’t want concatenate_raws() (which will not work if the channels are different) but rather raw1.add_channels([raw2]). Off the top of my head I don’t know if it handles annotations elegantly. If you try it, please report back if it worked or if you encountered difficulties.