9 ms·
> to be precise, I calculated the mel-cepstrum and fed it to the network The mel scale cepstrum is inappropriate for pitch detection. You want to use the cepst
by matheist 7y ago
> to be precise, I calculated the mel-cepstrum and fed it to the network
The mel scale cepstrum is inappropriate for pitch detection. You want to use the cepstrum without scaling frequencies. Take the fourier transform, normalize, take logarithms[+], then (inverse) fourier transform in the frequency domain.
The advantage of using the cepstrum for pitch detection is that most signals you're looking at will be harmonic — equally spaced overtones — and so when you take a fourier transform in the frequency domain you'll get a peak corresponding to that equal spacing, which will provide you with the fundamental frequency. (Even if it's missing!)
Using the mel scale totally wrecks that periodicity and throws away the pitch information. (Which is part of why it's used for speech-to-text! In those cases you want to throw away pitch information. Unless you're processing a tonal language, in which case probably don't use the mel scale.)
[+] Why logarithms? In the frequency domain, most harmonic sounds look like the product of a high frequency periodic "signal" (the fundamental and its overtones) with a slowly varying signal (frequencies which are emphasized or de-emphasized, like e.g. formants in the case of speech). Taking the logarithm splits that into the sum of a high frequency signal (overtones) and a low frequency signal (formants), and since the fourier transform is linear, that'll show up as a single peak in the cepstrum corresponding to the gap in overtones (ie the fundamental) and some stuff in the low-frequency bins corresponding to the formants.
- zeroxfe 7y agoThanks, that's very helpful, and explains why mel-cepstrum didn't work so well. So far, I found that I'm getting the best results with FFT + log scale, particularly against audio with fundamentals stripped.