靜息態重疊分段的代碼

靜息態重疊分段提高信噪比的代碼,和短時傅立葉的原理是類似的,作用就是重複計算一部分的分段,相比通常情況的2s一段的靜息態分段,更加有利於保留頻域上的細節,對低頻信息保留完好,缺點是分段後的文件會佔用兩倍的磁盤空間

% Written By  Yizhou 代碼僅供參考,謹慎使用
% Using the code without proper understanding the code and relevant background
% of EEG may lead to confusion, incorrect data analyses,or misinterpretations
% of results.
% The author assumes NO responsibility for inappropriate or incorrect use
% of this code.
% WX:         17373158786
for subi=1:Ns
    LoadName  = ['sub' id{subi} '_0_raw.set'];
    SaveName  = ['rest_sub' id{subi} '.set'];    
    % load continuous resting EEG data
    EEG = pop_loadset('filename',LoadName); 
    
    % Segment continuous EEG data
    EEG = eeg_regepochs(EEG, 'recurrence', 2.5, 'limits',[0 5], 'rmbase',NaN);
    % 分段可以重疊。此例中,每2.5秒加一個'X'作爲event,然後根據此event截取[0-5]秒的分段。
    % 有重疊可得更多的segments,對提高信噪比有好處
    % this function excludes epochs with "boundary" event。
    
    % save
    EEG = pop_saveset( EEG, 'filename',SaveName);              
end
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章