EDF+ / Annotations / Most are missing when importing the .edf file using edfread() function
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
I've been trying to import some recordings that have events saved as annotations in the edf+ file and I'm having trouble to successfully read the annotations of the file. Signal comes through fine.
We're using eego recording software (from ant-neuro) for exporting the recorded signal to .edf and I think that there must be a specific encoding in use that doesn't get recognized by the MATLAB signal processing function.
I've tried other routes of inspecting the file, by ASA, as well as free edfbrowser and pyEDFlib - they all seem to work OK and they do open all of the saved annotations. Matlab doesn't open all of them, on multiple files that should have a few hundred of the annotations, it opens only 6-10, I can't see a discernible pattern on why the majority is left out.
The same issue repeats with a R package for opening edf files and there's no error present, so I'm guessing it's using the same procedure as the Matlab function for reading the edf, while the python functions and ASA software must have some other method of extraction for the annotations.
I have tried two toolboxes Fieldtrip and eeglab, both are not really giving good results, eeglab for example recognizes the events but doesn't attribute them given names (they're just all '1') and Fieldtrip issues a warning saying that channels with different sampling rates are not supported and imports 64 channels which all have a label EDF Annotations, each with a corresponding number and they are all empty.
This led me to pay more attention to the channels, which are not explicitly listed using edfread().
I've found there are 126 channels and while half of them are reserved for the EEG channels with the signal (that edfread reads), the other half is dedicated to the Annotations that are not really recognized (only small fragment is recognized). Annotations are under 258Hz sampling rate, the recording is under 1000 Hz.
Just glancing through the documentation on EDF+ I see that normally only one signal is reserved for annotations that are compressed there and then decompressed as annotations. Could it be that the edfread function reads only the first signal and leaves others behind? How come pyEDFlib and edfbrowser are able to recognize the full list of annotations?
If anyone knowledgable enough could help me out, I would be very grateful. I would like to avoid using different kind of softwares for the analysis and just stick to MATLAB, but this issue is obstructing the purpose.
Is there another way of reading or importing edf, some function, toolbox or package? I have tried some of the functions from the community but with no real success.
Thanks for taking your time,
Jan
2 commentaires
Réponses (1)
Kimberley
le 29 Juil 2025
Hi, I am experiencing the same issue. Did you find a solution?
1 commentaire
Alex Wu
le 7 Oct 2025
Hi @Kimberley, if you don't mind, could you share the EDF file you were trying to load and the version of MATLAB you're using?
Voir également
Catégories
En savoir plus sur EEG/MEG/ECoG dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!