code: def _bss_crit(s_true, e_spat, e_interf, e_artif, bsseval_sources_version):
      
      # energy ratios
      if bsseval_sources_version:
          s_filt = s_true + e_spat
          energy_s_filt = np.sum(s_filt**2)
          sdr = _safe_db(energy_s_filt,
                         np.sum((e_interf + e_artif)**2))
          isr = np.empty(sdr.shape) * np.nan
          sir = _safe_db(energy_s_filt, np.sum(e_interf**2))
          sar = _safe_db(np.sum((s_filt + e_interf)**2),
                         np.sum(e_artif**2))
      else:
          energy_s_true = np.sum((s_true)**2)
          sdr = _safe_db(energy_s_true,
                         np.sum((e_spat + e_interf + e_artif)**2))
          isr = _safe_db(energy_s_true, np.sum(e_spat**2))
          sir = _safe_db(np.sum((s_true + e_spat)**2), np.sum(e_interf**2))
          sar = _safe_db(np.sum((s_true + e_spat + e_interf)**2),
                         np.sum(e_artif**2))
  
      return (sdr, isr, sir, sar)
docs: Measurement of the separation quality for a given source in terms of
      filtered true source, interference and artifacts.