Skip to content

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

Description

@sam81

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions