prepare_ImaGIN_spm_eeg_filter.m
837 Bytes
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
function prepare_ImaGIN_spm_eeg_filter(FilterBand, FilterType, FilterOrder, CutFreq, FileIn, FileOut)
% FileIn: path linking to the MEEG file to correct
% DirOut: path of the output directory
% FilterBand: band of frequency to keep ('low' or 'high')
% FilterType: type of the filter (ex: 'butterworth')
% FilterOrder: order of the filter (from 1 to...)
% CutFreq: cutoff frequency (Hz)
S = [];
S.D=FileIn;
S.filter.band = FilterBand;
S.filter.type = FilterType;
if ischar(FilterOrder)
FilterOrder=str2num(FilterOrder);
end
S.filter.order = FilterOrder;
S.filter.dir = 'twopass';
if strcmp(FilterBand,'stop')
CutFreq = [48 52];
end
if ischar(CutFreq)
CutFreq=str2num(CutFreq);
end
S.filter.PHz = CutFreq;
%S.pre = 'f';
S.FileOut=FileOut;
D = ImaGIN_spm_eeg_filter(S);
set_final_status('OK')
close all
end