How to read hypnogram file (.hyp) in matlab
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
androw jackson
le 25 Août 2018
Commenté : Ibrahim kaya
le 10 Déc 2020
Hello, I want to know how to open .hyp file (hypnogram of sleep stage analysis from physionet.org) in matlab? my file format is not ''.edf''. the format of my file is ''.hyp''. the edfread function can not open it in matlab. I test it. thanks
1 commentaire
Ibrahim kaya
le 10 Déc 2020
You can use the following commands in python to convert edf to csv
Then importing csv to Matlab is easy:
import pyedflib
import pandas
import csv
f = pyedflib.EdfReader("SC4001EC-Hypnogram.edf")
annotations = f.readAnnotations()
with open("Test.csv",'w') as fo:
for d in range(len(annotations[0])):
fo.write(str(annotations[0][d])+','+str(annotations[1][d])+','+annotations[2][d]+'\n')
Réponse acceptée
Star Strider
le 25 Août 2018
Files with a ‘.hyp’ extension are annotation files. They are intended to be used by the Physionet software, not read individually. Not all sleep data are annotated. (Since they are ASCII files, MATLAB can open the files and import them with the fgets function. Making sense of them afterwards is another problem.)
Go back to PhysioBank ATM (link), choose the record you want, and in the ‘Toolbox’ pull-down menu, select ‘Export signals as .mat’. The signals, and annotations (if they exist) should be in that file, that you can then open with the MATLAB load (link) function.
For best results, assign them to a variable, described in Load List of Variables into Structure Array (link).
I have some experience with PhysioNET files, but none with the polysomnographic data, so I cannot help you further with them.
0 commentaires
Plus de réponses (0)
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!