-
Notifications
You must be signed in to change notification settings - Fork 930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NaN values from LPC implementation at high LPC order #1736
Comments
Interesting, thanks for the thorough report. It definitely smells like numerical underflow. Can you check if you still get this issue if the input signal is in float64 format instead of float32? (You can do this by saying |
Quick follow-up, now that I'm back on a proper computer. I tried the above example with float64 format, and it indeed works correctly: wave length: 110250
sampling rate: 22050 Hz
lpc array: [ 1. -4.71516293 12.09485601 -22.75681033 34.43338165
-43.07836799 44.19407855 -35.06638442 16.77655389 5.5244911
-24.3623252 32.94244647 -28.39704634 13.30435169 5.32552459
-19.21720199 22.78459487 -15.56335598 2.09073033 10.51883742
-16.24249484 13.10109408 -3.61684028 -6.87816967 13.16809423
-12.71038931 6.50011478 1.83293082 -8.20037027 10.08608018
-7.38530683 2.00052831 3.43773793 -6.93480838 7.80720865
-6.60083495 4.44658485 -2.38231029 0.98047271 -0.28840149
0.04929236]
lpc shape: (41,) Since it also works with jit compilation disabled, I think we can safely say that this is upstream behavior due to the compiler optimizer. There may be some part of the code that we could restructure to be more numerically stable in reduced precision, but nothing immediately jumps out to me. |
Describe the bug
An output obtained from the LPC function shows NaNs when using a higher LPC order like 40 with the example provided in https://librosa.org/doc/main/generated/librosa.lpc.html.
This problem may be caused from using Numba’s JIT compiler for optimization.
To Reproduce
output:
Expected behavior
Without the JIT compiler, it seems that we could get the expected LPC array.
output:
Software versions*
The text was updated successfully, but these errors were encountered: