Spectrograms generated using Librosa don't look consistent with Kaldi?

橙三吉。 提交于 2019-12-07 19:30:22

问题


I generated spectrogram of a "seven" utterance using the "egs/tidigits" code from Kaldi, using 23 bins, 20kHz sampling rate, 25ms window, and 10ms shift. Spectrogram appears as below visualized via MATLAB imagesc function:

I am experimenting with using Librosa as an alternative to Kaldi. I set up my code as below using the same number of bins, sampling rate, and window length / shift as above.

time_series, sample_rate = librosa.core.load("7a.wav",sr=20000)
spectrogram = librosa.feature.melspectrogram(time_series, sr=20000, n_mels=23, n_fft=500, hop_length=200)
log_S = librosa.core.logamplitude(spectrogram)
np.savetxt("7a.txt", log_S.T)

However when I visualize the resulting Librosa spectrogram of the same WAV file it looks different:

Can someone please help me understand why these look so different? Across other WAV files I've tried I notice that with my Librosa script above, my fricatives (like the /s/ in "seven" in the above example) are being cutoff and this is greatly affecting my digit classification accuracy. Thank you!


回答1:


Kaldi applies lifter by default on dct output, thats why upper coefficients are attenuated. See details here.



来源:https://stackoverflow.com/questions/43241612/spectrograms-generated-using-librosa-dont-look-consistent-with-kaldi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!