mne-python: When loading EDF+ with different sampling frequencies, don't resample blockwise
Describe the new feature or enhancement
It is possible to load EDF+ files with different sampling frequencies. To my understanding, internally, the channels with differing sampling frequencies are resampled. I understand that the underlying data format BaseRAW assumes that all channels have the same sampling frequency, so resampling the signals to a common denominator is strictly necessary.
Describe your proposed implementation
However, this resampling is happening per block, i.e. every 10 MB of data, and therefore introduces edge artefacts (as also noted in the comments). These are mostly minor, however, in some of my calculations they do indeed change the results of our analysis.
Describe possible alternatives
I think it would be good to load all channels into different data buffers, and only resample them after loading the entire file. However, maybe there was a reasoning why the resampling takes place on a per-block basis (e.g. efficiency?), so please let me know if it would be worth implementing such a change, or if I could give it a try to refactor the function to resample the data after loading everything.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (15 by maintainers)
I can probably have a look at it after some deadlines have past (~end the end of february)