Skip to content

Commit

Permalink
feat: 为Logfbank特征增加可配置的滤波器数参数
Browse files Browse the repository at this point in the history
  • Loading branch information
nl8590687 committed Mar 5, 2022
1 parent d4e4759 commit 5554406
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions speech_features/speech_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,14 @@ class Logfbank(SpeechFeatureMeta):
'''
ASRT语音识别内置的logfbank声学特征提取类
'''
def __init__(self, framesamplerate = 16000):
def __init__(self, framesamplerate = 16000, nfilt=26):
self.nfilt = nfilt
super().__init__(framesamplerate)

def run(self, wavsignal, fs = 16000):
wavsignal = np.array(wavsignal, dtype=np.float)
# 获取输入特征
wav_feature = logfbank(wavsignal, fs)
wav_feature = logfbank(wavsignal, fs, nfilt=self.nfilt)
return wav_feature

class Spectrogram(SpeechFeatureMeta):
Expand Down

0 comments on commit 5554406

Please sign in to comment.