mpariente / pystoi

Python implementation of the Short Term Objective Intelligibility measure
MIT License
321 stars 59 forks source link

STOI in pystoi==0.4.0 is inconsistent with the mathlab implementation #34

Closed quancs closed 9 months ago

quancs commented 9 months ago

For the audio examples in the audio_speech.zip, the stoi computed by mathlab is 0.6739, by pystoi==0.3.3 is 0.6739177895331301, while by pystoi==0.4.0 is 0.672038201650704. The difference between mathlab implementation and pystoi==0.4.0 is close to 0.002 which is larger than 1e-3.

import soundfile as sf
import pystoi

r, fs = sf.read('audio_speech.wav')
p, fs = sf.read("audio_speech_bab_0dB.wav")
v = pystoi.stoi(r, p, fs) 
print(v) # 0.6739177895331301 for 0.3.3, 0.672038201650704 for 0.4.0, mathlab is 0.6739

audio_speech.zip

mpariente commented 9 months ago

Thanks for reporting the issue.

Have you actually ran the matlab implementation ? Or you got the value from here ?

@philgzl , this is related to #33, mind taking a look ?

mpariente commented 9 months ago

I reverted the commit, and made a new release 0.4.1 that solves the issue. Feel free to close the issue if you're OK with the fix.

quancs commented 9 months ago

Have you actually ran the matlab implementation ? Or you got the value from here ?

Yes, I ran the matlab implementation on my PC.

I reverted the commit, and made a new release 0.4.1 that solves the issue. Feel free to close the issue if you're OK with the fix.

I checked the new release 0.4.1, the results match the one obtained from the matlab implementation. I will close this issue.