3

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:

kaldi "seven" spectrogram

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:

librosa "seven" spectrogram

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!

kashkar
  • 663
  • 1
  • 8
  • 22

1 Answers1

4

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

Community
  • 1
  • 1
Nikolay Shmyrev
  • 24,897
  • 5
  • 43
  • 87
  • I see, yes I'm familiar with the concept of liftering. Do you know if there's a way to apply liftering to my script in Librosa as well? I also came across this library (http://python-speech-features.readthedocs.io/en/latest/) which seems to have more common ASR options – kashkar Apr 06 '17 at 14:15
  • It should be a standard multiplication on a vector. You can precompute vector before extracting features. – Nikolay Shmyrev Apr 06 '17 at 15:04