Phasic modulation of attentional rhythmic sampling according to task demands.
The 3 matches
- [1] § Methods › Spectrum analysis of the envelope of SSVEP ↔ fuse.m, lines 188–270 · score 0.68 · 41.5–42.5 Hz, 43.5–44.5 Hz, 41.5 Hz, 43.5 Hz, filtered, peak
- [2] § Methods › Spectrum analysis of the envelope of SSVEP ↔ sep.m, lines 188–270 · score 0.68 · 41.5–42.5 Hz, 43.5–44.5 Hz, 41.5 Hz, 43.5 Hz, filtered, peak
- [3] § Methods › Statistical tests ↔ fuse.m, lines 434–473 · score 0.53 · circ_htest, CircStat, uniformity, phase
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
MATLAB · 881 lines · 34 KB · no license · 2 matches
- %% 0. fuse条件
- % 42 hz总是在左边,44 hz总是在右边。
- % trigger:10代表左边先开始闪,20代表右边先开始闪。
- % PO3:45; PO4:46
- %% 1. SSVEP topography,左右半球各选一个电极,先计算ERP,再做fft
- load("E:\Data\Kongqing\Exp1\fuse\fuse.mat");
- cfg = [];
- cfg.demean = 'yes';
- cfg.baselinewindow = [-0.2, 0];
- for i=1:length(eegdata)
- eegdata{1,i} = ft_preprocessing(cfg, eegdata{1,i});
- end
- % 分开左边先闪和右边先闪,各自计算erp
- subj=1:21; % 被试
- cfg = [];
- for i = 1:length(subj)
- cfg.trials = find(eegdata{1, subj(i)}.trialinfo == 10);
- erp_l{1, i} = ft_timelockanalysis(cfg,eegdata{1, subj(i)});
- cfg.trials = find(eegdata{1, subj(i)}.trialinfo == 20);
- erp_r{1, i} = ft_timelockanalysis(cfg,eegdata{1, subj(i)});
- i
- end
- % grandaverage
- cfg = [];
- erp_l_ave = ft_timelockgrandaverage(cfg,erp_l{1,1},erp_l{1,2},erp_l{1,3},erp_l{1,4},erp_l{1,5},erp_l{1,6},...
- erp_l{1,7},erp_l{1,8},erp_l{1,9},erp_l{1,10},erp_l{1,11},erp_l{1,12},erp_l{1,13},erp_l{1,14},erp_l{1,15},...
- erp_l{1,16},erp_l{1,17},erp_l{1,18},erp_l{1,19},erp_l{1,20},erp_l{1,21});
- erp_r_ave = ft_timelockgrandaverage(cfg,erp_r{1,1},erp_r{1,2},erp_r{1,3},erp_r{1,4},erp_r{1,5},erp_r{1,6},...
- erp_r{1,7},erp_r{1,8},erp_r{1,9},erp_r{1,10},erp_r{1,11},erp_r{1,12},erp_r{1,13},erp_r{1,14},erp_r{1,15},...
- erp_r{1,16},erp_r{1,17},erp_r{1,18},erp_r{1,19},erp_r{1,20},erp_r{1,21});
- % plot
- cfg = [];
- cfg.showlabels = 'yes';
- cfg.fontsize = 6;
- cfg.layout = 'easycapM1.mat';
- % cfg.ylim = [-3e-13 3e-13];
- ft_multiplotER(cfg, erp_l{1, 2}, erp_r{1, 2});
- % ft_multiplotER(cfg, erp_l_ave, erp_r_ave);
- cfg = [];
- cfg.xlim = [-0.2 1.7];
- % cfg.ylim = [-1e-13 3e-13];
- cfg.channel = 'PO3';
- ft_singleplotER(cfg, erp_l_ave, erp_r_ave);
- cfg = [];
- cfg.xlim = [-0.2 1.7];
- % cfg.ylim = [-1e-13 3e-13];
- cfg.channel = 'PO4';
- ft_singleplotER(cfg, erp_l_ave, erp_r_ave);
- % 导出原始数据
- po3_erp_l=erp_l_ave.avg(45,:);
- po3_erp_r=erp_r_ave.avg(45,:);
- po4_erp_l=erp_l_ave.avg(46,:);
- po4_erp_r=erp_r_ave.avg(46,:);
- t=erp_l_ave.time;
- save('erp_fuse.mat','po3_erp_l','po3_erp_r','po4_erp_l','po4_erp_r','t');
- % 分开基线前和基线后
- cfg = [];
- cfg.toilim = [-0.2, 0];
- for i=1:length(eegdata)
- eegdata_bs{1,i} = ft_redefinetrial(cfg, eegdata{1,i});
- end
- cfg = [];
- cfg.toilim = [0, 1.7];
- for i=1:length(eegdata)
- eegdata_er{1,i} = ft_redefinetrial(cfg, eegdata{1,i});
- end
- % 分开左边先闪和右边先闪,各自计算erp
- subj=1:21;
- cfg = [];
- for i = 1:length(subj)
- cfg.trials = find(eegdata_bs{1, subj(i)}.trialinfo == 10);
- erp_bs_l{1, i} = ft_timelockanalysis(cfg,eegdata_bs{1, subj(i)});
- cfg.trials = find(eegdata_bs{1, subj(i)}.trialinfo == 20);
- erp_bs_r{1, i} = ft_timelockanalysis(cfg,eegdata_bs{1, subj(i)});
- cfg.trials = find(eegdata_er{1, subj(i)}.trialinfo == 10);
- erp_er_l{1, i} = ft_timelockanalysis(cfg,eegdata_er{1, subj(i)});
- cfg.trials = find(eegdata_er{1, subj(i)}.trialinfo == 20);
- erp_er_r{1, i} = ft_timelockanalysis(cfg,eegdata_er{1, subj(i)});
- i
- end
- % FFT analysis
- cfg = [];
- cfg.output = 'pow';
- cfg.channel = 'all';
- cfg.method = 'mtmfft';
- cfg.pad = 10;
- cfg.foi = 36:1:48;
- cfg.taper = 'hanning';
- for i=1:length(subj)
- erp_bs_l_fft{1, i} = ft_freqanalysis(cfg, erp_bs_l{1, i});
- erp_bs_r_fft{1, i} = ft_freqanalysis(cfg, erp_bs_r{1, i});
- erp_er_l_fft{1, i} = ft_freqanalysis(cfg, erp_er_l{1, i});
- erp_er_r_fft{1, i} = ft_freqanalysis(cfg, erp_er_r{1, i});
- i
- end
- % convert to zscore
- erp_er_l_fft_z=erp_er_l_fft;
- erp_er_r_fft_z=erp_er_r_fft;
- for i = 1:length(subj)
- erp_er_l_fft_z{1, i}.powspctrm = zscore(erp_er_l_fft{1, i}.powspctrm,0,2);
- erp_er_r_fft_z{1, i}.powspctrm = zscore(erp_er_r_fft{1, i}.powspctrm,0,2);
- end
- erp_er_l_fft_z_ave = erp_er_l_fft_z{1, 1};
- erp_er_r_fft_z_ave = erp_er_r_fft_z{1, 1};
- spct_er_l = 0;
- spct_er_r = 0;
- for i = 1:length(subj)
- spct_er_l = spct_er_l + erp_er_l_fft_z{1, i}.powspctrm;
- spct_er_r = spct_er_r + erp_er_r_fft_z{1, i}.powspctrm;
- end
- erp_er_l_fft_z_ave.powspctrm = spct_er_l/length(subj);
- erp_er_r_fft_z_ave.powspctrm = spct_er_r/length(subj);
- % plot
- cfg = [];
- cfg.parameter = 'powspctrm';
- cfg.showlabels = 'yes';
- cfg.layout = 'easycapM1.mat';
- figure;
- ft_multiplotER(cfg, erp_er_l_fft_z_ave);
- figure;
- ft_multiplotER(cfg, erp_er_r_fft_z_ave);
- % topo plot
- cfg = [];
- cfg.parameter = 'powspctrm';
- cfg.xlim = [42, 42];
- cfg.zlim = [-0.4, 2.4];
- cfg.colormap = brewermap([],'*RdBu');
- cfg.colorbar = 'yes';
- cfg.layout = 'easycapM1.mat';
- figure;
- ft_topoplotER(cfg, erp_er_l_fft_z_ave);
- figure;
- ft_topoplotER(cfg, erp_er_r_fft_z_ave);
- cfg.xlim = [44, 44];
- cfg.zlim = [-0.4, 2];
- figure;
- ft_topoplotER(cfg, erp_er_l_fft_z_ave);
- figure;
- ft_topoplotER(cfg, erp_er_r_fft_z_ave);
- % 导出频谱
- for i = 1:length(subj)
- spec_po3_l(i,:)=erp_er_l_fft_z{1, i}.powspctrm(45,:);
- spec_po3_r(i,:)=erp_er_r_fft_z{1, i}.powspctrm(45,:);
- spec_po4_l(i,:)=erp_er_l_fft_z{1, i}.powspctrm(46,:);
- spec_po4_r(i,:)=erp_er_r_fft_z{1, i}.powspctrm(46,:);
- end
- f=erp_er_l_fft_z_ave.freq;
- save('spect_fuse.mat','spec_po3_l','spec_po3_r','spec_po4_l','spec_po4_r','f');
- % 提取PO3和PO4的数值来统计
- % 44 hz
- for i = 1:length(subj)
- fft_po3_bs_l(i)=erp_bs_l_fft{1, i}.powspctrm(45,9);
- fft_po3_bs_r(i)=erp_bs_r_fft{1, i}.powspctrm(45,9);
- fft_po3_er_l(i)=erp_er_l_fft{1, i}.powspctrm(45,9);
- fft_po3_er_r(i)=erp_er_r_fft{1, i}.powspctrm(45,9);
- end
- fft_po3_44_bs=(fft_po3_bs_l+fft_po3_bs_r)/2;
- fft_po3_44_er=(fft_po3_er_l+fft_po3_er_r)/2;
- % 42 hz
- for i = 1:length(subj)
- fft_po4_bs_l(i)=erp_bs_l_fft{1, i}.powspctrm(46,7);
- fft_po4_bs_r(i)=erp_bs_r_fft{1, i}.powspctrm(46,7);
- fft_po4_er_l(i)=erp_er_l_fft{1, i}.powspctrm(46,7);
- fft_po4_er_r(i)=erp_er_r_fft{1, i}.powspctrm(46,7);
- end
- fft_po4_42_bs=(fft_po4_bs_l+fft_po4_bs_r)/2;
- fft_po4_42_er=(fft_po4_er_l+fft_po4_er_r)/2;
- save('spect_value_fuse.mat','fft_po3_44_bs','fft_po3_44_er','fft_po4_42_bs','fft_po4_42_er');
- %% 2. 抽取选择的电极上SSVEP的amplitude envelop
- subj=1:21;
- % filter
- cfg = [];
- cfg.bpfilter = 'yes';
- for i = 1:length(subj)
- cfg.bpfreq = [41.5, 42.5];
- cfg.trials = find(eegdata_er{1, subj(i)}.trialinfo == 10);
- eeg_42_l{1, i} = ft_preprocessing(cfg,eegdata_er{1, subj(i)});
- cfg.trials = find(eegdata_er{1, subj(i)}.trialinfo == 20);
- eeg_42_r{1, i} = ft_preprocessing(cfg,eegdata_er{1, subj(i)});
- i
- end
- for i = 1:length(subj)
- cfg.bpfreq = [43.5, 44.5];
- cfg.trials = find(eegdata_er{1, subj(i)}.trialinfo == 10);
- eeg_44_l{1, i} = ft_preprocessing(cfg,eegdata_er{1, subj(i)});
- cfg.trials = find(eegdata_er{1, subj(i)}.trialinfo == 20);
- eeg_44_r{1, i} = ft_preprocessing(cfg,eegdata_er{1, subj(i)});
- i
- end
- % envelope
- for i = 1:length(subj)
- for j = 1:160
- for m = 1:65
- [u1,l1]=envelope(eeg_42_l{1, i}.trial{1, j}(m,:),13,'peak');
- eeg_42_l{1, i}.trial{1, j}(m,:)=u1;
- [u2,l2]=envelope(eeg_42_r{1, i}.trial{1, j}(m,:),13,'peak');
- eeg_42_r{1, i}.trial{1, j}(m,:)=u2;
- [u3,l3]=envelope(eeg_44_l{1, i}.trial{1, j}(m,:),13,'peak');
- eeg_44_l{1, i}.trial{1, j}(m,:)=u3;
- [u4,l4]=envelope(eeg_44_r{1, i}.trial{1, j}(m,:),13,'peak');
- eeg_44_r{1, i}.trial{1, j}(m,:)=u4;
- end
- end
- i
- end
- % time-lock analysis
- cfg = [];
- for i = 1:length(subj)
- hilbert_42_l{1, i} = ft_timelockanalysis(cfg,eeg_42_l{1, i});
- hilbert_42_r{1, i} = ft_timelockanalysis(cfg,eeg_42_r{1, i});
- hilbert_44_l{1, i} = ft_timelockanalysis(cfg,eeg_44_l{1, i});
- hilbert_44_r{1, i} = ft_timelockanalysis(cfg,eeg_44_r{1, i});
- i
- end
- % grandaverage
- cfg = [];
- hilbert_42_l_ave = ft_timelockgrandaverage(cfg,hilbert_42_l{1,1},hilbert_42_l{1,2},hilbert_42_l{1,3},hilbert_42_l{1,4},hilbert_42_l{1,5},hilbert_42_l{1,6},...
- hilbert_42_l{1,7},hilbert_42_l{1,8},hilbert_42_l{1,9},hilbert_42_l{1,10},hilbert_42_l{1,11},hilbert_42_l{1,12},hilbert_42_l{1,13},hilbert_42_l{1,14},hilbert_42_l{1,15},...
- hilbert_42_l{1,16},hilbert_42_l{1,17},hilbert_42_l{1,18},hilbert_42_l{1,19},hilbert_42_l{1,20},hilbert_42_l{1,21});
- hilbert_42_r_ave = ft_timelockgrandaverage(cfg,hilbert_42_r{1,1},hilbert_42_r{1,2},hilbert_42_r{1,3},hilbert_42_r{1,4},hilbert_42_r{1,5},hilbert_42_r{1,6},...
- hilbert_42_r{1,7},hilbert_42_r{1,8},hilbert_42_r{1,9},hilbert_42_r{1,10},hilbert_42_r{1,11},hilbert_42_r{1,12},hilbert_42_r{1,13},hilbert_42_r{1,14},hilbert_42_r{1,15},...
- hilbert_42_r{1,16},hilbert_42_r{1,17},hilbert_42_r{1,18},hilbert_42_r{1,19},hilbert_42_r{1,20},hilbert_42_r{1,21});
- hilbert_44_l_ave = ft_timelockgrandaverage(cfg,hilbert_44_l{1,1},hilbert_44_l{1,2},hilbert_44_l{1,3},hilbert_44_l{1,4},hilbert_44_l{1,5},hilbert_44_l{1,6},...
- hilbert_44_l{1,7},hilbert_44_l{1,8},hilbert_44_l{1,9},hilbert_44_l{1,10},hilbert_44_l{1,11},hilbert_44_l{1,12},hilbert_44_l{1,13},hilbert_44_l{1,14},hilbert_44_l{1,15},...
- hilbert_44_l{1,16},hilbert_44_l{1,17},hilbert_44_l{1,18},hilbert_44_l{1,19},hilbert_44_l{1,20},hilbert_44_l{1,21});
- hilbert_44_r_ave = ft_timelockgrandaverage(cfg,hilbert_44_r{1,1},hilbert_44_r{1,2},hilbert_44_r{1,3},hilbert_44_r{1,4},hilbert_44_r{1,5},hilbert_44_r{1,6},...
- hilbert_44_r{1,7},hilbert_44_r{1,8},hilbert_44_r{1,9},hilbert_44_r{1,10},hilbert_44_r{1,11},hilbert_44_r{1,12},hilbert_44_r{1,13},hilbert_44_r{1,14},hilbert_44_r{1,15},...
- hilbert_44_r{1,16},hilbert_44_r{1,17},hilbert_44_r{1,18},hilbert_44_r{1,19},hilbert_44_r{1,20},hilbert_44_r{1,21});
- % plot
- cfg = [];
- cfg.showlabels = 'yes';
- cfg.fontsize = 6;
- cfg.layout = 'easycapM1.mat';
- % cfg.ylim = [-3e-13 3e-13];
- ft_multiplotER(cfg, hilbert_42_l{1, 1}, hilbert_42_r{1, 1});
- cfg = [];
- cfg.xlim = [0 1.7];
- % cfg.ylim = [-1e-13 3e-13];
- cfg.channel = 'PO3';
- ft_singleplotER(cfg, hilbert_42_l_ave, hilbert_42_r_ave);
- cfg = [];
- cfg.xlim = [0 1.7];
- % cfg.ylim = [-1e-13 3e-13];
- cfg.channel = 'PO4';
- ft_singleplotER(cfg, hilbert_42_l_ave, hilbert_42_r_ave);
- %% 3. 两个条件的envelop之间的关系,考察它们之间的相位差
- % FFT analysis
- cfg = [];
- cfg.output = 'fooof_peaks';
- cfg.channel = 'all';
- cfg.method = 'mtmfft';
- cfg.pad = 10;
- cfg.foi = 2:0.2:10;
- cfg.taper = 'hanning';
- for i=1:length(subj)
- eeg_42_l_fft{1, i} = ft_freqanalysis(cfg, eeg_42_l{1, i});
- eeg_42_r_fft{1, i} = ft_freqanalysis(cfg, eeg_42_r{1, i});
- eeg_44_l_fft{1, i} = ft_freqanalysis(cfg, eeg_44_l{1, i});
- eeg_44_r_fft{1, i} = ft_freqanalysis(cfg, eeg_44_r{1, i});
- i
- end
- freq=2:0.2:10;
- % grand average
- eeg_42_l_fft_ave = eeg_42_l_fft{1, 1};
- eeg_42_r_fft_ave = eeg_42_r_fft{1, 1};
- eeg_44_l_fft_ave = eeg_44_l_fft{1, 1};
- eeg_44_r_fft_ave = eeg_44_r_fft{1, 1};
- for i = 1:length(subj)
- spct_42_l(i,:,:) = eeg_42_l_fft{1, i}.powspctrm;
- spct_42_r(i,:,:) = eeg_42_r_fft{1, i}.powspctrm;
- spct_44_l(i,:,:) = eeg_44_l_fft{1, i}.powspctrm;
- spct_44_r(i,:,:) = eeg_44_r_fft{1, i}.powspctrm;
- end
- eeg_42_l_fft_ave.powspctrm = squeeze(mean(spct_42_l));
- eeg_42_r_fft_ave.powspctrm = squeeze(mean(spct_42_r));
- eeg_44_l_fft_ave.powspctrm = squeeze(mean(spct_44_l));
- eeg_44_r_fft_ave.powspctrm = squeeze(mean(spct_44_r));
- % plot
- cfg = [];
- cfg.parameter = 'powspctrm';
- cfg.showlabels = 'yes';
- cfg.layout = 'easycapM1.mat';
- figure;
- ft_multiplotER(cfg, eeg_42_l_fft_ave, eeg_42_r_fft_ave);
- figure;
- ft_multiplotER(cfg, eeg_44_l_fft_ave, eeg_44_r_fft_ave);
- % topo plot
- eeg_42_l_fft_temp=eeg_42_l_fft_ave;
- eeg_42_l_fft_temp.powspctrm=(eeg_42_l_fft_ave.powspctrm+eeg_42_r_fft_ave.powspctrm)/2;
- a=eeg_42_l_fft_temp.powspctrm(47, :);
- eeg_42_l_fft_temp.powspctrm(47, :)=eeg_42_l_fft_temp.powspctrm(6, :);
- eeg_42_l_fft_temp.powspctrm(6, :)=a;
- eeg_44_l_fft_temp=eeg_44_l_fft_ave;
- eeg_44_l_fft_temp.powspctrm=(eeg_44_l_fft_ave.powspctrm+eeg_44_r_fft_ave.powspctrm)/2;
- b=eeg_44_l_fft_temp.powspctrm(12, :);
- eeg_44_l_fft_temp.powspctrm(12, :)=eeg_44_l_fft_temp.powspctrm(9, :);
- eeg_44_l_fft_temp.powspctrm(9, :)=b;
- c=eeg_44_l_fft_temp.powspctrm(48, :);
- eeg_44_l_fft_temp.powspctrm(48, :)=eeg_44_l_fft_temp.powspctrm(45, :);
- eeg_44_l_fft_temp.powspctrm(45, :)=c;
- cfg = [];
- cfg.parameter = 'powspctrm';
- cfg.xlim = [4.4, 4.4];
- cfg.zlim = [6.4, 7.4];
- cfg.colormap = brewermap([],'Reds');
- cfg.colorbar = 'yes';
- cfg.layout = 'easycapM1.mat';
- ft_topoplotER(cfg, eeg_42_l_fft_temp);
- cfg.xlim = [6.2, 6.2];
- cfg.zlim = [12.5, 14];
- ft_topoplotER(cfg, eeg_44_l_fft_temp);
- % permutation test
- % FFT analysis
- cfg = [];
- cfg.output = 'fooof_peaks';
- cfg.channel = 'all';
- cfg.method = 'mtmfft';
- cfg.pad = 10;
- cfg.foi = 2:0.2:10;
- cfg.taper = 'hanning';
- eeg_42_l_temp=eeg_42_l;
- eeg_42_r_temp=eeg_42_r;
- eeg_44_l_temp=eeg_44_l;
- eeg_44_r_temp=eeg_44_r;
- parob=parpool;
- for n=1:1000
- % shuffle
- parfor i=1:length(subj)
- for j=1:160
- for m=1:65
- eeg_42_l_temp{1, i}.trial{1, j}(m,:)=eeg_42_l{1, i}.trial{1, j}(m,randperm(850));
- eeg_42_r_temp{1, i}.trial{1, j}(m,:)=eeg_42_r{1, i}.trial{1, j}(m,randperm(850));
- eeg_44_l_temp{1, i}.trial{1, j}(m,:)=eeg_44_l{1, i}.trial{1, j}(m,randperm(850));
- eeg_44_r_temp{1, i}.trial{1, j}(m,:)=eeg_44_r{1, i}.trial{1, j}(m,randperm(850));
- end
- end
- eeg_42_l_fft_temp{1, i} = ft_freqanalysis(cfg, eeg_42_l_temp{1, i});
- eeg_42_r_fft_temp{1, i} = ft_freqanalysis(cfg, eeg_42_r_temp{1, i});
- eeg_44_l_fft_temp{1, i} = ft_freqanalysis(cfg, eeg_44_l_temp{1, i});
- eeg_44_r_fft_temp{1, i} = ft_freqanalysis(cfg, eeg_44_r_temp{1, i});
- end
- % grand average
- spct_42_l = 0;
- spct_42_r = 0;
- spct_44_l = 0;
- spct_44_r = 0;
- for i = 1:length(subj)
- spct_42_l = spct_42_l + eeg_42_l_fft_temp{1, i}.powspctrm;
- spct_42_r = spct_42_r + eeg_42_r_fft_temp{1, i}.powspctrm;
- spct_44_l = spct_44_l + eeg_44_l_fft_temp{1, i}.powspctrm;
- spct_44_r = spct_44_r + eeg_44_r_fft_temp{1, i}.powspctrm;
- end
- eeg_42_l_shuf(n,:,:) = spct_42_l/length(subj);
- eeg_42_r_shuf(n,:,:) = spct_42_r/length(subj);
- eeg_44_l_shuf(n,:,:) = spct_44_l/length(subj);
- eeg_44_r_shuf(n,:,:) = spct_44_r/length(subj);
- n
- end
- delete(parob);
- save('env_fft_shuf_fuse.mat','eeg_42_l_shuf','eeg_42_r_shuf','eeg_44_l_shuf','eeg_44_r_shuf');
- % 取95%的阈限
- load('env_fft_shuf_fuse.mat');
- eeg_42_l_thre = squeeze(prctile(eeg_42_l_shuf,95,1));
- eeg_42_r_thre = squeeze(prctile(eeg_42_r_shuf,95,1));
- eeg_44_l_thre = squeeze(prctile(eeg_44_l_shuf,95,1));
- eeg_44_r_thre = squeeze(prctile(eeg_44_r_shuf,95,1));
- % phase analysis
- cfg = [];
- cfg.output = 'fourier';
- cfg.channel = 'all';
- cfg.method = 'mtmfft';
- cfg.pad = 10;
- cfg.foi = 2:0.2:10;
- cfg.taper = 'hanning';
- for i=1:length(subj)
- eeg_42_l_phase{1, i} = ft_freqanalysis(cfg, eeg_42_l{1, i});
- eeg_42_r_phase{1, i} = ft_freqanalysis(cfg, eeg_42_r{1, i});
- eeg_44_l_phase{1, i} = ft_freqanalysis(cfg, eeg_44_l{1, i});
- eeg_44_r_phase{1, i} = ft_freqanalysis(cfg, eeg_44_r{1, i});
- i
- end
- for i=1:length(subj)
- po4_42_l_phase(i) = circ_mean(angle(eeg_42_l_phase{1, i}.fourierspctrm(:,46,17)));
- po4_42_r_phase(i) = circ_mean(angle(eeg_42_r_phase{1, i}.fourierspctrm(:,46,17)));
- po3_44_l_phase(i) = circ_mean(angle(eeg_44_l_phase{1, i}.fourierspctrm(:,45,17)));
- po3_44_r_phase(i) = circ_mean(angle(eeg_44_r_phase{1, i}.fourierspctrm(:,45,17)));
- i
- end
- phase_l_diff = circ_dist(po4_42_l_phase, po3_44_l_phase);
- phase_r_diff = circ_dist(po3_44_r_phase, po4_42_r_phase);
- % plot
- figure;
- subplot(131);
- circ_plot(po4_42_l_phase','hist',[],12,false,true,'linewidth',2,'color','r');
- subplot(132);
- circ_plot(po3_44_l_phase','hist',[],12,false,true,'linewidth',2,'color','r');
- subplot(133);
- circ_plot(phase_l_diff','hist',[],12,false,true,'linewidth',2,'color','r');
- circ_rad2ang(circ_mean(po4_42_l_phase,[],2));
- [pval z] = circ_rtest(po4_42_l_phase); % non-uniform
- circ_rad2ang(circ_mean(po3_44_l_phase,[],2));
- [pval z] = circ_rtest(po3_44_l_phase); % non-uniform
- circ_rad2ang(circ_mean(phase_l_diff,[],2));
- [pval z] = circ_rtest(phase_l_diff); % non-uniform
- figure;
- subplot(131);
- circ_plot(po3_44_r_phase','hist',[],12,false,true,'linewidth',2,'color','r');
- subplot(132);
- circ_plot(po4_42_r_phase','hist',[],12,false,true,'linewidth',2,'color','r');
- subplot(133);
- circ_plot(phase_r_diff','hist',[],12,false,true,'linewidth',2,'color','r');
- circ_rad2ang(circ_mean(po3_44_r_phase,[],2));
- [pval z] = circ_rtest(po3_44_r_phase); % non-uniform
- circ_rad2ang(circ_mean(po4_42_r_phase,[],2));
- [pval z] = circ_rtest(po4_42_r_phase); % non-uniform
- circ_rad2ang(circ_mean(phase_r_diff,[],2));
- [pval z] = circ_rtest(phase_r_diff); % non-uniform
- [pval z] = circ_vtest(phase_l_diff,circ_ang2rad(0)); % difference to 0
- [pval z] = circ_vtest(phase_r_diff,circ_ang2rad(0)); % difference to 0
- phase_diff_fuse=circ_mean([phase_l_diff; phase_r_diff],[],1);
- save('phase_diff_fuse.mat','phase_diff_fuse');
- circ_rad2ang(circ_mean(circ_dist(phase_diff_single, phase_diff_fuse),[],2));
- [pval, F] = circ_htest(phase_diff_single, phase_diff_fuse);
- circ_plot(circ_dist(phase_diff_single, phase_diff_fuse)','hist',[],12,false,true,'linewidth',2,'color','r');
- %% 4. Phase-amplitude coupling, SSVEP的amplitude与某个地方脑电的phase有coupling。表现为SSVEP envelope与脑电phase的coherence
- % 将提取EEG的频谱,然后跟ssvep的envelope计算coherence
- % FFT on eeg
- cfg = [];
- cfg.output = 'fourier';
- cfg.channel = 'all';
- cfg.method = 'mtmfft';
- cfg.pad = 10;
- cfg.foi = 2:0.2:10;
- cfg.taper = 'hanning';
- for i=1:length(subj)
- cfg.trials = find(eegdata_er{1, subj(i)}.trialinfo == 10);
- eeg_fft_l{1, i} = ft_freqanalysis(cfg, eegdata_er{1, subj(i)});
- cfg.trials = find(eegdata_er{1, subj(i)}.trialinfo == 20);
- eeg_fft_r{1, i} = ft_freqanalysis(cfg, eegdata_er{1, subj(i)});
- i
- end
- % 选择电极,替换IO。计算IO与其他电极的coherence
- % 左边先开始闪,PO4(46)替换
- for i=1:length(subj)
- eeg_fft_l{1, i}.fourierspctrm(:,20,:)=eeg_42_l_phase{1, i}.fourierspctrm(:,46,:);
- end
- cfg = [];
- cfg.method = 'coh';
- cfg.channelcmb = {'IO' 'Fp1'; 'IO' 'Fp2'; 'IO' 'F3'; 'IO' 'F4'; 'IO' 'C3'; 'IO' 'C4';...
- 'IO' 'P3'; 'IO' 'P4'; 'IO' 'O1'; 'IO' 'O2'; 'IO' 'F7'; 'IO' 'F8'; 'IO' 'T7';...
- 'IO' 'T8'; 'IO' 'P7'; 'IO' 'P8'; 'IO' 'Fz'; 'IO' 'Cz'; 'IO' 'Pz'; 'IO' 'FC1';...
- 'IO' 'FC2'; 'IO' 'CP1'; 'IO' 'CP2'; 'IO' 'FC5'; 'IO' 'FC6'; 'IO' 'CP5'; 'IO' 'CP6';...
- 'IO' 'FT9'; 'IO' 'FT10'; 'IO' 'TP9';'IO' 'TP10';'IO' 'F1';'IO' 'F2';'IO' 'C1';...
- 'IO' 'C2';'IO' 'P1';'IO' 'P2';'IO' 'AF3';'IO' 'AF4';'IO' 'FC3';'IO' 'FC4';...
- 'IO' 'CP3';'IO' 'CP4';'IO' 'PO3';'IO' 'PO4';'IO' 'F5';'IO' 'F6';'IO' 'C5';...
- 'IO' 'C6';'IO' 'P5';'IO' 'P6';'IO' 'AF7';'IO' 'AF8';'IO' 'FT7';'IO' 'FT8';...
- 'IO' 'TP7';'IO' 'TP8';'IO' 'PO7';'IO' 'PO8';'IO' 'Fpz';'IO' 'CPz';'IO' 'POz';...
- 'IO' 'Oz';'IO' 'FCz'};
- for i=1:length(subj)
- coh_l_po4{1, i}= ft_connectivityanalysis(cfg, eeg_fft_l{1, i});
- end
- % 左边先开始闪,PO3(45)
- for i=1:length(subj)
- eeg_fft_l{1, i}.fourierspctrm(:,20,:)=eeg_44_l_phase{1, i}.fourierspctrm(:,45,:);
- end
- cfg = [];
- cfg.method = 'coh';
- cfg.channelcmb = {'IO' 'Fp1'; 'IO' 'Fp2'; 'IO' 'F3'; 'IO' 'F4'; 'IO' 'C3'; 'IO' 'C4';...
- 'IO' 'P3'; 'IO' 'P4'; 'IO' 'O1'; 'IO' 'O2'; 'IO' 'F7'; 'IO' 'F8'; 'IO' 'T7';...
- 'IO' 'T8'; 'IO' 'P7'; 'IO' 'P8'; 'IO' 'Fz'; 'IO' 'Cz'; 'IO' 'Pz'; 'IO' 'FC1';...
- 'IO' 'FC2'; 'IO' 'CP1'; 'IO' 'CP2'; 'IO' 'FC5'; 'IO' 'FC6'; 'IO' 'CP5'; 'IO' 'CP6';...
- 'IO' 'FT9'; 'IO' 'FT10'; 'IO' 'TP9';'IO' 'TP10';'IO' 'F1';'IO' 'F2';'IO' 'C1';...
- 'IO' 'C2';'IO' 'P1';'IO' 'P2';'IO' 'AF3';'IO' 'AF4';'IO' 'FC3';'IO' 'FC4';...
- 'IO' 'CP3';'IO' 'CP4';'IO' 'PO3';'IO' 'PO4';'IO' 'F5';'IO' 'F6';'IO' 'C5';...
- 'IO' 'C6';'IO' 'P5';'IO' 'P6';'IO' 'AF7';'IO' 'AF8';'IO' 'FT7';'IO' 'FT8';...
- 'IO' 'TP7';'IO' 'TP8';'IO' 'PO7';'IO' 'PO8';'IO' 'Fpz';'IO' 'CPz';'IO' 'POz';...
- 'IO' 'Oz';'IO' 'FCz'};
- for i=1:length(subj)
- coh_l_po3{1, i}= ft_connectivityanalysis(cfg, eeg_fft_l{1, i});
- end
- % 右边先开始闪,PO3(45)
- for i=1:length(subj)
- eeg_fft_r{1, i}.fourierspctrm(:,20,:)=eeg_44_r_phase{1, i}.fourierspctrm(:,45,:);
- end
- cfg = [];
- cfg.method = 'coh';
- cfg.channelcmb = {'IO' 'Fp1'; 'IO' 'Fp2'; 'IO' 'F3'; 'IO' 'F4'; 'IO' 'C3'; 'IO' 'C4';...
- 'IO' 'P3'; 'IO' 'P4'; 'IO' 'O1'; 'IO' 'O2'; 'IO' 'F7'; 'IO' 'F8'; 'IO' 'T7';...
- 'IO' 'T8'; 'IO' 'P7'; 'IO' 'P8'; 'IO' 'Fz'; 'IO' 'Cz'; 'IO' 'Pz'; 'IO' 'FC1';...
- 'IO' 'FC2'; 'IO' 'CP1'; 'IO' 'CP2'; 'IO' 'FC5'; 'IO' 'FC6'; 'IO' 'CP5'; 'IO' 'CP6';...
- 'IO' 'FT9'; 'IO' 'FT10'; 'IO' 'TP9';'IO' 'TP10';'IO' 'F1';'IO' 'F2';'IO' 'C1';...
- 'IO' 'C2';'IO' 'P1';'IO' 'P2';'IO' 'AF3';'IO' 'AF4';'IO' 'FC3';'IO' 'FC4';...
- 'IO' 'CP3';'IO' 'CP4';'IO' 'PO3';'IO' 'PO4';'IO' 'F5';'IO' 'F6';'IO' 'C5';...
- 'IO' 'C6';'IO' 'P5';'IO' 'P6';'IO' 'AF7';'IO' 'AF8';'IO' 'FT7';'IO' 'FT8';...
- 'IO' 'TP7';'IO' 'TP8';'IO' 'PO7';'IO' 'PO8';'IO' 'Fpz';'IO' 'CPz';'IO' 'POz';...
- 'IO' 'Oz';'IO' 'FCz'};
- for i=1:length(subj)
- coh_r_po3{1, i}= ft_connectivityanalysis(cfg, eeg_fft_r{1, i});
- end
- % 右边先开始闪,PO4(46)
- for i=1:length(subj)
- eeg_fft_r{1, i}.fourierspctrm(:,20,:)=eeg_42_r_phase{1, i}.fourierspctrm(:,46,:);
- end
- cfg = [];
- cfg.method = 'coh';
- cfg.channelcmb = {'IO' 'Fp1'; 'IO' 'Fp2'; 'IO' 'F3'; 'IO' 'F4'; 'IO' 'C3'; 'IO' 'C4';...
- 'IO' 'P3'; 'IO' 'P4'; 'IO' 'O1'; 'IO' 'O2'; 'IO' 'F7'; 'IO' 'F8'; 'IO' 'T7';...
- 'IO' 'T8'; 'IO' 'P7'; 'IO' 'P8'; 'IO' 'Fz'; 'IO' 'Cz'; 'IO' 'Pz'; 'IO' 'FC1';...
- 'IO' 'FC2'; 'IO' 'CP1'; 'IO' 'CP2'; 'IO' 'FC5'; 'IO' 'FC6'; 'IO' 'CP5'; 'IO' 'CP6';...
- 'IO' 'FT9'; 'IO' 'FT10'; 'IO' 'TP9';'IO' 'TP10';'IO' 'F1';'IO' 'F2';'IO' 'C1';...
- 'IO' 'C2';'IO' 'P1';'IO' 'P2';'IO' 'AF3';'IO' 'AF4';'IO' 'FC3';'IO' 'FC4';...
- 'IO' 'CP3';'IO' 'CP4';'IO' 'PO3';'IO' 'PO4';'IO' 'F5';'IO' 'F6';'IO' 'C5';...
- 'IO' 'C6';'IO' 'P5';'IO' 'P6';'IO' 'AF7';'IO' 'AF8';'IO' 'FT7';'IO' 'FT8';...
- 'IO' 'TP7';'IO' 'TP8';'IO' 'PO7';'IO' 'PO8';'IO' 'Fpz';'IO' 'CPz';'IO' 'POz';...
- 'IO' 'Oz';'IO' 'FCz'};
- for i=1:length(subj)
- coh_r_po4{1, i}= ft_connectivityanalysis(cfg, eeg_fft_r{1, i});
- end
- % the coh value of 4 hz
- for i=1:length(subj)
- coh_l_po4_val(:,i)=coh_l_po4{1, i}.cohspctrm(:,13);
- coh_l_po3_val(:,i)=coh_l_po3{1, i}.cohspctrm(:,22);
- coh_r_po4_val(:,i)=coh_r_po4{1, i}.cohspctrm(:,13);
- coh_r_po3_val(:,i)=coh_r_po3{1, i}.cohspctrm(:,22);
- end
- % topo plot
- chann_label=eegdata{1, 1}.label;
- chann_label(20)=[];
- cfg = [];
- cfg.layout = 'easycapM1.mat';
- cfg.xlim = 'maxmin'; % time limitation
- % cfg.zlim = [0.5 1];
- % cfg.style = 'straight';
- cfg.colorbar = 'yes';
- cfg.marker = 'on';
- cfg.comment = 'xlim';
- cfg.commentpos = 'lefttop';
- coh_l_po4_plot = {};
- coh_l_po4_plot.avg = mean(coh_l_po4_val,2); % data definition, channel * time
- coh_l_po4_plot.time = 1; % time definition
- coh_l_po4_plot.dimord = 'chan_time';
- coh_l_po4_plot.label = chann_label;
- figure;
- ft_topoplotER(cfg, coh_l_po4_plot);
- title('coh_l_po4');
- axis tight;
- coh_l_po3_plot = {};
- coh_l_po3_plot.avg = mean(coh_l_po3_val,2); % data definition, channel * time
- coh_l_po3_plot.time = 1; % time definition
- coh_l_po3_plot.dimord = 'chan_time';
- coh_l_po3_plot.label = chann_label;
- figure;
- ft_topoplotER(cfg, coh_l_po3_plot);
- title('coh_l_po3');
- axis tight;
- coh_r_po3_plot = {};
- coh_r_po3_plot.avg = mean(coh_r_po3_val,2); % data definition, channel * time
- coh_r_po3_plot.time = 1; % time definition
- coh_r_po3_plot.dimord = 'chan_time';
- coh_r_po3_plot.label = chann_label;
- figure;
- ft_topoplotER(cfg, coh_r_po3_plot);
- title('coh_r_po3');
- axis tight;
- coh_r_po4_plot = {};
- coh_r_po4_plot.avg = mean(coh_r_po4_val,2); % data definition, channel * time
- coh_r_po4_plot.time = 1; % time definition
- coh_r_po4_plot.dimord = 'chan_time';
- coh_r_po4_plot.label = chann_label;
- figure;
- ft_topoplotER(cfg, coh_r_po4_plot);
- title('coh_r_po3');
- axis tight;
- % permutation test
- eegdata_er_sel=eegdata_er(subj);
- parob=parpool;
- for n=1:1000
- % shuffle
- eegdata_er_temp=eegdata_er_sel;
- parfor i=1:length(subj)
- for j=1:320
- for m=1:65
- eegdata_er_temp{1, i}.trial{1, j}(m,:)=eegdata_er_sel{1, i}.trial{1, j}(m,randperm(850));
- end
- end
- end
- % FFT on eeg
- cfg = [];
- cfg.output = 'fourier';
- cfg.channel = 'all';
- cfg.method = 'mtmfft';
- cfg.pad = 10;
- cfg.foi = 2:0.2:10;
- cfg.taper = 'hanning';
- for i=1:length(subj)
- cfg.trials = find(eegdata_er_temp{1, i}.trialinfo == 10);
- eeg_fft_l_temp{1, i} = ft_freqanalysis(cfg, eegdata_er_temp{1, i});
- cfg.trials = find(eegdata_er_temp{1, i}.trialinfo == 20);
- eeg_fft_r_temp{1, i} = ft_freqanalysis(cfg, eegdata_er_temp{1, i});
- end
- % 选择电极,替换IO。计算IO与其他电极的coherence
- % 左边先开始闪,PO4(46)替换
- for i=1:length(subj)
- eeg_fft_l_temp{1, i}.fourierspctrm(:,20,:)=eeg_42_l_phase{1, i}.fourierspctrm(:,46,:);
- end
- cfg = [];
- cfg.method = 'coh';
- cfg.channelcmb = {'IO' 'Fp1'; 'IO' 'Fp2'; 'IO' 'F3'; 'IO' 'F4'; 'IO' 'C3'; 'IO' 'C4';...
- 'IO' 'P3'; 'IO' 'P4'; 'IO' 'O1'; 'IO' 'O2'; 'IO' 'F7'; 'IO' 'F8'; 'IO' 'T7';...
- 'IO' 'T8'; 'IO' 'P7'; 'IO' 'P8'; 'IO' 'Fz'; 'IO' 'Cz'; 'IO' 'Pz'; 'IO' 'FC1';...
- 'IO' 'FC2'; 'IO' 'CP1'; 'IO' 'CP2'; 'IO' 'FC5'; 'IO' 'FC6'; 'IO' 'CP5'; 'IO' 'CP6';...
- 'IO' 'FT9'; 'IO' 'FT10'; 'IO' 'TP9';'IO' 'TP10';'IO' 'F1';'IO' 'F2';'IO' 'C1';...
- 'IO' 'C2';'IO' 'P1';'IO' 'P2';'IO' 'AF3';'IO' 'AF4';'IO' 'FC3';'IO' 'FC4';...
- 'IO' 'CP3';'IO' 'CP4';'IO' 'PO3';'IO' 'PO4';'IO' 'F5';'IO' 'F6';'IO' 'C5';...
- 'IO' 'C6';'IO' 'P5';'IO' 'P6';'IO' 'AF7';'IO' 'AF8';'IO' 'FT7';'IO' 'FT8';...
- 'IO' 'TP7';'IO' 'TP8';'IO' 'PO7';'IO' 'PO8';'IO' 'Fpz';'IO' 'CPz';'IO' 'POz';...
- 'IO' 'Oz';'IO' 'FCz'};
- for i=1:length(subj)
- coh_l_po4_temp{1, i}= ft_connectivityanalysis(cfg, eeg_fft_l_temp{1, i});
- coh_l_po4_temp_val(i,:,:)=coh_l_po4_temp{1, i}.cohspctrm;
- end
- % 左边先开始闪,PO3(45)
- for i=1:length(subj)
- eeg_fft_l_temp{1, i}.fourierspctrm(:,20,:)=eeg_44_l_phase{1, i}.fourierspctrm(:,45,:);
- end
- cfg = [];
- cfg.method = 'coh';
- cfg.channelcmb = {'IO' 'Fp1'; 'IO' 'Fp2'; 'IO' 'F3'; 'IO' 'F4'; 'IO' 'C3'; 'IO' 'C4';...
- 'IO' 'P3'; 'IO' 'P4'; 'IO' 'O1'; 'IO' 'O2'; 'IO' 'F7'; 'IO' 'F8'; 'IO' 'T7';...
- 'IO' 'T8'; 'IO' 'P7'; 'IO' 'P8'; 'IO' 'Fz'; 'IO' 'Cz'; 'IO' 'Pz'; 'IO' 'FC1';...
- 'IO' 'FC2'; 'IO' 'CP1'; 'IO' 'CP2'; 'IO' 'FC5'; 'IO' 'FC6'; 'IO' 'CP5'; 'IO' 'CP6';...
- 'IO' 'FT9'; 'IO' 'FT10'; 'IO' 'TP9';'IO' 'TP10';'IO' 'F1';'IO' 'F2';'IO' 'C1';...
- 'IO' 'C2';'IO' 'P1';'IO' 'P2';'IO' 'AF3';'IO' 'AF4';'IO' 'FC3';'IO' 'FC4';...
- 'IO' 'CP3';'IO' 'CP4';'IO' 'PO3';'IO' 'PO4';'IO' 'F5';'IO' 'F6';'IO' 'C5';...
- 'IO' 'C6';'IO' 'P5';'IO' 'P6';'IO' 'AF7';'IO' 'AF8';'IO' 'FT7';'IO' 'FT8';...
- 'IO' 'TP7';'IO' 'TP8';'IO' 'PO7';'IO' 'PO8';'IO' 'Fpz';'IO' 'CPz';'IO' 'POz';...
- 'IO' 'Oz';'IO' 'FCz'};
- for i=1:length(subj)
- coh_l_po3_temp{1, i}= ft_connectivityanalysis(cfg, eeg_fft_l_temp{1, i});
- coh_l_po3_temp_val(i,:,:)=coh_l_po3_temp{1, i}.cohspctrm;
- end
- % 右边先开始闪,PO3(45)
- for i=1:length(subj)
- eeg_fft_r_temp{1, i}.fourierspctrm(:,20,:)=eeg_44_r_phase{1, i}.fourierspctrm(:,45,:);
- end
- cfg = [];
- cfg.method = 'coh';
- cfg.channelcmb = {'IO' 'Fp1'; 'IO' 'Fp2'; 'IO' 'F3'; 'IO' 'F4'; 'IO' 'C3'; 'IO' 'C4';...
- 'IO' 'P3'; 'IO' 'P4'; 'IO' 'O1'; 'IO' 'O2'; 'IO' 'F7'; 'IO' 'F8'; 'IO' 'T7';...
- 'IO' 'T8'; 'IO' 'P7'; 'IO' 'P8'; 'IO' 'Fz'; 'IO' 'Cz'; 'IO' 'Pz'; 'IO' 'FC1';...
- 'IO' 'FC2'; 'IO' 'CP1'; 'IO' 'CP2'; 'IO' 'FC5'; 'IO' 'FC6'; 'IO' 'CP5'; 'IO' 'CP6';...
- 'IO' 'FT9'; 'IO' 'FT10'; 'IO' 'TP9';'IO' 'TP10';'IO' 'F1';'IO' 'F2';'IO' 'C1';...
- 'IO' 'C2';'IO' 'P1';'IO' 'P2';'IO' 'AF3';'IO' 'AF4';'IO' 'FC3';'IO' 'FC4';...
- 'IO' 'CP3';'IO' 'CP4';'IO' 'PO3';'IO' 'PO4';'IO' 'F5';'IO' 'F6';'IO' 'C5';...
- 'IO' 'C6';'IO' 'P5';'IO' 'P6';'IO' 'AF7';'IO' 'AF8';'IO' 'FT7';'IO' 'FT8';...
- 'IO' 'TP7';'IO' 'TP8';'IO' 'PO7';'IO' 'PO8';'IO' 'Fpz';'IO' 'CPz';'IO' 'POz';...
- 'IO' 'Oz';'IO' 'FCz'};
- for i=1:length(subj)
- coh_r_po3_temp{1, i}= ft_connectivityanalysis(cfg, eeg_fft_r_temp{1, i});
- coh_r_po3_temp_val(i,:,:)=coh_r_po3_temp{1, i}.cohspctrm;
- end
- % 右边先开始闪,PO4(46)
- for i=1:length(subj)
- eeg_fft_r_temp{1, i}.fourierspctrm(:,20,:)=eeg_42_r_phase{1, i}.fourierspctrm(:,46,:);
- end
- cfg = [];
- cfg.method = 'coh';
- cfg.channelcmb = {'IO' 'Fp1'; 'IO' 'Fp2'; 'IO' 'F3'; 'IO' 'F4'; 'IO' 'C3'; 'IO' 'C4';...
- 'IO' 'P3'; 'IO' 'P4'; 'IO' 'O1'; 'IO' 'O2'; 'IO' 'F7'; 'IO' 'F8'; 'IO' 'T7';...
- 'IO' 'T8'; 'IO' 'P7'; 'IO' 'P8'; 'IO' 'Fz'; 'IO' 'Cz'; 'IO' 'Pz'; 'IO' 'FC1';...
- 'IO' 'FC2'; 'IO' 'CP1'; 'IO' 'CP2'; 'IO' 'FC5'; 'IO' 'FC6'; 'IO' 'CP5'; 'IO' 'CP6';...
- 'IO' 'FT9'; 'IO' 'FT10'; 'IO' 'TP9';'IO' 'TP10';'IO' 'F1';'IO' 'F2';'IO' 'C1';...
- 'IO' 'C2';'IO' 'P1';'IO' 'P2';'IO' 'AF3';'IO' 'AF4';'IO' 'FC3';'IO' 'FC4';...
- 'IO' 'CP3';'IO' 'CP4';'IO' 'PO3';'IO' 'PO4';'IO' 'F5';'IO' 'F6';'IO' 'C5';...
- 'IO' 'C6';'IO' 'P5';'IO' 'P6';'IO' 'AF7';'IO' 'AF8';'IO' 'FT7';'IO' 'FT8';...
- 'IO' 'TP7';'IO' 'TP8';'IO' 'PO7';'IO' 'PO8';'IO' 'Fpz';'IO' 'CPz';'IO' 'POz';...
- 'IO' 'Oz';'IO' 'FCz'};
- for i=1:length(subj)
- coh_r_po4_temp{1, i}= ft_connectivityanalysis(cfg, eeg_fft_r_temp{1, i});
- coh_r_po4_temp_val(i,:,:)=coh_r_po4_temp{1, i}.cohspctrm;
- end
- coh_l_po4_shuf(n,:,:)=mean(coh_l_po4_temp_val,1);
- coh_l_po3_shuf(n,:,:)=mean(coh_l_po3_temp_val,1);
- coh_r_po3_shuf(n,:,:)=mean(coh_r_po3_temp_val,1);
- coh_r_po4_shuf(n,:,:)=mean(coh_r_po4_temp_val,1);
- n
- end
- delete(parob);
- save('coh_shuf_fuse.mat','coh_l_po4_shuf','coh_l_po3_shuf','coh_r_po3_shuf','coh_r_po4_shuf');
- % 取百分位数
- load('coh_shuf_fuse.mat');
- coh_l_po3_shuf_temp=squeeze(coh_l_po3_shuf(:,:,22));
- coh_l_po4_shuf_temp=squeeze(coh_l_po4_shuf(:,:,13));
- coh_r_po3_shuf_temp=squeeze(coh_r_po3_shuf(:,:,22));
- coh_r_po4_shuf_temp=squeeze(coh_r_po4_shuf(:,:,13));
- coh_l_po3_val_m=mean(coh_l_po3_val,2);
- coh_l_po4_val_m=mean(coh_l_po4_val,2);
- coh_r_po3_val_m=mean(coh_r_po3_val,2);
- coh_r_po4_val_m=mean(coh_r_po4_val,2);
- for i=1:64
- coh_l_po3_p(i) = invprctile(coh_l_po3_shuf_temp(:,i),coh_l_po3_val_m(i));
- coh_l_po4_p(i) = invprctile(coh_l_po4_shuf_temp(:,i),coh_l_po4_val_m(i));
- coh_r_po3_p(i) = invprctile(coh_r_po3_shuf_temp(:,i),coh_r_po3_val_m(i));
- coh_r_po4_p(i) = invprctile(coh_r_po4_shuf_temp(:,i),coh_r_po4_val_m(i));
- end
- coh_l_p=(coh_l_po3_p+coh_l_po4_p)/2;
- coh_r_p=(coh_r_po3_p+coh_r_po4_p)/2;
- % topo plot
- chann_label=eegdata{1, 1}.label;
- chann_label(20)=[];
- cfg = [];
- cfg.layout = 'easycapM1.mat';
- cfg.xlim = 'maxmin'; % time limitation
- cfg.zlim = [50 100];
- cfg.style = 'straight';
- cfg.colormap = brewermap([],'Reds');
- cfg.colorbar = 'yes';
- % cfg.marker = 'on';
- % cfg.comment = 'xlim';
- % cfg.commentpos = 'lefttop';
- coh_l_plot = {};
- coh_l_plot.avg = coh_l_p'; % data definition, channel * time
- coh_l_plot.time = 1; % time definition
- coh_l_plot.dimord = 'chan_time';
- coh_l_plot.label = chann_label;
- cfg.highlight = 'on';
- cfg.highlightchannel = find(coh_l_p'>95);
- cfg.highlightsymbol = '*';
- cfg.highlightcolor = [1 1 0];
- % cfg.highlightsize = 6;
- ft_topoplotER(cfg, coh_l_plot);
- title('coh_l');
- axis tight;
- cfg = [];
- cfg.layout = 'easycapM1.mat';
- cfg.xlim = 'maxmin'; % time limitation
- cfg.zlim = [50 100];
- cfg.style = 'straight';
- cfg.colormap = brewermap([],'Reds');
- cfg.colorbar = 'yes';
- % cfg.marker = 'on';
- % cfg.comment = 'xlim';
- % cfg.commentpos = 'lefttop';
- coh_r_plot = {};
- coh_r_plot.avg = coh_r_p'; % data definition, channel * time
- coh_r_plot.time = 1; % time definition
- coh_r_plot.dimord = 'chan_time';
- coh_r_plot.label = chann_label;
- cfg.highlight = 'on';
- cfg.highlightchannel = find(coh_r_p'>95);
- cfg.highlightsymbol = '+';
- cfg.highlightcolor = [1 1 0];
- ft_topoplotER(cfg, coh_r_plot);
- title('coh_r');
- axis tight;
- save('coh_fuse.mat','coh_l_p','coh_r_p');
- %% 5. behaviral correlates,两个SSVEP的相位差异与行为之间的相关。circular-linear相关
- phase_diff=circ_mean([phase_l_diff; phase_r_diff]);
- load('D:\OneDrive - hznu.edu.cn\Matlab_workspace\Attention and oscillation\kongqing\Data\beha\exp1\dual_acc.mat');
- load('D:\OneDrive - hznu.edu.cn\Matlab_workspace\Attention and oscillation\kongqing\Data\beha\exp1\dual_rt.mat');
- % acc
- for i=1:length(subj)
- acc_sub(i)=mean(dual_acc{1, subj(i)});
- end
- % RT
- for i=1:length(subj)
- for j=1:320
- if dual_acc{1, subj(i)}(1,j) == 0
- dual_rt{1, subj(i)}(1,j) = NaN;
- end
- end
- rt_sub(i)=mean(dual_rt{1, subj(i)},"omitnan");
- end
- % correlation
- [rho pval] = circ_corrcl(phase_diff', rt_sub');
- [rho pval] = circ_corrcl(abs(phase_diff'), rt_sub');
- % plot
- scatter(phase_diff,rt_sub);
- scatter(abs(phase_diff),rt_sub);
- save('beha_fuse.mat','phase_diff','rt_sub');
fuse.m at commit 7d710bf, no license · at the source
Overview
- Department of Psychology, Hangzhou Normal University,Hangzhou, Zhejiang 311121 China
- Zhejiang Philosophy and Social Science Laboratory for Research in Early Development and Childcare, Hangzhou Normal University,Hangzhou, Zhejiang 311121 China
Abstract
The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.
Repository
Its files are read in the Code ↔ Paper reader above, with 3 matches between paragraphs and lines of code.
perevo/attentiondynamicsKQ
7d710bfb81aa1aa2d384c0850e1263d189c83270, 13 July 2024Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 2 scripts, each with its path and the digest of its content;
- 3 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
Datasets cited
Code and data availability statement
The paper has a code and data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to a dataset: OSF spq89
- it points to the authors' code: perevo/
attentiondynamicsKQ
Read it in the paper: doi.org/10.1186/s12915-026-02630-7.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 4 keywords, 9 MeSH terms, 45 references.
Cite
This paper
Kong, Q., Wang, T., & Jia, J. (2026). Phasic modulation of attentional rhythmic sampling according to task demands. BMC biology, 24(1), 154. https://
BibTeX
@article{kong2026phasic,
author = {Kong, Qing and Wang, Tong and Jia, Jianrong},
title = {{Phasic modulation of attentional rhythmic sampling according to task demands}},
journal = {BMC biology},
year = {2026},
month = may,
volume = {24},
number = {1},
pages = {154},
publisher = {BMC},
issn = {1741-7007},
doi = {10.1186/
url = {https://
pmid = {42141460},
pmcid = {PMC13349037}
}
RIS
TY - JOUR
AU - Kong, Qing
AU - Wang, Tong
AU - Jia, Jianrong
TI - Phasic modulation of attentional rhythmic sampling according to task demands
T2 - BMC biology
J2 - BMC Biol
PY - 2026
DA - 2026/
VL - 24
IS - 1
SP - 154
SN - 1741-7007
PB - BMC
DO - 10.1186/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1186/
"type": "article-journal",
"title": "Phasic modulation of attentional rhythmic sampling according to task demands",
"container-title": "BMC biology",
"author": [
{
"family": "Kong",
"given": "Qing"
},
{
"family": "Wang",
"given": "Tong"
},
{
"family": "Jia",
"given": "Jianrong"
}
],
"container-title-short":
"volume": "24",
"issue": "1",
"page": "154",
"DOI": "10.1186/
"PMID": "42141460",
"PMCID": "PMC13349037",
"ISSN": "1741-7007",
"publisher": "BMC",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
15
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1016/j.isci.2026.116240 [code]
- Physical activity enhances theta-periodicity of visual attentional allocation.Journal: iScienceIn common: CircStat, Statistics and Machine Learning Toolbox, cognitive, 8 references
- [2] doi:10.1038/s41598-026-50726-5
- Rhythmic alternate prioritization in auditory feature-based attention.Journal: Scientific reportsIn common: cognitive, 9 references
- [3] doi:10.7554/elife.108017 [code]
- Visual working memory guides attention rhythmically in humans.Journal: eLifeIn common: Statistics and Machine Learning Toolbox, cognitive, 8 references
- [4] doi:10.1038/s41598-026-49900-6 [code]
- Global neural oscillations underlie performance variability and attentional state fluctuations in humans.Journal: Scientific reportsIn common: CircStat, FieldTrip, Statistics and Machine Learning Toolbox, cognitive, 4 references
- [5] doi:10.1162/imag.a.1229 [code]
- 40 Hz audiovisual stimulation improves sustained attention and related brain oscillations.Journal: Imaging neuroscience (Cambridge, Mass.)In common: CircStat, FieldTrip, Parallel Computing Toolbox, 1 other tool, EEG, 2 references
- [6] doi:10.1523/eneuro.0346-25.2026 [code]
- Effects of TMS on the Decoding and Electrophysiology of Priority in Working Memory.Journal: eNeuroIn common: CircStat, FieldTrip, Statistics and Machine Learning Toolbox, EEG, cognitive, 3 references
- [7] doi:10.1038/s41467-026-70124-9 [code]
- Alpha frequency shapes perceptual sensitivity by modulating optimal phase likelihood.Journal: Nature communicationsIn common: CircStat, Statistics and Machine Learning Toolbox, EEG, cognitive, 3 references
- [8] doi:10.1162/imag.a.1199 [code]
- Sustained alpha oscillations serve attentional prioritization in working memory, not maintenance.Journal: Imaging neuroscience (Cambridge, Mass.)In common: CircStat, FieldTrip, Parallel Computing Toolbox, 1 other tool, EEG, cognitive, 1 reference
- [9] doi:10.1371/journal.pbio.3003938 [code]
- Theta oscillations tag episodic memories for sleep-dependent consolidation.Journal: PLoS biologyIn common: CircStat, FieldTrip, Statistics and Machine Learning Toolbox, EEG, cognitive, 2 references
- [10] doi:10.1523/eneuro.0076-26.2026 [code]
- Exogenously Driven Neural Reactivation of Spatially Matching Visual Working-Memory Contents.Journal: eNeuroIn common: FieldTrip, Statistics and Machine Learning Toolbox, EEG, cognitive, 3 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 2 scripts, and 3 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:05eb2efdd3a9a09f…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
