-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path__init__.py
51 lines (40 loc) · 1.33 KB
/
__init__.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
# MIT License
#
# Copyright (c) 2021 Sangchun Ha
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
from dataclasses import dataclass
@dataclass
class FeatureConfig:
extension: str = "pcm"
sampling_rate: int = 16000
frame_length: float = 0.020
frame_stride: float = 0.010
normalize: bool = False
spec_augment: bool = False
num_time_mask: int = 1
num_freq_mask: int = 1
@dataclass
class MelSpectrogramConfig(FeatureConfig):
feature_extraction: str = 'melspectrogram'
n_mel: int = 80
freq_mask_parameter: int = 18
@dataclass
class SpectrogramConfig(FeatureConfig):
feature_extraction: str = 'spectrogram'
n_mel = 0 # not used
freq_mask_parameter: int = 24
@dataclass
class MFCCConfig(FeatureConfig):
feature_extraction: str = 'mfcc'
n_mfcc: int = 40
freq_mask_parameter: int = 8
@dataclass
class FilterBankConfig(FeatureConfig):
feature_extraction: str = 'filterbank'
n_mel: int = 80