kaldi-asr / kaldi

kaldi-asr/kaldi is the official location of the Kaldi project.
http://kaldi-asr.org
Other
14.3k stars 5.32k forks source link

`MelBanks::Compute` ignores last FFT bin #2949

Closed christoph-conrads closed 5 years ago

christoph-conrads commented 5 years ago

During the FBANK features computation, the power spectrum is computed mapping a vector of dimension n containing Fourier coefficients to a vector of dimension n/2 + 1, see src/feat/feature-fbank.cc, lines 95-96. In the following mel-frequency filterbanks computation, the number of power spectrum coefficients is set to n/2 in src/feat/mel-computations.cc, line 42. That is, the highest frequency Fourier coefficient is ignored.

If this is intentional, what is the reasoning behind it?

danpovey commented 5 years ago

Any time you are about to sample a signal, you'd normally apply some kind of analog or digitial filter to limit the frequency to less than the Nyquist. So there wouldn't be any energy at the Nyquist anyway, if all went well. Anyway we were following HTK code and aiming for compatibility.