craffel/mir_eval

`separation.bss_eval_sources()` and `separation.bss_eval_sources_framewise()`

Yossarian0916 opened this issue · 2 comments

Although the docs describe the differences between these two functions, it's still unclear, even the returned results from these two functions have different shapes. Could someone elaborate the differences and the usage of separation.bss_eval_sources() and separation.bss_eval_sources_framewise()?

@faroit Any thoughts?

bss_eval_sources_framewise computes several bss_eval_sources as set by the window and hop parameter. if your signals are short: use non-framewise, if your signals are long >10s, use the framewise metric.

See the main loop in the code to understand whats going on:

for k in range(nwin):
win_slice = slice(k * hop, k * hop + window)
ref_slice = reference_sources[:, win_slice, :]
est_slice = estimated_sources[:, win_slice, :]
# check for a silent frame
if (not _any_source_silent(ref_slice) and
not _any_source_silent(est_slice)):
sdr[:, k], isr[:, k], sir[:, k], sar[:, k], perm[:, k] = \
bss_eval_images(
ref_slice, est_slice, compute_permutation
)