-
Notifications
You must be signed in to change notification settings - Fork 0
/
Parameter.py
100 lines (84 loc) · 2.4 KB
/
Parameter.py
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
89
90
91
92
93
94
95
96
97
98
99
'''
Parameter setting rules:
View range: 0-8000Hz Fs=16000
Window length: 0.005s NFFT = int(Fs*0.005) = 80
overlap = int(Fs*0.0025) = 40
Dynamic range: 70dB n/a
Time steps: 1000 n/a
Frequency steps: 250
Window shape: Gaussian default window is hanning change to gaussian
'''
'''
Where 1 sets a diamond morphology which implies that diagonal elements are not considered as neighbors
And 2 sets a square mask, i.e. all elements are considered neighbors.
'''
CONNECTIVITY_MASK = 2
'''
Sampling rate, related to the Nyquist conditions, which affects
the range frequencies we can detect.
'''
# DEFAULT_FS = 1600
DEFAULT_FS = 3200
'''
Size of the FFT window, affects frequency granularity
'''
DEFAULT_WINDOW_SIZE = 4096
'''
Ratio by which each sequential window overlaps the last and the
next window. Higher overlap will allow a higher granularity of offset
matching, but potentially more fingerprints.
'''
DEFAULT_OVERLAP_RATIO = 0.5
'''
Degree to which a fingerprint can be paired with its neighbors--higher
will cause more fingerprints, but potentially better accuracy.
'''
DEFAULT_FAN_VALUE = 15
'''
Minimum amplitude in spectrogram in order to be considered as a peak.
This can be raised to reduce number of fingerprints, but can also negatively
affect accuracy.
'''
DEFAULT_AMP_MIN = 10
'''
Number of cells around an amplitude peak in the spectrogram in order
to consider it as a spectral peak. Higher values mean less
fingerprints and faster matching, but potentially affect accuracy.
'''
PEAK_NEIGHBORHOOD_SIZE = 20
'''
Sensitivity value, the higher value make a higher sensitivity
and vice versa, affecting the choice of threshold value.
'''
SENSITIVITY = 0.1
'''
This parameter is the matrix percentage value used in the
calculation of the threshold, which has an impact on the calculation of
the threshold and needs to be adjusted appropriately according to the size of the dataset.
'''
MASK_P = 250
'''
Whether to check the drawing
'''
PLOTS = False
'''
Blocking value
'''
CHUNK_SIZE = 1000
'''
According to the study of previous experiments, the K_VALUE value is selected as 75.
'''
K_VALUE = 75
'''
To avoid memory overflow, it is wiser to split the batch calculation.
Adjust it according to physical memory size.
'''
BATCH = 50
'''
Length of sliding window.
'''
SLIDE_WINDOW_LENGTH = int(K_VALUE * 0.1)
'''
Epsilon.
'''
EPSILON = 1e-10