a tip about Nan problem #22
Replies: 3 comments
-
Hi, @YangangCao Thank you for let us know this solution. I was getting in to deeply how pitch estimation is working in PercepNet
I don't think my understanding is correct. could you tell me which part you added for exceptional decision on code? |
Beta Was this translation helpful? Give feedback.
-
Hi @jzi040941
As to the pitch calculate, I recommend you to read this doc https://jmvalin.ca/papers/aes135_opus_silk.pdf#:~:text=Vos%20et%20al.%20Voice%20Coding%20with%20Opus%20carded,residual%20taking%20into%20account%20the%20LSF%20quantization%20e%0Bects. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your kind explanation and reference doc |
Beta Was this translation helpful? Give feedback.
-
Hi All
When we calculate lpc, auto correlation series is needed. However, if the element in auto correlation series all are zero, nan will appears. (Test code is in offered in the end)
PercepNet calculates pitch using auto correlation. In function "_celt_autocorr" in celp_lpc.cpp, if the absolute value of ac[0]、ac[1]、ac[2] and ac[3] all are less than 1e-10, Nan maybe appear. (I don't know why Nan isn't must appear, but I think it's must be wrong feature in this frame)
I try to add a decision about it, if less than 1e-10, just recursive
return -1
and addcontinue
to calculate the next frame. By do this, I avoid Nan.Beta Was this translation helpful? Give feedback.
All reactions