Skip to content
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

Read EDF files in which channels have different sampling rates #16

Open
sam81 opened this issue May 24, 2016 · 0 comments
Open

Read EDF files in which channels have different sampling rates #16

sam81 opened this issue May 24, 2016 · 0 comments

Comments

@sam81
Copy link
Owner

sam81 commented May 24, 2016

EDF files can have channels with different sampling rates (e.g. https://physionet.org/pn4/sleep-edfx/). It's not clear how the data should be returned in such case. One possibility would be to return each channel as a separate vector (for example in a dictionary). Another approach, which is the one taken by both (FieldTrip)[https://github.com/fieldtrip/fieldtrip/blob/master/edf2fieldtrip.m] and (mne)[https://github.com/mne-tools/mne-python/blob/master/mne/io/edf/edf.py] is to resample the channels to the highest sampling rate used in the EDF file, so that the data can be returned in a matrix. I tried using this approach resampling with the resample function in the DSP module, but was unsuccessful because strangely that function didn't always return the number of samples I expected, e.g.:

using DSP
x = sin(collect(1:10))
y = resample(x, 10.0)

y has 96 elements rather than 100 as I would have expected. For the time being I'm just throwing an error if an EDF file with channels having different sampling rates are detected.

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

No branches or pull requests

1 participant