jaakkopasanen/Impulcifer

Error cannot convert float NaN to integer need to fix

Opened this issue · 0 comments

https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3626

(venv) C:\Windows\System32\Impulcifer>python impulcifer.py --test_signal="data/sweep-6.15s-48000Hz-32bit-2.93Hz-24000Hz.pkl" --dir_path="F:\바탕화면\측정"
Creating impulse response estimator...
Running room correction...
Running headphone compensation...
Creating headphone equalization...
Creating frequency response target...
Opening binaural measurements...
C:\Windows\System32\Impulcifer\venv\lib\site-packages\scipy\stats\_stats_mstats_common.py:130: RuntimeWarning: invalid value encountered in double_scalars
slope = r_num / ssxm
C:\Windows\System32\Impulcifer\venv\lib\site-packages\scipy\stats\_stats_mstats_common.py:140: RuntimeWarning: invalid value encountered in sqrt
t = r * np.sqrt(df / ((1.0 - r + TINY)*(1.0 + r + TINY)))
C:\Windows\System32\Impulcifer\venv\lib\site-packages\scipy\stats\_stats_mstats_common.py:142: RuntimeWarning: invalid value encountered in double_scalars
sterrest = np.sqrt((1 - r**2) * ssym / ssxm / df)
Traceback (most recent call last):
File "impulcifer.py", line 556, in <module>
main(**create_cli())
File "impulcifer.py", line 84, in main
write_readme(os.path.join(dir_path, 'README.md'), hrir, fs)
File "impulcifer.py", line 417, in write_readme
peak_ind, knee_point_ind, noise_floor, window_size = ir.decay_params()
File "C:\Windows\System32\Impulcifer\impulse_response.py", line 120, in decay_params
n = int(len(squared) / self.fs / wd) # Number of time windows
ValueError: cannot convert float NaN to integer

There's been a bug like this since a long time ago.
The impulcifer often experiences an error called float NaN to integrer.
If a recorded file is recorded incorrectly in the first place, understandably, even a normal file sometimes experiences such an error.
My way around that is to loop FL,FR or Hesuvi (no headphone) back using VBcable and Audacity, REW.
Then something is not changed and recorded again, but there were times when that error was avoided.

What's even weird is that when applying headphone correction, for example, it can be converted well even if you use Decay parameter, and when headphone correction is turned off, such error can occur even if you don't use Decay parameter.

In that case, loopback can sometimes solve it, but it wasn't a perfect solution.