-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
raw.resample drops events #4016
Comments
Yes this can happen. What you can do if you want to preserve them (but note you will lose timing precision!) is do
Does that make sense? Can you think of a good place to put this sort of thing in the docs? |
Makes sense, thanks! |
Do you have time to make a quick PR?
|
Sorry, I'm a bit of a noob when it comes to the larger scheme of developing software (github, docs, etc) what's a PR? |
PR is short for pull request (github lingo). See https://mne-tools.github.io/stable/contributing.html?highlight=contributing to get started. |
So this is different from the problem fixed in #2298 ? |
If I read correctly, then #2298 deals with events ending up on adjecent samples, e.g. when downsampling 0 0 1 0 1 0 0 0 yields 0 1 1 0 (rendering it to only one value-change on the stim channel). This issue is more about events ending up on the exact same sample, which is "impossible" on one single stim channel with one value per timepoint. |
Sorry, my fingers must have slipped on my phone, not sure this is resolved. Didn't mean to close it. Seems different from #2298. |
@timmidee are you ready to make a PR now? :) |
I think I need a solid python editor, a crash course in GitHub/forking/PR/upstreams/trunks/branches/etc. and more time than my PhD currently allows... Maybe I can write a few sentences and bug one of you to make the PR for me while I slowly learn this stuff? |
Sure. Or take the (hopefully) easy route and use the GitHub interface to make a PR. |
feel free to reopen if necessary |
When I resample data from 1000Hz to 100Hz, some events are dropped.
I go from 10690 to 10645 events before and after resampling, as found by mne.find_events(raw,shortest_event=0,consecutive = True).
Is this expected behaviour?
I realise I have an awful lot of events, but that's because I have eye movement events coded as events.
It also means events are sometimes on adjacent samples (hence consecutive = True). Could it be that the resampling causes temporally (almost) adjacent events to end up on exactly the same sample and therefore drops (one of) them? (cf. #3938)
edit: Just by calling resample() I seem to lose 5 events, then the actual downsampling loses me another number of samples, but that number depends on the new sampling rate. The higher the sampling rate the lower the number of dropped events.
The text was updated successfully, but these errors were encountered: