Skip to content

Set effective_srate to 0 for empty streams when JitterRemoval is off #2

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

Merged
merged 3 commits into from
Aug 24, 2020

Conversation

cll008
Copy link
Contributor

@cll008 cll008 commented Aug 14, 2019

Currently empty streams crash load_xdf when opts.HandleJitterRemoval = 0, since temp(k).time_stamps is empty and the index is out of range.

@cboulay
Copy link
Contributor

cboulay commented Aug 14, 2019

Please also see sccn/xdf#14

What does this change do when streams have no nominal_rate?
(Sorry I don't have Matlab).

@cll008
Copy link
Contributor Author

cll008 commented Aug 14, 2019

Not sure how it affects other downstream functions, but this change does not affect eeg_load_xdf.m since load_xdf.m is called with default options, where opts.HandleJitterRemoval = 1. This change is only relevant when opts.HandleJitterRemoval = 0.

Regardless of the change, a stream without a nominal_srate should crash eeg_load_xdf.m somewhere here since nominal_srate is empty (and effective_srate == 0).

sccn/xdf#14 is actually better though since Jérémy added some warning messages.

@cll008 cll008 closed this Aug 14, 2019
@cboulay
Copy link
Contributor

cboulay commented Aug 14, 2019

Do you mind testing those changes for me and seeing if it (a) works and (b) fixes your problem? I'd like to merge it but unfortunately I can't test. Actually merging in that repo won't work since we split up the repos, so a new pull request is needed here.

@cll008
Copy link
Contributor Author

cll008 commented Aug 14, 2019

I used xdfBrowser to change a 'healthy' stream's nominal_srate to 0. This file actually did not crash eeg_load_xdf.m since division by 0 in MATLAB results in Inf. eeg_checkset.m addresses nominal_srate ==0 here by changing the sampling rate to 1 and recomputing the timestamps.

I'm not sure the proper git workflow for copying someone's commit when a repo has been split...

@cll008 cll008 reopened this Aug 14, 2019
when JitterRemoval is off
@arnodelorme arnodelorme merged commit 7f27871 into xdf-modules:master Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants