craffel / mir_eval

Evaluation functions for music/audio information retrieval/signal processing algorithms.
MIT License
588 stars 109 forks source link

why is SDR not infinity even though reference and estimate are eqaul? #285

Closed chosw93 closed 5 years ago

chosw93 commented 5 years ago

I put the same audio file in both inputs of the 'bss_eval_sources' function. but SDR is not infinity but around 290 dB... Why does this happen?

faroit commented 5 years ago

This is probably due to some numerical instabilities. Are you running it on 32bit floats? Also have you tried BSSeval v4 for comparison?

bmcfee commented 5 years ago

Can you provide a full example code snippet that reproduces this behavior? (Synthetic signals ought to be fine for this.)

My hunch is that it's just a numerical precision / stability quirk. 290 dB may as well be infinite, but the check for returning np.Inf requires an exact 0: https://github.com/craffel/mir_eval/blob/master/mir_eval/separation.py#L827-L834 .

chosw93 commented 5 years ago

@faroit Thank you for answer me! The variable type is 32bit float. And the BSSeval v4 ('.metrics.bss_eval_source's) also return around 290 dB. i just accept that 290dB is infinity.

faroit commented 5 years ago

did you try with dtype 64bit float?