Open umair-hassan opened 2 years ago
Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽♂️
@umair-hassan look at the decim parameter in mne.Epochs class
close the issue if it fixes your issue
I understand that there exist a decim param in Epochs, but I do not want to Epoch the data at the continous raw stage when I am planning to decimate. Basically just loading the data using mne.io.raw method and just directly apply decimation. I also understand that it will impact my events, but I do not care about that at this stage of processing.
Why do you want to decimate raw (continuous) data without an anti-alias filter? Do you take care of that yourself? You can resample with raw.resample()
, which does apply a suitable anti-aliasing filter though.
I need it for a concurrent EEG fMRI artefact correction step. I cannot just apply antialiasing in the presence of huge gradient artefacts. The data was sampled at exceptionally high Fs therefore downsampling it to a reasonable Fs is also necessary. I will take care of anti-aliasing myself.
I think generally speaking for all brain stimulation, neuromodulation, TMS-EEG analysis too, this would be quite desirable.
You can always grab the continuous data with raw.get_data()
and then decimate the NumPy array yourself. Would that work?
Yes in principle.
We might consider adding a new parameter antialias=True
to Raw.resample()
, but I'd rather not unless it would be helpful for a larger group of users. So if you can live with the proposed workaround LMK, otherwise we'll wait for other devs to chime in.
Thanks!
People do ask for this from time to time. Because this keeps coming up (and since we have a non-antialiased .decimate
for epochs+evoked), I'm okay with adding one that just takes every Nth sample as long as we state clearly that bad things can happen when you do this.
OK! Then instead of adding a parameter to resample()
, it is better to add a new decimate()
method as you suggested.
Ping, just checking for an update here.
see related issue: https://github.com/mne-tools/mne-python/issues/10447
Dear MNE Maintainers,
I am trying to decimate the raw data (loaded using raw.io), I do not care about the antialiasing and filters. I just need the decimated date (downsampled ratio basically). I am not sure if I can create epoch easily for the whole data and then downsample it, therefore I think inside resample (there could be an option to switch off the filters) or there could be a generic decimate method for raw io object as well.
Happy to help implementing it though.
Best, Umair