LCAV / pyroomacoustics

Pyroomacoustics is a package for audio signal processing for indoor applications. It was developed as a fast prototyping platform for beamforming algorithms in indoor scenarios.
https://pyroomacoustics.readthedocs.io
MIT License
1.33k stars 417 forks source link

ValueError: zero-size array to reduction operation minimum which has no identity #319

Open nsrao98 opened 10 months ago

nsrao98 commented 10 months ago

I get "ValueError: zero-size array to reduction operation minimum which has no identity" error when I try to calculate T60 for impulse response using pyroomacoustics.experimental.rt60.measure_rt60 . The issue arises while calculating i_decay from rt60.py in line 77 of measure_rt60 function .i.e. while executing this line "i_decay = np.min(np.where(-5 - decay_db - energy_db > 0)[0])" . It would be of great help if I get to know how to resolve this issue.

fakufaku commented 10 months ago

Hi @nsrao98 , I have seen this issue before. The RT60 computation has a parameter of how much decay to use to estimate the RT60. The default is decay_db=60, which requires a fairly long response. You could try to set the value to 30 or 20 dB for example. Ideally, the method should be more robust... 😓

nsrao98 commented 10 months ago

Hi @fakufaku, I want to calculate RT60. So, decay_db=60 is the value I need. Setting it to 30 or 20dB won't give me RT60 value, right?

fakufaku commented 10 months ago

It will, the routine just uses a interval with decay of decay_db to do the fit and extrapolates the time to a decay of 60 dB.