-
Notifications
You must be signed in to change notification settings - Fork 0
/
resample2.m
88 lines (50 loc) · 1.96 KB
/
resample2.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
clear all
clc
close all
cfg.data_rootdir='/autofs/space/voima_001/users/fahimeh/temp/';
cfg.protocol='aw';
cfg.highpass=140;
cfg.lowpass=0.5;
fid=fopen('/autofs/space/taito_005/users/fahimeh/doc/txt/list_1.txt');
C=textscan(fid,'%s%s');
subjects=C{1,1};
clear C
fid=fopen('/autofs/space/taito_005/users/fahimeh/doc/txt/list_labels.txt');
C=textscan(fid,'%s');
label_names=C{1,1};
%tag=input('1 or 2:')
visitNo='megdata';
conds=[1002 1005 1008 1011 1014 1017];
k=1;
for isubj=3:17
subj=subjects{isubj};
for icond=1:6
cond=conds(icond);
for iLabel1=35:95
for iLabel2=96:length(label_names)
try
savefilename=[cfg.data_rootdir,'/', subj,'_Coh_' label_names{iLabel1}(1:end-6) '_' ...
label_names{iLabel2}(1:end-6) '_cond' num2str(cond) '_140-0.5_fil.mat'];
load(savefilename)
Coh=resample(Coh',100,500);
iCoh=resample(iCoh',100,500);
PL=resample(PL',100,500);
wPLI=resample(wPLI',100,500);
wPLI_debiased=resample(wPLI_debiased',100,500);
Coh=Coh';
iCoh=iCoh';
PL=PL';
wPLI=wPLI';
wPLI_debiased=wPLI_debiased';
Fs=Fs/5;
command=['rm ' savefilename];
[ct,st]=system(command)
save(savefilename,'nepochs','Fs','iCoh','Coh','PL','wPLI','wPLI_debiased')
catch
failed_s{k}=savefilename;
k=k+1;
end
end
end
end
end