Extracting epochs from an edf file to save as .m file?

73 ビュー (過去 30 日間)
pickyourbrain
pickyourbrain 2024 年 11 月 21 日 6:07
コメント済み: pickyourbrain 2024 年 11 月 23 日 22:44
Hey, newbie to coding and all of that. I'm trying to extract 10 random epochs that are 20 seconds each from my EEG recording (.edf file). I want to be able to save these epochs as a .m file. I'm trying to do this without having to use the EEGLAB GUI. I used edfread and it seems that the data within the edf file is a timetable with a size of 5282 x 1.
Any help on how to do this would be greatly appreciated.
  7 件のコメント
Walter Roberson
Walter Roberson 2024 年 11 月 23 日 20:59
sampling_rate = hdr.EEGEEG1A_B(1);
No.
https://www.mathworks.com/help/signal/ref/edfread.html#mw_a83171d9-fafc-4332-ad36-8243ddcc75c6 shows an example of using edfinfo() and edfread() to compute the vector of sampling frequencies, fs . sampling_rate is 1 ./ fs
Each different signal could, in theory, have a different sampling rate.
epoch_samples = epoch_duration * sampling_rate;
That might not be an integer.
What you should be doing instead, is repeatedly using timerange to extract epochs, since there could be a different number of samples in each epoch (because the epoch_samples is not certain to be an integer.)
pickyourbrain
pickyourbrain 2024 年 11 月 23 日 22:44
Sorry, this is still very abstract for me. Could you explain more about how timerange can be implemented? Do I use timerange in a for loop? What is the structure contained in each epoch?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by