Open FredrikKarlssonSpeech opened 1 year ago
Hi, sorry for the late response!
From looking at the source(s), I would assume that
F.compute_kaldi_pitch
frame_length
(in milliseconds) would correspond to frame_time
in the other two functions (in seconds) frame_shift
in F.compute_kaldi_pitch
would indicate overlap (as in spectrogram calculation), andwin_length
in functional_detect_pitch_frequency
relates only to median smoothing (but I didn't look into that in detail)But I might be wrong :-) Let me know if that helps?
By the way, detect_pitch_frequency
is available in Python, too, in case you'd like to cross-test the function directly (https://pytorch.org/audio/stable/generated/torchaudio.functional.detect_pitch_frequency.html#torchaudio.functional.detect_pitch_frequency).
Oh and please install the most recent torchaudio from CRAN :-) You would now load a sound like this:
audio <- transform_to_tensor(torchaudio_load(origSoundFile))
i just wanted to point out that there is something off in the NFCC calculations in torchaudio that is not present in pytorchaudio and therefore seems to not be carried over from there. I run some code that uses pytorchaudio to compute pitch using the kaldi method
and when I then look at the output, I am convinced that what I actually got was values from windowed portions of the signal.
Kaldi pitch extraction is not exposed by torchaudio, but you can get NFCCs using the functional__compute_ncc function. But then I get confused as while this code (using the native pitch detection), I get nothing like the python output in NFCCs
Optimally, these two R functions should correspond in dimensions with the python interface ones, and with identical window shift lengths (10ms in this case), the dimensions should be the same from detect_pitch and compute_nfcc, right?