-
Notifications
You must be signed in to change notification settings - Fork 2
/
para_initial.m
71 lines (64 loc) · 2.24 KB
/
para_initial.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
function [ status ] = para_initial( step )
%PARA_INITIAL Summary of this function goes here
% Detailed explanation goes here
setGlobalstr = @(var, num) (strjoin({...
['global ', var, ';'], ...
[var, '=', num2str(num), ';']}));
freq_low = 0.1;
freq_high = 6;
filter_order = 4;
taper_percentile = 0.01;
hampel_win = 0.5;
freq_low_absm = 0.5;
freq_high_absm = 5;
water_level = 10;
winlen_absm = floor(0.5 / freq_low);
winlen_absm = winlen_absm - (mod(winlen_absm, 2) == 0);
max_iter = 15;
seg_seconds = 1200;
xcorr_winlen = 1800;
xcorr_overlap = 0.75;
xcorr_wintype = 'hann';
bandwidth = 0.001;
try
switch step
case 'clear'
clear global
status = 0;
case 'precond'
eval(setGlobalstr('FREQ_LOW', freq_low));
eval(setGlobalstr('FREQ_HIGH', freq_high));
eval(setGlobalstr('FILTER_ORDER', filter_order));
eval(setGlobalstr('TAPER_PERCENTILE', taper_percentile));
eval(setGlobalstr('HAMPEL_WIN', hampel_win));
status = 0;
case 'absmean'
eval(setGlobalstr('FREQ_LOW_ABSM', freq_low_absm));
eval(setGlobalstr('FREQ_HIGH_ABSM', freq_high_absm));
eval(setGlobalstr('FILTER_ORDER', filter_order));
eval(setGlobalstr('WINLEN_ABSM', winlen_absm));
eval(setGlobalstr('WATER_LEVEL', water_level));
eval(setGlobalstr('HAMPEL_WIN', hampel_win));
eval(setGlobalstr('MAX_ITER', max_iter));
case 'specnorm'
eval(setGlobalstr('FREQ_LOW_ABSM', freq_low_absm));
eval(setGlobalstr('FREQ_HIGH_ABSM', freq_high_absm));
eval(setGlobalstr('TAPER_PERCENTILE', taper_percentile));
case 'incisise'
eval(setGlobalstr('SEG_SECOND', seg_seconds));
status = 0;
case 'xcorr'
eval(setGlobalstr('XCORR_WINLEN', xcorr_winlen));
eval(setGlobalstr('XCORR_OVERLAP', xcorr_overlap));
eval(setGlobalstr('XCORR_WINTYPE', xcorr_wintype));
status = 0;
case 'spacxcorr'
eval(setGlobalstr('FILTER_ORDER', filter_order));
eval(setGlobalstr('BANDWIDTH', bandwidth));
otherwise
status = 1;
end
catch ME
rethrow(ME)
end
end