静息态重叠分段提高信噪比的代码,和短时傅立叶的原理是类似的,作用就是重复计算一部分的分段,相比通常情况的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